a2a-wrapper logoa2a-wrapper
Guides

Configuration

How a2a-wrapper configuration works. The JSON config file, the layering order of defaults, file, environment variables and CLI flags, environment-variable substitution, and the blocks every wrapper shares.

Every wrapper is configured with a single JSON file, passed with --config. The same shape is shared across wrappers, with one backend-specific block (copilot, claude, codex, opencode or antigravity).

Layering

Settings resolve in this order, with later layers overriding earlier ones:

built-in defaults  ←  config file  ←  environment variables  ←  CLI flags

So a flag such as --port 4000 beats PORT=3000, which beats "port": 3010 in the file.

Secrets and substitution

Never put credentials in config.json. Reference environment variables instead:

  • ${VAR} works anywhere inside a string, including in the middle of one.
  • Bare $VAR works in some fields, for example MCP args.
  • If a variable is not set, the token is left as-is so a misconfiguration stays visible rather than silently sending an empty value.
{ "headers": { "Authorization": "Bearer ${LINEAR_API_KEY}" } }

Shared blocks

BlockPurposeKey fields
agentCardWhat the agent advertises. See agent cardsname, description, version, skills, streaming
serverNetworkingport, hostname, advertiseHost, advertiseProtocol
sessionMulti-turn behaviour. See sessionsreuseByContext, ttl, cleanupInterval
featuresBehaviour flagsstreamArtifactChunks, and per-wrapper event flags
eventsSideband events. See observabilityenabled, transport, httpUrl, httpHeaders
timeoutsLimitsprompt (milliseconds)
loggingLogslevel: debug, info, warn, error
mcpTool servers. See MCP toolsone entry per server
memoryInstructions and skills. See memory and skillsinstructions, skills
subAgentsDelegation. See sub-agentsagents, options

Backend blocks

WrapperBlockNotable fields
a2a-copilotcopilotmodel, systemPrompt, systemPromptMode, provider (BYOK)
a2a-claudeclaudeworkingDirectory, model, permissionMode, thinking, settingSources
a2a-codexcodexworkingDirectory, model, sandboxMode, approvalPolicy, networkAccessEnabled
a2a-opencodeopencodebaseUrl, projectDirectory, model, agent, systemPromptMode
a2a-antigravityantigravitypythonPath, auth mode, policies

Full field tables are in each package reference.

Common environment variables and flags

SettingFlagEnvironment
Config file--config <path>CONFIG_FILE (used by the server.sh scripts)
Port--portPORT
Bind address--hostnameHOSTNAME
Advertised host--advertise-hostADVERTISE_HOST
Workspace--workspaceWORKSPACE_DIR
Model--modelbackend-specific, for example COPILOT_MODEL, CLAUDE_MODEL, CODEX_MODEL
Streamed artifacts--stream-artifacts / --no-stream-artifactsSTREAM_ARTIFACTS
Log level--log-levelLOG_LEVEL

Exact flags differ slightly between wrappers. Run <wrapper> --help or see the package reference.

Start from an example

Each wrapper ships example agents under agents/. Copy one and edit it:

cp -r agents/example agents/my-agent
./agents/my-agent/start.sh start

The start.sh scripts support start, stop, restart, status, logs and foreground.

On this page