- Project Name: a7 (repository: api7/a7)
- Purpose: A command-line tool that wraps the API7 Enterprise Edition Admin API, providing a convenient terminal interface for managing API7 EE resources including both control-plane and data-plane operations.
- Target Users: DevOps engineers, API developers, platform teams, and SREs responsible for managing API7 Enterprise gateways.
- Design Philosophy: AI-first development. Modeled after the a6 CLI (for Apache APISIX), extended for Enterprise-specific capabilities (gateway groups, RBAC, service templates, developer portal, etc.).
- Reference Implementation: a6 CLI — all features in a6 should have equivalents in a7, adapted for API7 EE's dual-API architecture.
- API7 Enterprise Edition has a comprehensive REST API but lacks an imperative CLI for ad-hoc operations.
- The existing ADC tool (api7/adc) provides declarative sync/diff/dump but is TypeScript-based and does not support imperative CRUD operations.
- The a6 CLI only targets open-source Apache APISIX Admin API, not the API7 EE control-plane API.
- Users are forced to use
curl, the Dashboard UI, or ADC for all interactions—there is no quick imperative CLI for terminal workflows.
- Provide full CRUD operations for all API7 EE resources (both control-plane
/api/*and APISIX admin/apisix/admin/*endpoints). Note: 3 APISIX resources (standalone upstream, consumer group, plugin config) are not exposed in API7 EE. - Support multiple authentication modes: access tokens (X-API-KEY with
a7eeprefix) and session-based login. - Implement gateway group scoping for all runtime operations (enterprise-specific concept).
- Implement context/profile management for switching between multiple API7 EE instances.
- Support rich terminal output (tables for TTY, JSON/YAML for pipes).
- Support file-based resource creation and update (
-f/--file) for all resource types. - Support resource export to YAML/JSON with label filtering for all applicable resources.
- Provide declarative configuration operations (sync, dump, diff, validate) absorbing ADC-like functionality.
- Provide debug commands for real-time log streaming and request tracing.
- Provide shell completions (bash, zsh, fish, PowerShell).
- Provide AI agent skills (SKILL.md files) for AI coding agents to work effectively with API7 EE.
- Provide comprehensive documentation: ADRs, coding standards, golden example, testing strategy, user guides.
- Provide end-to-end tests with Docker-based API7 EE test environment.
- Maintain an extensible command architecture following a6 patterns (Factory + IOStreams + API Client).
- Not replacing the API7 Dashboard (Web UI).
- Not managing gateway instance lifecycle (start/stop/restart).
- Not building a GUI.
- Not supporting APISIX open-source directly (use a6 for that).
- Not supporting API7 EE versions prior to v3.x.
- Supported Version: API7 Enterprise 3.x (v3.5+)
- API Prefixes:
- Control-plane:
/api/*(service templates, gateway groups, users, tokens, RBAC, portal, etc.) - APISIX admin:
/apisix/admin/*(published services, routes, upstreams, consumers, SSL, etc.)
- Control-plane:
- Response Format:
- Single resource:
{"value":{...}}or raw object - List:
{"total":N,"list":[...]} - PATCH uses JSON Patch (RFC 6902)
- Single resource:
- Flag:
--token/--api-key - Environment Variable:
A7_TOKEN - Profile/Context config: stored in
~/.config/a7/config.yaml
- Access Token (prefix
a7ee): Full control-plane + APISIX admin API access, user-scoped. - Session Login:
a7 auth login --username <user> --password <pass>for cookie-based session auth.
- Prevent sensitive data from appearing in shell history by supporting key input from files or stdin.
Noun-verb pattern (consistent with a6):
a7 <resource> <action> [args] [flags]
--context/-c: Override active context/profile.--server/-s: Override target server URL.--token: Override API token (X-API-KEY).--gateway-group/-g: Specify gateway group (required for runtime operations).--output/-o: Output format:table(default in TTY),json,yaml.--format: Go template for custom output.--verbose/-v: Enable verbose HTTP request logging.--force: Skip confirmation prompts.-f/--file: Read resource from JSON/YAML file.--tls-skip-verify: Skip TLS certificate verification.--ca-cert: Path to CA certificate file.
- list:
--page,--page-size,--search,--label,--gateway-group - create/update:
-f/--file(JSON/YAML),--dry-run - delete:
--forceto skip confirmation - export:
--label,--gateway-group,--output(yaml/json)
a7 service-template list|get|create|update|patch|deletea7 service-template publish --gateway-group <id>(publish to gateway group)
a7 gateway-group list|get|create|update|delete
a7 token list|get|create|delete|regenerate
a7 user list|get|create|update|deletea7 role list|get|create|update|deletea7 permission-policy list|get|create|update|delete
a7 portal application list|get|create|update|deletea7 portal developer list|get|create|delete
a7 custom-plugin list|get|create|update|delete
a7 system settings [get|update]a7 audit-log list
All runtime commands require --gateway-group <id> (or default from context).
a7 route list|get|create|update|delete|export --gateway-group <id>
a7 service list|get|create|update|delete|export --gateway-group <id>
⚠️ NOT SUPPORTED: Standalone upstreams are not exposed via the API7 EE Admin API. Upstreams exist only as inline objects within services and routes. Thea7 upstreamcommands exist for APISIX compatibility but will not work against API7 EE.
a7 consumer list|get|create|update|delete|export --gateway-group <id>
a7 credential list|get|create|update|delete --consumer <username> --gateway-group <id>
⚠️ NOT SUPPORTED: Consumer groups are not exposed via the API7 EE Admin API. Thea7 consumer-groupcommands exist for APISIX compatibility but will not work against API7 EE.
a7 ssl list|get|create|update|delete|export --gateway-group <id>
a7 plugin list|get --gateway-group <id>(read-only: list available plugins, get schema)
a7 global-rule list|get|create|update|delete|export --gateway-group <id>
a7 stream-route list|get|create|update|delete|export --gateway-group <id>
⚠️ NOT SUPPORTED: Plugin configs are not exposed via the API7 EE Admin API. Thea7 plugin-configcommands exist for APISIX compatibility but will not work against API7 EE.
a7 plugin-metadata get|create|update|delete --gateway-group <id>(no list — keyed by plugin name)
a7 secret list|get|create|update|delete --gateway-group <id>
a7 proto list|get|create|update|delete|export --gateway-group <id>
a7 context create|use|list|delete|current— Manage contexts for multiple API7 EE instances.a7 auth login|logout— Session-based authentication.a7 config sync|dump|diff|validate— Declarative configuration operations.a7 debug logs— Stream real-time API7 EE error logs.a7 debug trace— Trace request flow through the gateway.a7 completion bash|zsh|fish|powershell— Shell completion scripts.a7 version— Display version information.a7 update— Self-update binary.
- ✅ Project structure, Makefile, CI workflow, GoReleaser config.
- ✅ Factory DI pattern (IOStreams, HttpClient, Config).
- ✅ Config/context management (create, use, list, delete, current).
- ✅ Authentication: token-based auth (X-API-KEY header).
- ✅ API client with auth transport.
- ✅ HTTP mock framework for unit tests.
- ✅ JSON/YAML/table output modes.
- ✅ Shell completions (bash, zsh, fish, powershell).
- ✅
a7 version.
- ✅ Gateway Group CRUD (list, get, create, update, delete).
- ✅ Service Template CRUD + publish.
- ✅ Route CRUD.
- ✅ Upstream CRUD.
⚠️ Not functional in API7 EE (standalone upstreams not exposed). - ✅ Service (runtime) CRUD.
- ✅ Consumer CRUD.
- ✅ SSL CRUD.
- ✅ Plugin list + get.
- ✅ Global Rule CRUD.
- ✅ Stream Route CRUD.
- ✅ Plugin Config CRUD.
⚠️ Not functional in API7 EE (plugin_config not exposed). - ✅ Plugin Metadata CRUD (no list).
- ✅ Consumer Group CRUD.
⚠️ Not functional in API7 EE (consumer_group not exposed). - ✅ Credential CRUD (nested under consumer).
- ✅ Secret CRUD.
- ✅ Proto CRUD.
- ✅ Unit tests for all new commands (56 test files).
- ✅
-f/--fileflag: file-based create/update for all resource commands. - ✅
exportsubcommand for all applicable resources (route, service, upstream, consumer, consumer-group, ssl, global-rule, stream-route, plugin-config, proto). - ✅
--forceflag for delete commands (skip confirmation). - ✅
--labelflag for list/export commands (label-based filtering). - 🔲
--dry-runflag for create/update commands. - 🔲
--verboseflag for HTTP request/response logging.
- ✅
a7 config dump— Export full gateway configuration to YAML file. - ✅
a7 config validate— Validate a configuration file against API7 EE schema. - ✅
a7 config diff— Compare local config file against live gateway state. - ✅
a7 config sync— Apply a configuration file to the gateway (with--dry-runsupport). - ✅
configutilpackage — Shared helpers for config file parsing, resource ordering, and diff logic.
- ✅
docs/adr/001-tech-stack.md— Architecture Decision Record. - ✅
docs/coding-standards.md— Go coding standards and conventions. - ✅
docs/golden-example.md— Canonical implementation example (Factory, IOStreams, tests). - ✅
docs/testing-strategy.md— Unit test and E2E test patterns. - ✅
docs/skills.md— AI agent skill format specification. - ✅
docs/documentation-maintenance.md— Doc update rules and templates. - ✅
docs/roadmap.md— Per-PR development plan for Phases 5-9. - ✅
docs/api7ee-api-spec.md— API7 EE Admin API reference (16 resources, dual-API). - ✅
docs/user-guide/— 21 per-resource user guides (getting-started, configuration, route, service, upstream, consumer, ssl, plugin, global-rule, stream-route, plugin-config, plugin-metadata, consumer-group, credential, secret, proto, declarative-config, gateway-group, service-template, debug, bulk-operations).
Port and adapt 40 SKILL.md files from a6, organized by category:
| Category | Count | Skills |
|---|---|---|
| Shared | 1 | Core a7 conventions and patterns |
| Authentication | 5 | key-auth, jwt-auth, basic-auth, hmac-auth, openid-connect |
| Security & Rate Limiting | 4 | ip-restriction, cors, limit-count, limit-req |
| Traffic & Transformation | 5 | proxy-rewrite, response-rewrite, traffic-split, redirect, grpc-transcode |
| AI Gateway | 4 | ai-proxy, ai-prompt-template, ai-prompt-decorator, ai-content-moderation |
| Observability | 6 | prometheus, skywalking, zipkin, http-logger, kafka-logger, datadog |
| Advanced Plugins | 5 | serverless, ext-plugin, fault-injection, consumer-restriction, wolf-rbac |
| Operational Recipes | 5 | blue-green, canary, circuit-breaker, health-check, mTLS |
| Advanced Recipes | 3 | multi-tenant, api-versioning, graphql-proxy |
| Personas | 2 | operator, developer |
- ✅
a7 debug logs— Stream real-time error logs from API7 EE. - ✅
a7 debug trace— Trace a request through the gateway with timing breakdown. - ✅
a7 update— Self-update CLI binary from GitHub releases.
- ✅
test/e2e/docker-compose.yml— Docker Compose for API7 EE (Dashboard + DP Manager + Gateway + PostgreSQL). - ✅
test/e2e/setup_test.go— TestMain, binary build, admin/control API helpers, shared test utilities. - ✅ Per-resource E2E tests (22 test files): route, service, upstream, consumer, ssl, plugin, global-rule, stream-route, plugin-config, plugin-metadata, consumer-group, credential, secret, proto, context, gateway-group, service-template.
- ✅ Declarative config E2E tests: dump, diff, sync, validate (config_test.go + config_sync_test.go).
- ✅ Export and label E2E tests (integrated into resource test files).
- ✅ Debug E2E tests: trace (JSON/method/headers/host/path) + logs (file mode).
- ✅ Completion + version + help E2E tests.
- ✅
.github/workflows/e2e.yml— CI workflow for automated E2E testing. - ✅ Makefile targets:
docker-up,docker-down,test-e2e. - ✅ All 40 skill examples covered in resource-specific tests.
- 🔲 Token management (create/list/delete/regenerate).
- 🔲 RBAC management: user, role, permission-policy.
- 🔲 Developer Portal: application, developer, subscription.
- 🔲 Custom plugin management.
- 🔲 Audit log querying.
- 🔲
a7 auth login/logout— Session-based authentication. - 🔲 Interactive mode (fuzzy selection).
- 🔲 Extension/plugin system.
- 🔲 Bulk operations.
- TTY Detection: Default to tables in interactive terminals and JSON when piped.
- Colors: ANSI colors when supported. Respect
NO_COLORenvironment variable. - Confirmation Prompts: Destructive operations require confirmation unless
--force. - Error Messages: HTTP status + API7 error message + suggestion.
- Progress Feedback: Spinners for long operations.
- Consistent Sorting: Resources listed by ID ascending by default.
- Gateway Group Awareness: Commands that require a gateway group should error clearly if none specified.
- Location:
~/.config/a7/config.yaml. RespectXDG_CONFIG_HOME. - Format:
current-context: local contexts: - name: local server: https://localhost:7443 token: a7ee.xxxxxxxxxx gateway-group: default tls-skip-verify: true - name: production server: https://api7.example.com token: a7ee.yyyyyyyyyy gateway-group: production ca-cert: /path/to/ca.pem
- Language: Go 1.22+
- CLI Framework: spf13/cobra
- HTTP Client: net/http with custom auth transport
- Output: Custom tableprinter (tabwriter-based) + JSON/YAML exporters
- Testing: Unit tests with httpmock, E2E tests with real API7 EE instance
- Release: GoReleaser for cross-platform builds
- License: Apache 2.0
The following table tracks feature parity between a7 and a6:
| Feature | a6 | a7 | Notes |
|---|---|---|---|
| Resource CRUD (14 types) | ✅ | ✅ (13 functional in API7 EE) | a7 adds gateway-group, service-template; 3 APISIX resources (upstream, consumer-group, plugin-config) not exposed in API7 EE |
| Context management | ✅ | ✅ | |
| Shell completions | ✅ | ✅ | |
| JSON/YAML/table output | ✅ | ✅ | |
-f/--file create/update |
✅ | ✅ | Phase 3 |
export subcommand |
✅ | ✅ | Phase 3 |
--force delete flag |
✅ | ✅ | Phase 3 |
--label filtering |
✅ | ✅ | Phase 3 |
--verbose HTTP logging |
✅ | 🔲 | Phase 3 |
| Declarative config (dump/diff/sync/validate) | ✅ | ✅ | Phase 4 |
| docs/ (29 files) | ✅ | ✅ | Phase 5 |
| skills/ (40 SKILL.md) | ✅ | ✅ | Phase 6 |
| Debug (logs + trace) | ✅ | ✅ | Phase 7 |
| Self-update | ✅ | ✅ | Phase 7 |
| E2E tests | ✅ | ✅ | Phase 8 |
| Bulk operations | ✅ | 🔲 | Phase 9 |
| Interactive mode | ✅ | 🔲 | Phase 9 |
| Extension system | ✅ | 🔲 | Phase 9 |