CLI Reference Version v5.2.1 Apigee X & Hybrid Bun Native

Aft Documentation

Apigee Feature Templater (aft) is a lightning-fast, zero-dependency CLI tool built for modern Apigee development. It converts effortlessly between Apigee ZIP proxy bundles, concise YAML proxies, and JSON formats, while providing modular feature composition, remote Apigee X deployments, and full developer/product exports.

curl -fsSL https://raw.githubusercontent.com/apigee/apigee-templater/main/install.sh | sh

No commands or topics matched your search.

🚀 Installation & Setup

AFT is compiled into single-file, zero-dependency binaries for Linux, macOS, and Windows. No Node.js or Bun runtime is required on the host system.

Option 1: One-Line Installer (Recommended)

Automatically downloads the appropriate binary for your OS and architecture, places it in your PATH, and sets execute permissions.

macOS & Linux (Bash/Zsh)
curl -fsSL https://raw.githubusercontent.com/apigee/apigee-templater/main/install.sh | sh
Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/apigee/apigee-templater/main/install.ps1 | iex

Option 2: Standalone Binary Downloads

Download directly from GitHub Releases:

  • Linux (x64): aft-linux-x64
  • Linux (ARM64): aft-linux-arm64
  • macOS Apple Silicon: aft-darwin-arm64
  • macOS Intel: aft-darwin-x64
  • Windows (x64): aft-windows-x64.exe

⚡ CLI Commands Reference

AFT offers 7 primary commands designed for composable, non-destructive workflows.

aft convert

Default Command
aft [convert] [options] [<input>] [<output>]

The primary engine of AFT. Converts between Apigee proxy ZIP bundles, concise YAML proxies, and JSON formats. Applies and removes modular features, instantiates templates with parameter substitutions, converts between features and SharedFlow ZIP bundles, or creates new proxies and templates from scratch.

Command Options

Option Description
-i, --input <path|name> Input ZIP bundle, YAML/JSON file, or remote Apigee resource name.
-o, --output <path> Target output file or directory path (e.g. proxy.yaml, bundle.zip, ./proxies/).
-f, --format <format> Target conversion format: 'proxy', 'template', 'feature', 'product', 'user', 'deployment', or 'sharedflow' ('sf').
-a, --applyFeature <name> Apply a feature (or comma-separated list of features) to a template or proxy.
-r, --removeFeature <name> Remove a feature (or comma-separated list) from a template or proxy.
-p, --parameters <list> Parameter substitutions for template instantiation (e.g. param1=val1,param2=val2).
-b, --basePath <path> Base path when scaffolding a new proxy or template (e.g. /v1/weather).
-u, --targetUrl <url> Backend target URL when scaffolding a new proxy or template.
-n, --name <name> Resource name for output template, feature, or proxy.
--organization, --org, --project <name> Target Apigee organization or GCP project for deployment or export.
--environment, --env <name> Apigee environment name to deploy the proxy revision to (e.g. dev, prod).
--service-account, --sa <name|email> Google Cloud service account email or name attached to proxy deployment. If not an email address, automatically formats as {sa-name}@{project-id}.iam.gserviceaccount.com.
--delete Delete Apigee resources defined in input template, product, user, deployment, or proxy.
-d, --drz <region> Specify DRZ endpoint region ('us', 'eu', 'in') for data-residency compliance.

Examples

