Skip to main content

A2A Command Reference

This page documents every A2A-related iac-code command. Use it when you need exact option names, common command patterns, and the operational meaning of each flag.

Command Overview​

CommandPurpose
iac-code a2aRun iac-code as an A2A server
iac-code a2a-client callDiscover a remote Agent Card and send a prompt
iac-code a2a-client discoverFetch and optionally verify an Agent Card
iac-code a2a-client task-getFetch one task by ID
iac-code a2a-client task-listList tasks with filters and pagination
iac-code a2a-client task-cancelCancel an active task
iac-code a2a-client task-subscribeSubscribe to an active task event stream
iac-code a2a-client push-config-createCreate a task push notification config
iac-code a2a-client push-config-getFetch one task push notification config
iac-code a2a-client push-config-listList task push notification configs
iac-code a2a-client push-config-deleteDelete a task push notification config
iac-code a2a-client extended-cardFetch the authenticated extended Agent Card
iac-code a2a-client route-previewPreview local route selection for a2a-client call

All HTTP client commands accept the same authentication options:

OptionDescription
--tokenBearer token sent as Authorization: Bearer <token>
--basic-usernameBasic auth username
--basic-passwordBasic auth password
--api-keyAPI key value
--api-key-headerAPI key header name; defaults to X-API-Key

A2A Client Config​

All a2a-client subcommands accept a YAML config file at the group level:

iac-code a2a-client --config a2a-client.yml call --prompt "Create a VPC"

CLI options override config values. Use config for stable connection, auth, verification, routing, and repeated task or push settings; keep one-off prompt text on the command line.

url: http://127.0.0.1:41242/
token: your-bearer-token
basic-username: iac-code
basic-password: your-password
api-key: your-api-key
api-key-header: X-IAC-Code-Key
verify-card-secret: your-card-signing-secret
verify-card-jwks-url: https://a2a.example.com/.well-known/jwks.json
require-card-signature: true
timeout: 30
cwd: /path/to/workspace
context-id: ctx-123
iac-code-model: qwen-plus
iac-code-api-key: provider-api-key
task-id: task-123
config-id: webhook-1
callback-url: https://hooks.example.com/a2a
notification-token: notification-token
auth-scheme: bearer
auth-credentials: callback-token
routes:
- name: ros
url: http://127.0.0.1:41242/
skills:
- iac_generation
tags:
- ros
- template

iac-code a2a​

Run iac-code as an A2A server.

iac-code a2a

By default, the server binds to 127.0.0.1:41242 and serves JSON-RPC over HTTP. Port 41242 is the iac-code default; it is not a registered A2A port.

Basic Server Options​

OptionDefaultDescription
--configemptyYAML config file containing A2A server options
--host127.0.0.1HTTP server host
--port41242HTTP server port
--transporthttpServer transport: http, stdio, unix, websocket, grpc, grpc-jsonrpc, or redis-streams
--thinking-exposuretool-traceExpose an A2A thinking signal type; repeat for multiple. Values: raw-thinking, tool-trace
--debug, -dfalseEnable debug logging
--log-to-stdout / --no-log-to-stdoutfalseMirror server logs to stdout. Not supported with --transport stdio because stdout carries A2A protocol frames

Example:

iac-code a2a --host 127.0.0.1 --port 41242 --debug

YAML Configuration​

Use --config for authentication, storage, signing, transport-specific settings, push delivery, and other deployment details. Keys may use dashes or underscores. The common CLI flags --host, --port, and --transport override config-file values.

host: 127.0.0.1
port: 41242
transport: http
token: local-dev-token
persistence-dir: .iac-code-a2a/state
artifact-dir: .iac-code-a2a/artifacts
push-notifications: true
log-to-stdout: true

Run it with:

iac-code a2a --config a2a-server.yml --port 41243

HTTP Authentication​

Authentication is optional. Configure server authentication in YAML or with environment variables. If no auth setting is configured, requests are unauthenticated. When one or more schemes are configured, a request may satisfy any configured scheme.

Config keyEnvironment VariableDescription
tokenIACCODE_A2A_HTTP_TOKENBearer token
basic-usernameIACCODE_A2A_BASIC_USERNAMEBasic auth username
basic-passwordIACCODE_A2A_BASIC_PASSWORDBasic auth password
api-keyIACCODE_A2A_API_KEYAPI key value
api-key-headerIACCODE_A2A_API_KEY_HEADERAPI key header name

Bearer token:

token: local-dev-token

Basic auth:

basic-username: iac-code
basic-password: local-dev-password

