aasm context
Manage named API contexts (connection profiles) stored in
~/.aa/config.yaml. A context bundles an API URL and optional API key under a
name so you can switch between gateways with --context <name>.
See Config and context resolution for how the active context is resolved.
Synopsis
aasm context <SUBCOMMAND> [OPTIONS]
| Subcommand | Purpose |
|---|---|
list | List all configured contexts. |
set | Create or update a named context. |
use | Switch the default context. |
aasm context list
List all configured contexts with their API URLs. Takes no arguments.
aasm context list
production * https://api.example.com (key set)
staging https://staging.example.com
One line per context — no header row. A * marker follows the default
context’s name, and (key set) follows the URL when an API key is stored for
that context. When no contexts are configured, aasm context list prints
No contexts configured. Use \aasm context set` to add one.` instead.
aasm context set
Create or update a named context.
| Name | Type | Default | Description |
|---|---|---|---|
<NAME> | string (arg) | — | Name of the context to create or update. |
--api-url <API_URL> | string | required | API URL for this context. |
--api-key <API_KEY> | string | — | API key for this context (optional). Prefer the AASM_API_KEY environment variable — see the note below. |
AASM_API_KEYenv var. When--api-keyis omitted,aasm context setreads the key from theAASM_API_KEYenvironment variable (an empty value is treated as unset). Passing--api-keyon the command line prints a warning and is discouraged, because argv is world-readable viaps,/proc/<pid>/cmdline, and shell history, which leaks the operator bearer token. The global--api-keyflag honors the sameAASM_API_KEYenv var.
AASM_API_KEY=staging-key aasm context set staging --api-url https://staging.example.com
Context 'staging' saved.
aasm context use
Switch the default context (the one used when --context is not passed).
| Argument | Type | Description |
|---|---|---|
<NAME> | string | Name of the context to set as default. |
aasm context use production
Switched to context 'production'.
Last updated: 2026-07-19 by Chisanan232