Convert Apigee ZIP Bundle to concise YAML
Decompresses an Apigee proxy ZIP bundle and generates a clean, single-file YAML specification with all policies, flows, and resources.
aft -i ./bundles/WeatherAPI.zip -o WeatherAPI.yaml
Compile YAML Proxy to deployable ZIP Bundle
Compiles a YAML proxy into an official Apigee-compliant ZIP bundle ready for import via apigeecli or Cloud Console.
aft -i WeatherAPI.yaml -o WeatherAPI.zip
Deploy Full-Stack Deployment YAML to Apigee Project
Deploys an entire multi-resource Deployment YAML (proxies, products, KVMs, users, credentials) to an Apigee X environment in a single command.
aft -i deployment.yaml --project my-gcp-project --environment dev
Export Deployment YAML for Apigee Emulator
Compiles a Deployment YAML into proxy ZIP bundles and emulator JSON manifests (products.json, developers.json, apps.json, maps.json).
aft -i deployment.yaml -f zip -o ./emulator-dist/
Create a new Proxy from scratch with BasePath and Target
Scaffolds a complete Apigee proxy YAML configured with an endpoint base path and backend target URL.
aft -n Customers-v1 -b /v1/customers -u https://api.example.com/customers -o Customers-v1.yaml
Apply Security & CORS Features to a Proxy
Injects authentication and CORS policies into an existing proxy using pre-built repository features.
aft WeatherAPI.yaml -a auth-apikey-verify,cors -o WeatherAPI-Secured.yaml
Instantiate a Template with Parameter Substitutions
Takes a template referencing features and renders a concrete proxy by filling in parameter placeholders.
aft -i Template-AI-Gateway.yaml -p Model=gemini-2.5-flash,Project=my-gcp-proj -o Proxy-AI.yaml
Convert Feature to SharedFlow ZIP Bundle
Converts a feature YAML file into an Apigee SharedFlow ZIP bundle for deployment as a reusable flow.
aft -i auth-apikey-verify.yaml -f sf -o SF-ApiKeyVerify.zip
Deploy Proxy directly to Apigee Environment
Deploys a local YAML proxy directly to an Apigee X environment, attaching a service account (short name or email) if needed.
aft -i WeatherAPI.yaml --org my-org --environment dev --sa apigee-sa

aft describe

Inspection
aft describe <input> | aft <input>

Inspects and summarizes any local file, remote repository resource (template, proxy, feature, product, user, or deployment), or Apigee organization configuration (--project). Renders a high-contrast terminal card detailing the name, description, endpoints, target URLs, flows, policies, parameters, KVMs, products, or org runtime settings without modifying or creating files. If given a non-existent filename as a single argument, AFT safely creates an empty template proxy instead.

Command Options

Option Description
<input> Path to a local YAML/JSON file, or the identifier of a feature/template in the repository.
-i, --input <path|name> Explicit flag alternative for the input resource.
--project, --org, --organization <name> Inspect Apigee organization/project configuration, or scope remote resources.
-f, --format <format> Output format: 'json' or 'yaml' for raw payloads, or format hint ('proxy', 'template', 'feature', 'product', 'user', 'deployment', 'sf').
-t, --token <token> Google Cloud OAuth2 token (defaults to Application Default Credentials).
-d, --drz <region> Specify DRZ endpoint ('us', 'eu', 'in').

Examples

Describe an Apigee Organization / GCP Project
Queries and inspects runtime and organizational configuration for an Apigee organization (GCP project, analytics region, billing type, trial expiration, environments, environment groups, and hostnames).
aft describe --project my-apigee-org
Export Organization Configuration to JSON / YAML
Fetches full organization details and prints the raw JSON or YAML response.
aft describe --project my-apigee-org -f json
Describe a Full-Stack Deployment YAML
Displays a consolidated overview of all templates, proxies, products, KVMs, users, and tests defined in a Deployment YAML.
aft describe deployment.yaml
Describe a local Proxy YAML
Outputs an overview card showing endpoints, targets, pre/post flows, and policies for a local proxy file.
aft describe SimpleProxy-v1.yaml
Quick inspection shorthand (Single argument)
Passing any existing file or repository resource directly as a single argument automatically triggers describe without writing files.
aft ai-target-googlecloud
Describe a Repository Feature
Fetches and displays metadata, parameters, target endpoints, policies, and flow steps for a catalog feature.
aft describe auth-apikey-verify
Describe an Apigee Product YAML
Displays approval type, environments, proxies, and quota limits defined in an API Product YAML.
aft describe standard-api-product.yaml
Describe a Developer User YAML
Displays developer details, registered apps, and associated credential configurations.
aft describe developer-john.yaml

aft reset

Reset
aft reset <input> [options]

Resets a template, feature, or proxy file to its default empty contents. For templates, removes all features, parameters, endpoints, and targets. For features, removes all policies, flows, and resources while leaving endpoints and targets with no flow steps. For proxies, removes all policies, flows, and resources while leaving endpoints and targets with no flow steps.

Command Options

Option Description
<input> Path to a local YAML or JSON template, feature, or proxy file to reset.
-i, --input <path> Explicit flag alternative for the input file.
-o, --output <path> Optional destination path to write the reset file to (defaults to in-place overwrite).

Examples