API key:

api-key: local-dev-key
api-key-header: X-IAC-Code-Key

Persistence and Artifacts​

Config keyDefaultDescription
persistence-dir~/.iac-code/a2aLocal JSON metadata for tasks, contexts, routes, and push configs
artifact-dir<persistence-dir>/artifactsLocal artifact payload store

Persistence mirrors task and context snapshots for restoration metadata. It does not restart an in-flight asyncio task after a process crash.

persistence-dir: ~/.iac-code/a2a
artifact-dir: ~/.iac-code/a2a/artifacts

Agent Card Signing​

Config keyDescription
signing-secretHMAC secret used to sign the public Agent Card

The server emits A2A SDK AgentCardSignature JWS fields. The symmetric mode uses HS256.

signing-secret: local-card-signing-secret

Push Notification Delivery​

Config keyDefaultDescription
push-notificationsfalseEnable A2A task push notification config methods and terminal-state delivery
push-queuelocal-filePush queue backend: local-file or redis-streams
push-redis-urlemptyRedis URL for the Redis-backed push queue
push-streamiac-code:a2a:pushRedis stream for push jobs
push-retry-keyiac-code:a2a:push:retryRedis sorted set for delayed retries
push-dead-streamiac-code:a2a:push:deadRedis stream for dead-letter jobs
push-consumer-groupiac-code-pushRedis consumer group for push workers
push-consumer-nameemptyRedis consumer name for this worker
push-lease-timeout-ms300000Redis pending lease timeout

Local file queue:

push-notifications: true
persistence-dir: ~/.iac-code/a2a
push-queue: local-file

Redis Streams queue:

push-notifications: true
push-queue: redis-streams
push-redis-url: redis://localhost:6379/0
push-stream: iac-code:a2a:push
push-retry-key: iac-code:a2a:push:retry
push-dead-stream: iac-code:a2a:push:dead
push-consumer-group: iac-code-push
push-consumer-name: worker-1

Redis-backed push delivery requires the a2a-redis extra.

Transport Options​

TransportCommandNotes
HTTP JSON-RPC and RESTiac-code a2a --transport httpDefault. Advertises JSONRPC and HTTP+JSON interfaces.
stdioiac-code a2a --transport stdioExperimental custom JSON-RPC frames over standard input/output.
Unix socketiac-code a2a --config a2a-server.yml --transport unixRequires socket-path in config.
WebSocketiac-code a2a --config a2a-server.yml --transport websocketUses ws-path from config, defaulting to /a2a.
gRPCiac-code a2a --config a2a-server.yml --transport grpcUses grpc-host and grpc-port from config.
gRPC JSON-RPCiac-code a2a --config a2a-server.yml --transport grpc-jsonrpcCustom JSON-RPC envelope over gRPC.
Redis Streamsiac-code a2a --config a2a-server.yml --transport redis-streamsRequires redis-url in config.

Redis Streams transport options:

Config keyDefaultDescription
redis-urlemptyRedis connection URL; required for --transport redis-streams
request-streamiac-code:a2a:requestsRequest stream name
response-streamiac-code:a2a:responsesResponse stream name
consumer-groupiac-codeRequest stream consumer group

Thinking Exposure​

Config keyDefaultDescription
thinking-exposuretool-traceNon-answer runtime signal types exposed through A2A metadata.iac_code. Use a YAML list, a comma-separated string, or repeated --thinking-exposure flags. Supported values are tool-trace and raw-thinking.

tool-trace preserves the existing tool progress, permission, and result metadata. raw-thinking emits provider reasoning chunks as metadata.iac_code.thinking updates with type: raw_thinking and text. iac-code does not currently produce separate thought-summary or progress-summary events, so those are not valid exposure types.

thinking-exposure:
- tool-trace
- raw-thinking

Permission Behavior​

Config keyDefaultDescription
auto-approve-permissionsfalseAutomatically approve tool permission requests raised during A2A turns

Without auto-approve-permissions: true, a tool permission request pauses the turn and returns a structured input-required response so the caller can send allow_once or deny. With automatic approval enabled, permission decisions are written to the local permission audit log; any allow decision that requires an audit record fails closed if that record cannot be persisted. Protected Alibaba Cloud write APIs are not blanket-approved by ordinary allow rules; configure exact aliyun_api(product:action) allow rules for trusted automation. See Protocol Reference for the response and resume contract.

iac-code a2a-client call​

Discover an Agent Card, choose the advertised endpoint, and send a prompt.

