CLI ReferenceVersion v5.2.1Apigee X & HybridBun 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
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/).
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.
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.
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.
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 ↗.
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 ↗.
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:
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.
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:
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:
Developer Apps & Users: Deletes developer apps and credentials first, then deletes developer identities.
API Products: Deletes API products and detaches environment/proxy associations.
Proxies, Templates & Features: Undeploys all revisions from environments and deletes the proxy bundles.
Custom Reports: Removes analytics custom reports.
Data Collectors: Deletes data collector definitions last.
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.
# 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
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.
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'.
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.
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.
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.
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.