Reset a Template to Empty Starter Definition
Clears all features, parameters, endpoints, and targets from a template file in-place.
aft reset MyTemplate.yaml
Reset a Feature (Clear Policies & Flows)
Removes all policies, flows, and resources from a feature file, leaving endpoints and targets with no flow steps.
aft reset MyFeature.yaml
Reset a Proxy to Clean Endpoints & Targets
Strips all policies, flows, and resources from a proxy while preserving endpoints and target routes.
aft reset SimpleProxy-v1.yaml
Reset and Write to a New File
Resets the input file and writes the clean result to an alternative output destination.
aft reset MyTemplate.yaml -o CleanTemplate.yaml

aft list

Catalog
aft list [options] | aft -l | aft --list

Browses all pre-built templates and features available in the central GitHub repository (https://github.com/gcp-samples/apigee-template-repository ↗). Supports structured output in JSON or YAML formats for integration with CI/CD pipelines and developer tooling. Results are cached locally for 24 hours.

Command Options

Option Description
-l, --list, --listFeatures Flag alternative to the 'list' command.
-f, --format <json|yaml> Output format: 'json' or 'yaml' for machine-readable catalog representations.
--listTemplates List templates catalog.

Examples

List all Repository Templates and Features in Terminal
Displays an interactive colored list of all available templates and features in the catalog.
aft list
Export Catalog as JSON
Returns the full catalog of features and templates in structured JSON format for scripting.
aft list -f json
Export Catalog as YAML
Outputs the complete catalog of features and templates formatted as YAML.
aft list -f yaml

aft completion

Tooling
aft completion <install | uninstall | zsh | bash | fish | powershell>

Installs or displays dynamic shell tab-completion scripts. Provides context-aware auto-completion for commands, flags, formats, and repository feature names across Zsh, Bash, Fish, and Windows PowerShell.

Command Options

Option Description
install Auto-detects active shell and appends completion loader to ~/.zshrc, ~/.bashrc, config.fish, or PowerShell $PROFILE.
uninstall Removes AFT completion configuration from your shell profile.
zsh Prints raw Zsh completion script to stdout for manual sourcing.
bash Prints raw Bash completion script to stdout for manual sourcing.
fish Prints raw Fish completion script to stdout for manual sourcing.
powershell Prints raw PowerShell completion script to stdout (alias: pwsh).

Examples

Auto-install shell completion for active shell
Detects your shell and configures tab-completion automatically.
aft completion install
Manually source Zsh completion in current session
Quickly activates tab-completion in the current terminal window without editing ~/.zshrc.
source <(aft completion zsh)
Generate completion script for Fish shell
Saves completion rules into Fish configuration directory.
aft completion fish > ~/.config/fish/completions/aft.fish
Uninstall shell completions
Removes all AFT completion hooks from your shell configuration files.
aft completion uninstall

aft skill

Tooling
aft skill <install | uninstall>

Manages the native Apigee Templater skill for AI coding assistants. Installs the SKILL.md specification and guides into ~/.agents/skills/apigee-templater, enabling tools like Google Antigravity, Gemini CLI, Claude Code, Cursor, and Codex to author and debug AFT proxies automatically.

Command Options

Option Description
install Installs the apigee-templater skill to ~/.agents/skills/apigee-templater.
uninstall Removes the apigee-templater skill from ~/.agents/skills/apigee-templater.

Examples

Install AI Agent Skill
Equips local AI coding assistants with Apigee proxy rules, policy patterns, and templater CLI capabilities.
aft skill install
Uninstall AI Agent Skill
Removes the skill definition from the local assistant skills directory.
aft skill uninstall

aft cache

Tooling
aft cache <clear>

Manages the local cache of templates, features, and schemas downloaded from the repository. The cache is stored in ~/.aft/cache/ and automatically expires after 24 hours. Use this command to force an immediate refresh of the catalog.

Command Options

Option Description
clear Clears cached features, templates, and products from ~/.aft/cache/.

Examples

Clear local repository cache
Deletes cached repository files so the next AFT command fetches fresh definitions directly from GitHub.
aft cache clear
Unified Architecture Declarative GitOps Apigee Emulator Ready

📦 Full-Stack Deployment YAML Specification

Deployment YAML (type: deployment) is a unified declarative manifest designed for modern Apigee GitOps. Instead of managing fragmented proxy files, API products, developer credentials, and Key-Value Maps across disparate directories and executing disjointed deployment scripts, a single Deployment YAML bundles all Apigee resource types into one coherent, version-controllable ecosystem manifest.

Key Capability: Linked Files + Embedded Resources
Deployment YAML natively supports both external YAML file references (e.g. templates: [ templates/AI-Completions.yaml ]) and inline embedded resources (defining proxies, products, KVMs, users, credentials, and tests directly in the same file), or any hybrid combination thereof.

1. Deployment Architecture & Why It Exists

Architecture

In production Apigee environments, an API proxy never lives in isolation. It relies on backend routing configurations, security policies, Key-Value Maps (KVMs) for runtime lookups, API Products to govern quotas and operations, Developer Users who own client applications, API Keys / Secrets for authentication, Data Collectors for runtime telemetry, and automated tests to verify contract validity.

Traditionally, deploying this ecosystem required running several sequential tools (e.g., creating KVMs first, then deploying proxy revisions, then provisioning products, then issuing credentials, then running test runners). If any step failed, the environment was left in a half-configured state.

With AFT Deployment YAML:

  • Single Source of Truth: Every asset required to run, secure, and test the API is captured in one manifest.
  • Coordinated Multi-Asset Deployment: One CLI command deploys Data Collectors → Proxies & Templates → API Products → Developer Users & Apps → Custom Reports in proper dependency order.
  • Clean Teardown: One command deletes the entire ecosystem in reverse dependency order (Users → Products → Proxies → Reports → Data Collectors) without leaving orphaned assets.
  • Offline Emulation: Directly exports proxy bundles and emulator JSON configuration files (products.json, developers.json, developerapps.json, maps.json) for instantaneous testing with Apigee Emulator Service ↗.

2. Start Simple: Minimal Starter Deployment (Linked Files)

Starter Example

The simplest way to use Deployment YAML is to link existing external template, product, and user YAML files. AFT resolves relative file paths starting from the deployment file's directory. If a file is not found locally, AFT automatically searches the central Apigee Template Repository ↗.

# yaml-language-server: $schema=https://raw.githubusercontent.com/apigee/apigee-templater/main/schema/gateway.schema.1.0.json
gateway: apigee
schemaVersion: 1.0.0
name: starter-deployment
type: deployment
description: Minimal deployment linking modular templates, products, and users

environments:
  - dev

# Links to external YAML files (relative or repository names)
templates:
  - templates/REST-AI-Completions.yaml

products:
  - products/ai-starter-package.yaml

users:
  - users/partner-developer.yaml
Inspect with Describe
Preview all linked assets and their resolved endpoints without deploying:
aft describe starter-deployment.yaml

3. Comprehensive Full-Stack Manifest (Embedded & Linked)

Complete Specification

A production-ready Deployment YAML can embed standalone proxies, environment-scoped and proxy-scoped KVMs, advanced API products (REST, LLM, and MCP tools), developer identities with pre-provisioned credentials, telemetry collectors, and automated test assertions:

# yaml-language-server: $schema=https://raw.githubusercontent.com/apigee/apigee-templater/main/schema/gateway.schema.1.0.json
gateway: apigee
schemaVersion: 1.0.0
name: enterprise-ai-suite
displayName: Enterprise AI Gateway Suite
type: deployment
description: Production-grade deployment with proxy templates, direct proxies, KVMs, products, users, telemetry, and automated tests.
environments:
  - dev
  - prod

# 1. Composed Proxy Templates (referencing modular features)
templates:
  - REST-AI-Completions.yaml

# 2. Standalone Direct Proxies (embedded inline or linked)
proxies:
  - name: MockServiceProxy-v1
    displayName: Mock Service Proxy
    type: proxy
    description: Mock edge service with JavaScript response manipulation
    endpoints:
      - name: default
        basePath: /v1/mock
        routes:
          - name: default
            target: default
        flows:
          - name: PostFlow
            mode: Response
            steps:
              - name: JS-AddTimestamp
    targets:
      - name: default
        url: https://mocktarget.apigee.net
    policies:
      - name: JS-AddTimestamp
        type: Javascript
        content:
          Javascript:
            metadata:
              name: JS-AddTimestamp
            Source: |
              var body = JSON.parse(response.content || "{}");
              body.edgeTimestamp = Date.now();
              response.content = JSON.stringify(body);

# 3. Key-Value Maps (Environment-Scoped & Proxy-Scoped)
kvms:
  - name: GlobalEnvConfig
    type: environment
    values:
      ROUTING_TIER: enterprise-tier
      UPSTREAM_TIMEOUT: "3500"
      ENABLE_DEBUG_HEADERS: "false"
  - name: MockRoutingKvm
    type: proxy
    proxy: MockServiceProxy-v1
    values:
      DEFAULT_REGION: us-central1
      MAX_PAYLOAD_SIZE_KB: "1024"

# 4. API Products (Governing REST, LLM Model Garden, and MCP Tool Calls)
products:
  - name: enterprise-ai-product
    displayName: Enterprise AI Product
    type: product
    description: Bundled access to Gemini completions, mock service, and MCP CRM tools
    access: public
    approvalType: auto
    environments:
      - dev
    proxies:
      - REST-AI-Completions
      - MockServiceProxy-v1
    quota: "100000"
    quotaInterval: "1"
    quotaTimeUnit: month
    operations:
      - apiSource: MockServiceProxy-v1
        operations:
          - name: /json
            methods: [GET]
    llmOperations:
      - apiSource: REST-AI-Completions
        operations:
          - name: /v1/chat/completions
            methods: [POST]
            model: gemini-2.5-flash
            llmTokenQuota:
              limit: "25000"
              interval: "1"
              timeUnit: minute
    payloadOperations:
      - apiSource: REST-AI-Completions
        protocol: MCP
        operations:
          - name: tools/list
          - name: tools/call/get_customer_profile
            quota:
              limit: "120"
              interval: "1"
              timeUnit: minute

# 5. Developer Users, Apps & Pre-Provisioned API Credentials
users:
  - name: partner-dev
    type: user
    email: partner-dev@example.com
    firstName: Partner
    lastName: Developer
    userName: partnerdev
    status: active
    apps:
      - name: Enterprise Analytics Client
        displayName: Enterprise Analytics Client
        status: approved
        products:
          - enterprise-ai-product
        credentials:
          - consumerKey: client-api-key-998877
            consumerSecret: client-secret-554433
            status: approved
            products:
              - enterprise-ai-product

# 6. Data Collectors (Runtime Telemetry Capture)
dataCollectors:
  - name: dc_ai_model
    type: datacollector
    collectorType: STRING
    description: Name of the AI model invoked
  - name: dc_ai_prompt_token_count
    type: datacollector
    collectorType: INTEGER
    description: Token count for the request prompt

# 7. Custom Analytics Reports
reports:
  - name: ai_token_usage_by_model
    displayName: "AI Token Usage by Model"
    type: report
    chartType: col
    timeUnit: hour
    metrics:
      - name: dc_ai_prompt_token_count
        function: sum
    dimensions:
      - apiproxy
      - dc_ai_model

# 8. Automated Runtime Test Assertions
tests:
  - name: test-chat-completions-auth
    description: Validates end-to-end authorization and 200 OK status
    proxy: REST-AI-Completions
    product: enterprise-ai-product
    path: /v1/chat/completions
    method: POST
    injectGoogleToken: true
    headers:
      Content-Type: application/json
      x-api-key: client-api-key-998877
    body: |
      {
        "model": "gemini-2.5-flash",
        "messages": [{"role": "user", "content": "Ping"}]
      }
    assertions:
      - response.status == 200

4. Resource Block Reference Guide

Schema Reference

Every resource block within a Deployment YAML is strictly typed and validated against the JSON schema:

Resource Block Item Types Description & Capabilities
templates File paths or inline Template objects Reusable proxy templates composed of features. Automatically instantiated with parameter substitutions and converted to deployable proxy bundles.
proxies File paths or inline Proxy objects Concrete API proxies with complete endpoints, targets, flows, policies, and resources.
features File paths or inline Feature objects Modular policy and flow definitions deployed directly as reusable proxy or SharedFlow assets.
products File paths or inline Product objects Apigee API Products. Supports flat operations, llmOperations for AI token quotas, and payloadOperations for MCP tool control. Bound to deployment proxies and environments automatically.
kvms Array of Kvm objects Key-Value Maps. Set type: environment (default) or type: proxy (with proxy: <proxy-name>) along with values: { KEY: "VAL" }. Exports to maps.json for the emulator.
users File paths, emails, or inline User objects Developer profiles with nested apps and pre-configured credentials (consumerKey, consumerSecret, status, products).
dataCollectors File paths or inline DataCollector objects Runtime analytics collectors (STRING, INTEGER, FLOAT, BOOLEAN) deployed to Apigee before proxies.
reports File paths or inline CustomReport objects Analytics reporting definitions specifying chart types (column, line), metrics (sum, avg), and dimensions.
tests Array of Test objects Integration test definitions specifying target proxy, path, HTTP method, headers, request body, and assertions (e.g. response.status == 200).
parameters Array of Parameter objects Deployment-wide parameters for variable substitution (e.g. $ENV, ${BACKEND}) across all child proxies, targets, products, and KVMs.

5. Cloud Operations: One-Command Deploy & Teardown

Apigee X & Hybrid

AFT orchestrates complete multi-resource deployments and safe teardowns directly against your Google Cloud project using standard Application Default Credentials. Use --project, --org, or --organization interchangeably:

Deploying to Apigee X / Hybrid

Deploy all resources to environment
Executes the multi-stage deployment pipeline in dependency order:
aft deployment.yaml --project my-gcp-project --environment dev
Deploy with Google Cloud Service Account attached
Attaches a runtime service account to all deployed proxy revisions:
aft deployment.yaml --project my-gcp-project --environment prod --sa apigee-runtime

Tearing Down Resources (--delete)

When tearing down a temporary testing or preview environment, passing --delete cleans up all assets in strict reverse dependency order to prevent orphaned resources or foreign key constraints:

  1. Developer Apps & Users: Deletes developer apps and credentials first, then deletes developer identities.
  2. API Products: Deletes API products and detaches environment/proxy associations.
  3. Proxies, Templates & Features: Undeploys all revisions from environments and deletes the proxy bundles.
  4. Custom Reports: Removes analytics custom reports.
  5. Data Collectors: Deletes data collector definitions last.
One-command teardown
aft deployment.yaml --delete --project my-gcp-project

6. Local Emulation with Apigee Emulator

Local Testing

AFT can compile an entire Deployment YAML into the exact artifacts required by the Apigee Emulator. This enables local development, zero-cloud-cost debugging, and offline CI/CD pipelines without connecting to a live GCP organization:

Export Deployment to Emulator directory (-f zip)
Compiles proxies into ZIP bundles and generates all emulator JSON metadata:
aft deployment.yaml -f zip -o ./emulator-dist/

This single command generates the full suite of Apigee Emulator configuration files:

  • {ProxyName}.zip: Deployable proxy bundles containing policies, endpoints, and resources.
  • products.json & apiproducts.json: Emulator-compliant API product catalog with quota limits and proxy associations.
  • developers.json & users.json: Developer identities mapped to the emulator runtime.
  • developerapps.json & apps.json: Developer apps populated with consumer API keys and secrets.
  • maps.json: Environment and proxy-scoped Key-Value Maps (KVMs).
  • datacollectors.json: Runtime data collector metadata.

Running with Apigee Emulator Service

The generated artifacts can be directly mounted into the Apigee Emulator Service ↗ container:

# 1. Export deployment to a local testdata directory
aft deployment.yaml -f zip -o ./emulator-dist/

# 2. Spin up the Apigee Emulator Service container with the exported artifacts mounted
docker run -d --name apigee-emulator   -p 8080:8080 -p 8443:8443 -p 8998:8998   -v $(pwd)/emulator-dist:/opt/apigee/testdata   ghcr.io/tyayers/apigee-emulator-service:latest

# 3. Test your endpoints locally using the pre-provisioned credentials
curl -H "x-api-key: client-api-key-998877" http://localhost:8080/v1/mock

Explore sample configurations, Docker Compose setups, and automated testing patterns in the Apigee Emulator Service repository ↗.

☁️ Apigee X Cloud Operations

AFT interacts directly with the Google Cloud Apigee management API using standard Application Default Credentials (ADC) or explicit tokens. Use --organization, --org, or --project interchangeably.

Remote Export from Apigee X

Apigee Cloud

Export deployed proxies, SharedFlows, API products, and developer user credentials from an Apigee X organization directly into clean, version-controllable YAML or JSON files.

Examples

Export single Proxy to YAML
Authenticates via gcloud default credentials, downloads the latest proxy revision, and writes a concise YAML file.
aft SimpleProxy-v1 --org my-org -o SimpleProxy-v1.yaml
Export ALL Proxies in an Organization to a Folder
Iterates through all proxies deployed in the organization and writes each one to an individual YAML file.
aft --org my-org -o ./proxies/
Export single API Product to YAML
Exports product quotas, scopes, approval rules, and proxy associations.
aft standard-product --org my-org -f product -o standard-product.yaml
Export ALL API Products in an Organization
Backs up every API product in the organization into separate YAML files inside ./products/.
aft --org my-org -f product -o ./products/
Export Developer User, Apps & Credentials
Exports developer profile, registered apps, API keys, and client secrets.
aft dev@example.com --org my-org -f user -o dev-user.yaml
Export ALL Developers and Apps in an Organization
Exports complete developer registry and credentials to individual YAML files.
aft --org my-org -f user -o ./users/
Export SharedFlow to YAML
Exports an Apigee SharedFlow revision and converts it into a feature YAML format.
aft my-shared-flow --org my-org -f sf -o sf-flow.yaml

Remote Deployment to Apigee X

Apigee Cloud

Deploy local proxies, API products, developer users, and complete multi-resource templates directly to your Apigee X / hybrid environments.

Examples

Deploy Proxy to Environment
Packages the YAML proxy into a bundle, imports it into Apigee X, and deploys a new revision to the 'dev' environment.
aft -i WeatherAPI.yaml --org my-org --environment dev
Deploy Proxy with Google Service Account
Attaches a Google Cloud Service Account to the deployed proxy revision for secure backend identity. Supports --sa or --service-account. If a short name is supplied instead of an email address, it automatically expands to '{sa-name}@{project-id}.iam.gserviceaccount.com'.
aft -i WeatherAPI.yaml --org my-org --environment prod --sa apigee-runtime
Deploy API Product
Creates or updates the API product definition in the Apigee organization.
aft -i standard-product.yaml --org my-org -f product
Deploy Developer User and Register Apps
Provisions the developer in Apigee, creates their registered apps, and configures API credentials.
aft -i dev-user.yaml --org my-org -f user
Deploy Complete Template (Proxy + Products + Users)
Orchestrates a full deployment in one command: deploys the proxy, provisions all associated products, and creates users with app keys.
aft -i FullTemplate.yaml --org my-org --environment dev
Deploy Full-Stack Deployment YAML (Proxies + Products + Users + KVMs + Telemetry)
Orchestrates deployment of all resources in a single command: data collectors, proxies/templates, API products, developers, apps with credentials, and custom analytics reports.
aft -i deployment.yaml --project my-gcp-project --environment dev

Resource Deletion (--delete)

Apigee Cloud

Tears down and deletes Apigee resources defined in local YAML files. Handles multi-resource templates and deployment YAMLs with automatic reverse dependency ordering (Users -> Products -> Proxies -> Reports -> Data Collectors).

Examples

Delete Proxy from Apigee
Undeploys all revisions and deletes the proxy from the Apigee organization.
aft -i WeatherAPI.yaml --org my-org --delete
Delete API Product
Deletes the API product from the Apigee organization.
aft -i standard-product.yaml --org my-org -f product --delete
Delete Developer User and Apps
Deletes developer apps, API credentials, and developer account.
aft -i dev-user.yaml --org my-org -f user --delete
Clean up Full Template Environment
Safely cleans up everything created by the template in the correct dependency order.
aft -i FullTemplate.yaml --org my-org --delete
Tear down Full-Stack Deployment YAML Environment
Safely cleans up all resources defined in the deployment YAML in reverse dependency order: users/apps -> products -> proxies/templates -> custom reports -> data collectors.
aft -i deployment.yaml --project my-gcp-project --delete

📖 Complete CLI Options Matrix

Complete reference of all command-line options, aliases, and argument expectations supported by AFT.

Flag Argument Description
--input, -i <path|name> Input path to a ZIP, JSON, or YAML file, or an Apigee resource name.
--output, -o <path> Optional file or directory output path (e.g. proxy.yaml, bundle.zip, ./proxies/).
--organization, --org, --project <name> Apigee organization or GCP project name to export from, deploy to, or describe (inspect org configuration). All 3 aliases are interchangeable.
--environment, --env <name> Apigee environment name to deploy the proxy revision to (e.g. dev, test, prod).
--service-account, --sa <name|email> Google Cloud service account email or name attached to proxy deployment. If not an email address, automatically formats as {sa-name}@{project-id}.iam.gserviceaccount.com.
--format, -f <format> Resource format: 'proxy', 'template', 'feature', 'product', 'user', 'deployment', or 'sharedflow' ('sf').
--applyFeature, -a <features> Feature name or comma-separated list of features to apply to a template or proxy.
--removeFeature, -r <features> Feature name or comma-separated list of features to remove from a template or proxy.
--parameters, -p <list> Parameter substitutions when instantiating a template (e.g. key1=val1,key2=val2).
--basePath, -b <path> Endpoint base path when scaffolding a new proxy or template (e.g. /v1/my-api).
--targetUrl, -u <url> Backend target URL when scaffolding a new proxy or template.
--name, -n <name> The name for the output template, feature, or proxy.
--list, -l -- List all templates and features available in the central repository (supports -f json/yaml).
--delete -- Delete Apigee resources defined in input template, product, user, deployment, or proxy.
--token, -t <token> Google Cloud OAuth2 token for Apigee API (uses Application Default Credentials if omitted).
--drz, -d <region> Use a DRZ Apigee endpoint ('us', 'eu', 'in') for data-residency compliance.
--help, -h -- Display CLI usage instructions and version information.
--version, -v -- Display current AFT version number.

🍳 Cookbook & Real-World Recipes

Step-by-step practical workflows for common architectural patterns.

Recipe 1: Building a Multi-Model AI Gateway Proxy

Cookbook

Create an enterprise AI gateway proxy routing to Google Cloud Vertex AI Model Garden with automatic token extraction and authentication.

1. Create an empty template proxy
Initializes a minimal template YAML with default proxy endpoints.
aft -n AI-Gateway -o AI-Gateway.yaml
2. Apply Google Cloud Model Garden target feature
Injects Google Cloud Model Garden targets and token header setup into the proxy.
aft AI-Gateway.yaml -a ai-target-googlecloud -o AI-Gateway.yaml
3. Apply API Key Verification and Rate Limiting
Secures the AI gateway with API key enforcement and per-model quota controls.
aft AI-Gateway.yaml -a auth-apikey-verify,ai-auth-quota -o AI-Gateway.yaml
4. Deploy to Apigee X Environment
Deploys the secured AI gateway proxy directly to the dev environment in Apigee X.
aft -i AI-Gateway.yaml --org my-apigee-org --environment dev

Recipe 2: Bulk Exporting Apigee X Org to Git for CI/CD

Cookbook

Export all proxies, products, and developer credentials from an existing Apigee organization into structured folders for GitOps version control.

1. Export all proxies to ./proxies/ directory
Converts every deployed proxy in the org into a clean YAML file.
aft --org production-org -o ./proxies/
2. Export all API products to ./products/ directory
Exports product definitions with quotas, environments, and allowed proxies.
aft --org production-org -f product -o ./products/
3. Export all developers & developer apps to ./users/ directory
Extracts developer user profiles and API credential configurations.
aft --org production-org -f user -o ./users/

Recipe 3: Packaging Reusable Feature into SharedFlow Bundle

Cookbook

Maintain security policies as clean YAML features locally, and compile them into Apigee SharedFlow ZIP bundles for deployment.

1. Inspect the security feature definition
Verifies the policies and pre-flow steps included in the feature.
aft describe auth-apikey-verify
2. Compile into an Apigee SharedFlow ZIP bundle
Builds a standard SharedFlow bundle ready for gcloud or apigeecli deployment.
aft -i auth-apikey-verify.yaml -f sf -o SF-ApiKeyVerify.zip

Recipe 4: Full-Stack Deployment with Proxies, KVMs, Products & Apigee Emulator

Cookbook

Author a unified deployment YAML combining an AI proxy, environment & proxy KVMs, an API product with LLM rate limiting, a test developer with credentials, and deploy or export to the Apigee Emulator.

1. Inspect unified deployment YAML (deployment.yaml)
Inspect all embedded and linked resources in the terminal overview card without modifying files.
aft describe deployment.yaml
2. Deploy everything to Apigee X in one command
Automatically deploys proxies, products, developers, apps, and credentials to GCP in coordinated order.
aft deployment.yaml --project my-gcp-project --environment dev
3. Export bundles & JSON configs for Apigee Emulator
Generates proxy ZIPs, maps.json, products.json, and developerapps.json for local testing with apigee-emulator-service.
aft deployment.yaml -f zip -o ./emulator-dist/
4. Cleanly tear down all resources when finished
Deletes apps, users, products, and proxies in reverse dependency order with zero orphaned references.
aft deployment.yaml --delete --project my-gcp-project