iac-code a2a-client --config a2a-client.yml call \
--prompt "Create a ROS VPC template with two vSwitches." \
--cwd "$PWD" \
--iac-code-model qwen-plus \
--iac-code-api-key "$IAC_CODE_API_KEY"
OptionDefaultDescription
--urlemptyA2A agent base URL or JSON-RPC endpoint URL; may come from config
--routerepeatableRoute spec used when --url is omitted
--route-nameemptyNamed route to select
--prompt, -prequiredPrompt text
--cwd.Workspace path sent as message.metadata.iac_code.cwd
--context-idemptyExisting A2A context ID for a follow-up message
--iac-code-modelemptyLLM model sent as message.metadata.iac_code.iac_code_model; overrides server model config for this message turn only
--iac-code-api-keyemptyLLM provider API key sent as message.metadata.iac_code.iac_code_api_key; overrides IAC_CODE_API_KEY and .credentials.yml for this message turn only
--thinking-enabled, --no-thinking-enabledemptyBoolean thinking policy sent as message.metadata.iac_code.thinking.enabled; omitted preserves the server/provider default
--thinking-effortemptyThinking effort sent as message.metadata.iac_code.thinking.effort for this message turn only
--thinking-budgetemptyPositive integer thinking budget sent as message.metadata.iac_code.thinking.budget for this message turn only
--verify-card-secret, --signing-secretemptyHMAC secret for Agent Card verification
--verify-card-jwks-urlemptyRemote JWKS URL used for Agent Card verification
--require-card-signature, --require-signaturefalseReject unsigned or invalid Agent Cards
--timeout30.0Call timeout in seconds
--streamfalseUse SendStreamingMessage and print stream events

--iac-code-api-key is the key used by the remote iac-code runtime to call its LLM provider. It is separate from --api-key, which authenticates the A2A HTTP request itself.

Thinking options are per-message request metadata. They can also be supplied in the A2A client YAML as thinking-enabled, thinking-effort, and thinking-budget; command-line flags override config values. If all three are omitted, the client sends no thinking metadata and the remote runtime keeps its configured provider defaults. For openai_compatible endpoints backed by DashScope compatible-mode, an explicit thinking policy uses DashScope's native wire parameters so --no-thinking-enabled can send extra_body.enable_thinking=false. Emitting raw thinking back to the A2A client still requires the server to enable thinking-exposure: raw-thinking.

thinking-enabled: false
thinking-effort: low
thinking-budget: 2048

Follow-up in the same context:

iac-code a2a-client --config a2a-client.yml call \
--context-id ctx-123 \
--prompt "Now add outputs for the VPC and vSwitch IDs." \
--cwd "$PWD"

Streaming:

iac-code a2a-client --config a2a-client.yml call \
--prompt "Review this Terraform module." \
--cwd "$PWD" \
--stream

Require a signed Agent Card:

iac-code a2a-client --config a2a-client.yml call \
--prompt "Generate a production VPC template." \
--cwd "$PWD"

Verify using a remote JWKS URL:

iac-code a2a-client --config jwks-client.yml call \
--prompt "Review the ROS stack."

iac-code a2a-client discover​

Fetch and print a remote Agent Card.

iac-code a2a-client --config a2a-client.yml discover
OptionDescription
--urlA2A agent base URL; may come from config
--verify-card-secret, --signing-secretHMAC secret for verification
--verify-card-jwks-urlRemote JWKS URL for verification
--require-card-signature, --require-signatureRequire a valid signature

Authenticated discovery:

iac-code a2a-client --config a2a-client.yml discover

Task Commands​

Task commands call JSON-RPC task methods directly. They are useful for operational tools, dashboards, and debugging.

iac-code a2a-client task-get​

iac-code a2a-client --config a2a-client.yml task-get \
--task-id task-123 \
--history-length 20
OptionDescription
--urlA2A JSON-RPC endpoint URL; may come from config
--task-idTask ID; may come from config
--history-lengthMaximum task history entries to return

iac-code a2a-client task-list​

iac-code a2a-client --config a2a-client.yml task-list \
--context-id ctx-123 \
--status TASK_STATE_INPUT_REQUIRED \
--page-size 20 \
--output table
OptionDefaultDescription
--urlemptyA2A JSON-RPC endpoint URL; may come from config
--context-idemptyFilter by context ID
--statusemptyFilter by task state
--page-sizeemptyMaximum tasks to return
--page-tokenemptyPagination token
--include-artifactsfalseInclude task artifacts in the response
--outputtabletable or json

JSON output:

