AutoCom CLI
autocom is a single static binary that brings the platform to your terminal. It speaks GraphQL to the same /api/v1/graphql endpoint your web app uses, authenticates with the same identities, and respects the same RBAC permissions. There is no separate authority — everything is server-enforced.
Why a CLI
Three reasons it exists:
- Scriptability —
autocom orders list -o json | jqslots into existing pipelines without you wrappingcurland parsing JSON yourself. - Speed — Sub-50ms startup, one round-trip per command (GraphQL fetches exactly what you ask for; REST is the fallback for multipart and admin endpoints).
- Portability — Cross-compiled to macOS / Linux / Windows on amd64 + arm64. No Python, no Node, no PHP runtime needed on the user's machine.
Modeled after gh (GitHub's CLI) — same auth pattern, same Cobra command tree, same persisted-query optimization for hot commands.
Quick start
# 1. Install (see Installation for other methods)
brew install autocommerce/tap/autocom
# 2. Authenticate — opens your browser to the platform approval page
autocom auth login --tenant acme
# 3. Verify
autocom whoami
autocom health
# 4. Use it
autocom orders list --status pending --limit 20
autocom orders get ORD-20260503-0001
autocom api query '{ _schema { ring modules { alias version } } }'
What's in this section
| Page | What you'll find |
|---|---|
| Installation | Homebrew, direct downloads, building from source |
| Authentication | OAuth browser flow, paste-back fallback, PATs, multi-environment |
| Configuration | ~/.autocom/config.toml, env vars, per-environment credentials |
| Commands | Full reference for every subcommand and flag |
| Output Formats | Table, JSON, YAML, TTY vs pipe behavior |
| Security Model | What's protected by what, build hardening, threat model |
| Troubleshooting | Common errors, exit codes, diagnostic commands |
At a glance
- Transport: GraphQL primary (
POST /api/v1/graphql), REST fallback for multipart and a few admin endpoints - Auth: OAuth 2.0 authorization-code with PKCE (browser flow) — falls back to OOB paste-code for SSH; PATs for CI
- Storage: Tokens in OS keychain (
go-keyring); config at~/.autocom/config.toml - Tenancy: Every request sends
X-Tenant: <slug>resolved from--tenantflag → config → stored credential - Exit codes: Stable across versions — see Troubleshooting
- Source: Lives at
cli/in the autocommerce monorepo, mirrors toautocommerce/core/cli
Related
- GraphQL Gateway — the schema this CLI consumes
- RBAC Overview — the permissions the CLI inherits
- Module API Bus — what every CLI command resolves through under the hood