iac-code a2a-client --config a2a-client.yml task-list \
--include-artifacts \
--output json

iac-code a2a-client task-cancel​

iac-code a2a-client --config a2a-client.yml task-cancel \
--task-id task-123

Cancellation is cooperative. A completed, failed, canceled, or input-required task returns the standard A2A task-not-cancelable error.

iac-code a2a-client task-subscribe​

iac-code a2a-client --config a2a-client.yml task-subscribe \
--task-id task-123

The command streams events for active tasks. For a new turn, prefer a2a-client call --stream; it starts the task and streams updates in one command.

Push Notification Config Commands​

These commands require a server started with push-notifications: true. They manage standard A2A task push notification configs.

iac-code a2a-client push-config-create​

iac-code a2a-client --config a2a-client.yml push-config-create \
--task-id task-123 \
--config-id webhook-1 \
--callback-url https://hooks.example.com/a2a \
--notification-token "$NOTIFICATION_TOKEN" \
--auth-scheme bearer \
--auth-credentials "$WEBHOOK_BEARER_TOKEN"
OptionDescription
--urlA2A JSON-RPC endpoint URL; may come from config
--task-idTask ID; may come from config
--config-idPush config ID; may come from config
--callback-urlHTTP(S) callback URL; may come from config
--notification-tokenToken sent as X-A2A-Notification-Token
--auth-schemeCallback auth scheme, such as bearer or basic
--auth-credentialsCallback auth credentials

Callback URLs are validated before storage and dispatch. The default validator rejects non-HTTP(S) URLs, localhost names, and literal private/local IP addresses.

iac-code a2a-client push-config-get​

iac-code a2a-client --config a2a-client.yml push-config-get \
--task-id task-123 \
--config-id webhook-1

iac-code a2a-client push-config-list​

iac-code a2a-client --config a2a-client.yml push-config-list \
--task-id task-123 \
--page-size 10

iac-code a2a-client push-config-delete​

iac-code a2a-client --config a2a-client.yml push-config-delete \
--task-id task-123 \
--config-id webhook-1

iac-code a2a-client extended-card​

Fetch the authenticated extended Agent Card.

iac-code a2a-client --config a2a-client.yml extended-card \
--token "$A2A_TOKEN"

The public Agent Card advertises capabilities.extendedAgentCard=true. The extended card adds authenticated runtime details, including task management and push configuration capability metadata.

iac-code a2a-client route-preview​

Preview how a2a-client call resolves configured routes when --url is omitted.

iac-code a2a-client route-preview \
--route "template=http://127.0.0.1:41242/;skills=iac_generation;tags=ros,template" \
--skill iac_generation \
--prompt "Create a ROS VPC template"
OptionDescription
--routeRepeatable route spec in name=url;skills=a,b;tags=x,y format
--nameRoute name to resolve
--skillSkill ID to resolve
--promptPrompt text used for name/tag matching
--route-state-dir, --persistence-dirDirectory used to persist route snapshots
--save-routesSave provided routes to the route state directory

Save route snapshots:

iac-code a2a-client route-preview \
--route "ros=http://127.0.0.1:41242/;skills=iac_generation;tags=ros" \
--route-state-dir ~/.iac-code/a2a \
--save-routes

Call through routes:

iac-code a2a-client call \
--route "ros=http://127.0.0.1:41242/;skills=iac_generation;tags=ros" \
--route-name ros \
--prompt "Create a ROS VPC template." \
--cwd "$PWD"

Environment Variables​

VariableDescription
IACCODE_A2A_HTTP_TOKENServer/client Bearer token default
IACCODE_A2A_BASIC_USERNAMEServer/client Basic auth username default
IACCODE_A2A_BASIC_PASSWORDServer/client Basic auth password default
IACCODE_A2A_API_KEYServer/client API key default
IACCODE_A2A_API_KEY_HEADERAPI key header name default
IACCODE_A2A_ALLOWED_CWDSOS-path-separated list of allowed workspace roots for incoming message metadata and file URLs
IACCODE_A2A_TEXT_MIME_TYPESExtra comma- or semicolon-separated text-like MIME types
IACCODE_A2A_MULTIMODAL_MIME_TYPESExtra comma- or semicolon-separated multimodal MIME types
IAC_CODE_A2A_PUSH_KEYRINGEnvironment-managed encrypted push secret keyring
IAC_CODE_A2A_RESOURCE_SELECTOR_ENABLEDEnables A2A resource-selector advertisement and registration with 1, true, yes, or on (case-insensitive); unset, empty, and all other values are disabled (default)