Skip to main content
Version: Next

amctl agent

Manage agents in a project — create, build, deploy, inspect, and observe. Runtime logs, metrics, and build logs are served by the observer, which the CLI discovers automatically from the agent-manager API — no separate endpoint to configure.

amctl agent [command]

Subcommands​

CommandPurpose
createCreate an agent
getShow details of an agent
listList agents in a project
deleteDelete an agent
deployDeploy a built agent image to an environment
build createTrigger a build
build getShow details of a build
build listList builds for an agent
build logsShow build logs (via the observer)
logsFetch runtime logs for a deployed agent (via the observer)
metricsShow CPU and memory metrics (via the observer)
tracesList runtime traces, with filters
traces exportExport filtered traces with full span data as JSON
traceShow span detail for a single trace

Options inherited from parent commands​

NameDescription
--projectProject that owns the agent. Falls back to the linked project.
--orgOverride the active organization.
--jsonOutput as JSON envelopes.
Runtime-managed agents only

logs, metrics, traces, trace, and traces export only work for platform-managed agents. Calling them against an external-runtime agent fails up-front with a clear error.


amctl agent create​

Create an agent in the active project.

amctl agent create <name> [flags]

Arguments​

NameDescription
<name>Agent name (URL-safe slug).

Examples​

# Chat API agent built from a public repo with buildpacks
amctl agent create support-bot \
--display-name "Support Bot" \
--subtype chat-api \
--repo-url https://github.com/acme/support-bot \
--repo-branch main \
--build-type buildpack \
--language python \
--language-version 3.12

# Custom-API agent with a Dockerfile build
amctl agent create checkout-api \
--display-name "Checkout API" \
--subtype custom-api \
--repo-url https://github.com/acme/checkout-api \
--build-type docker \
--dockerfile Dockerfile \
--port 8080 \
--openapi-spec openapi.yaml

# A2A agent: needs only the port its A2A server listens on, no OpenAPI spec
amctl agent create notes-agent \
--display-name "Notes Agent" \
--subtype a2a-agent \
--port 9099 \
--repo-url https://github.com/acme/notes-agent \
--build-type buildpack \
--language python \
--language-version 3.11 \
--run-command "python main.py"

# Plain environment + secret references
amctl agent create payments \
--display-name "Payments" \
--subtype custom-api \
--repo-url https://github.com/acme/payments \
--env LOG_LEVEL=info \
--env-secret STRIPE_KEY=sk_test_xxx \
--env-from-secret OPENAI_API_KEY=shared-openai

# Wire the agent to a registered LLM provider, with custom env var names
amctl agent create chatbot \
--display-name "Chatbot" \
--subtype chat-api \
--repo-url https://github.com/acme/chatbot \
--build-type buildpack \
--language python \
--language-version 3.12 \
--llm-provider prod-openai \
--llm-url-env OPENAI_BASE_URL \
--llm-api-key-env OPENAI_API_KEY

Options​

NameTypeDefaultDescription
--display-namestringrequiredHuman-readable name.
--descriptionstring(none)Free-text description.
--subtypestring(none)Agent sub-type: chat-api, custom-api, or a2a-agent. The A2A choice is fixed at creation: an agent cannot later change between a2a-agent and the other two.
--provisioningstringinternalinternal (platform-managed) or external.
--repo-urlstring(none)Source repository URL.
--repo-branchstring(none)Source branch.
--repo-pathstring(none)Application path within the repository.
--repo-secretstring(none)Secret reference for private repositories.
--build-typestring(none)buildpack or docker.
--languagestring(none)Language for buildpack builds.
--language-versionstring(none)Language version for buildpack builds.
--run-commandstring(none)Run command for buildpack builds.
--dockerfilestring(none)Dockerfile path (Docker builds).
--portint8000Service port (1 to 65535). Applies only to custom-api and a2a-agent; chat-api uses a fixed port.
--base-pathstring(none)Base path for the agent's HTTP service.
--openapi-specstring(none)Path to OpenAPI schema within the repo. Rejected for a2a-agent.
--no-auto-instrumentationboolfalseDisable automatic instrumentation.
--envstrings(none)Environment variable as KEY=VALUE. Repeatable. Stored as plain text.
--env-secretstrings(none)Sensitive env variable as KEY=VALUE. Repeatable.
--env-from-secretstrings(none)Env variable sourced from a managed secret: KEY=SECRETNAME. Repeatable.
--llm-providerstring(none)Handle of a configured LLM provider to attach (internal only).
--llm-url-envstring(none)Env var name for the provider URL (default: auto-generated).
--llm-api-key-envstring(none)Env var name for the provider API key (default: auto-generated).

Attaching an LLM provider​

--llm-provider binds a configured organization-level LLM provider to the agent at creation time. This is supported only for internal (platform-managed) provisioning.

Pass the handle of a provider you created with amctl llm-provider create — use amctl llm-provider list to see the handles in your org. The platform routes the agent's LLM calls through the AI Gateway and injects two environment variables into the running agent:

VariableHoldsDefault nameOverride with
urlGateway endpoint URL for the providerauto-generated from the template (e.g. OPENAI_URL)--llm-url-env
apikeyClient API key for the providerauto-generated from the template (e.g. OPENAI_API_KEY)--llm-api-key-env

--llm-url-env and --llm-api-key-env only take effect alongside --llm-provider; setting either without it is rejected. The provider credential is never exposed to agent code directly — only these injected variables are available at runtime.

The same binding can be expressed in a YAML manifest (amctl agent create -f) via the modelConfig block; run amctl agent create --template to print the scaffold. For the console-based workflow and the equivalent setup for external agents, see Configure LLM Providers for an Agent.


amctl agent get​

Show configuration and current build/deploy status for an agent.

amctl agent get [agent]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.
note

agent get returns the agent's configured state, not its runtime liveness. Use amctl agent logs, amctl agent metrics, or amctl agent traces to check that a deployed agent is actually serving.


amctl agent list​

List agents in the active project.

amctl agent list [flags]

Options​

NameTypeDefaultDescription
--limitint(server default)Maximum number of results.
--offsetint0Number of results to skip.

amctl agent delete​

Delete an agent. Asks for confirmation unless --yes is set. Deletes are asynchronous — the agent enters a terminating state immediately and is fully removed shortly after.

amctl agent delete [agent] [flags]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.

Options​

NameShortTypeDefaultDescription
--yes-yboolfalseSkip the confirmation prompt.

amctl agent deploy​

Deploy a built agent image to the lowest environment in the deployment pipeline.

Env vars passed via --env are merged with the agent's current configuration. Conflicting values require interactive confirmation or --yes. CLI-supplied values are always stored as plain text — use the platform UI or --env-from-secret at create-time for secrets.

amctl agent deploy [agent] [flags]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.

Examples​

# Deploy the latest build of the linked agent
amctl agent deploy

# Deploy a specific build by buildName
amctl agent deploy support-bot --build-name support-bot-build-3

# Merge two env vars, skip the conflict prompt
amctl agent deploy --env LOG_LEVEL=debug --env FEATURE_X=true --yes

Options​

NameShortTypeDefaultDescription
--build-namestringlatest by startedAtBuild to deploy. Builds are addressed by buildName, not buildId.
--envstrings(none)Set env var as KEY=VALUE. Repeatable. Merges with current config.
--yes-yboolfalseSkip the env-conflict confirmation prompt.

amctl agent build create​

Trigger a build for an agent.

amctl agent build create [agent] [flags]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.

Options​

NameTypeDefaultDescription
--commitstring(latest)Commit SHA to build from.

amctl agent build get​

Show details of a build.

amctl agent build get [agent] <build-name>

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.
<build-name>Build to display. Builds are addressed by buildName.

Example​

amctl agent build get support-bot support-bot-build-3

amctl agent build list​

List builds for an agent.

amctl agent build list [agent] [flags]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.

Options​

NameTypeDefaultDescription
--limitint(server default)Maximum number of results.
--offsetint0Number of results to skip.

amctl agent build logs​

Show logs for a build. Output is raw text, not JSON — --json is ignored.

amctl agent build logs [agent] [build-name]

Arguments​

NameDescription
[agent]Agent name. Optional if the directory is linked.
[build-name]Build name. Defaults to the latest build for the agent.

Example​

# Latest build of the linked agent
amctl agent build logs

# Specific build
amctl agent build logs support-bot support-bot-build-3

amctl agent logs​

Fetch runtime logs for a deployed agent.

amctl agent logs <agent> [flags]

Arguments​

NameDescription
<agent>Agent name. Optional if the directory is linked.

Examples​

# Last hour of ERROR-level logs
amctl agent logs support-bot --since 1h --level ERROR

# Search across the last day
amctl agent logs support-bot --grep "tool_call_failed"

# Latest 100 lines, JSON for downstream parsing
amctl agent logs support-bot --limit 100 --json | jq '.data.logs[]'

Options​

NameTypeDefaultDescription
--sincestring24hTime window. Examples: 30m, 1h, 7d.
--levelstrings(all)Filter by level: DEBUG, INFO, WARN, ERROR. Repeatable.
--grepstring(none)Substring filter applied server-side.
--limitint(server default)Maximum entries (1–10000).
--sortstringdescasc (oldest first) or desc (newest first).
--envstring(linked env)Environment to query.

amctl agent metrics​

Show CPU and memory usage against the agent's request and limit values, sampled over a time window. The default text output is a table; --json returns the raw timeseries arrays.

amctl agent metrics <agent> [flags]

Arguments​

NameDescription
<agent>Agent name. Optional if the directory is linked.

Example​

amctl agent metrics support-bot --since 1h

Output:

metric current request limit
CPU 120m 250m 500m
Memory 340Mi 512Mi 1.0Gi

Options​

NameTypeDefaultDescription
--sincestring24hTime window. Examples: 30m, 1h, 7d.
--envstring(linked env)Environment to query.

amctl agent traces​

List traces for an agent. Filters run on the server across the whole time window and combine, so a trace must match every filter set. The filters match the Console's, as described in Filter traces.

amctl agent traces <agent> [flags]

Arguments​

NameDescription
<agent>Agent name. Optional if the directory is linked, or when --from-url is a URL or path that names the agent.

Examples​

# Failed runs in the last day that called search_issues
amctl agent traces support-bot --since 1d --status error --tool search_issues

# Traces where any tool call failed, with the Tools column showing which one
amctl agent traces support-bot --tool-error

# Every trace in one conversation
amctl agent traces support-bot --conversation 7f3c9a2e --since 7d

# The list a teammate shared from the Console, then a link back to it
amctl agent traces --from-url 'https://console.example.com/org/acme/project/triage/agents/support-bot/environment/dev/observability/traces?status=error&timeRange=3h' --console-url

Output​

A table with the columns status, trace id, conversation, started, duration, tokens, and spans. Optional columns follow:

ColumnFlagDescription
model--show-modelsThe models each trace called.
tools--show-toolsThe tools each trace called. A failed tool is marked (failed).
mcp servers--show-mcp-serversThe MCP servers each trace used.

Filtering by --model, --tool, --tool-error, or --mcp-server also shows the matching column.

On a busy agent, the search can stop before it covers the whole time window. A notice then appears below the table. If more traces can be loaded, the notice shows the command that fetches the next page. Otherwise, it suggests narrowing the time range.

  • --console-url prints the Console path for the same list. Append it to your Console's host.
  • --from-url lists the traces shown at a Console URL, taking its scope, filters, and time range (1 hour if the URL has none). Flags such as --limit, --sort, and --since override the URL.

Options​

NameTypeDefaultDescription
--sincestring24hTime window, for example 30m, 1h, 7d.
--startstring(none)Window start, RFC 3339. Needs --end, and cannot be used with --since.
--endstring(none)Window end, RFC 3339. Needs --start.
--limitint10Maximum traces (1 to 100).
--sortstringdescasc or desc.
--statusstring(none)Only traces with this status: error or ok.
--min-durationduration(none)Only traces lasting at least this long, for example 500ms, 30s.
--min-tokensint(none)Only traces using at least this many tokens.
--min-spansint(none)Only traces with at least this many spans.
--modelstring(none)Only traces where a model name contains this value, ignoring case. Implies --show-models.
--conversationstring(none)Only traces with exactly this conversation ID.
--no-conversationboolfalseOnly traces with no conversation ID. Cannot be used with --conversation.
--toolstring(none)Only traces that called a tool whose name contains this value, ignoring case. Implies --show-tools.
--tool-errorboolfalseOnly traces with a failed tool call. With --tool, that tool failed. Implies --show-tools.
--mcp-serverstring(none)Only traces that used an MCP server whose name contains this value, ignoring case. Implies --show-mcp-servers.
--show-modelsboolfalseAdd the model column.
--show-toolsboolfalseAdd the tools column.
--show-mcp-serversboolfalseAdd the mcp servers column.
--conditionstring(none)Shorthand for one filter: error_status, high_latency, high_token_usage, tool_call_fails, excessive_steps.
--max-latencyint30000Latency threshold in milliseconds. high_latency matches traces above it.
--max-tokensint10000Token threshold. high_token_usage matches traces above it.
--max-spansint40Span-count threshold. excessive_steps matches traces above it.
--cursorstring(none)Fetch the next page of an earlier search. The next-page command in the notice sets it for you. With --json, take the value from the response's nextCursor field, and keep the same window, sort, and filters.
--console-urlboolfalsePrint the Console path for this list.
--from-urlstring(none)Take the scope, filters, and window from a Console URL, its path, or its ?... query.
--envstring(linked env)Environment to query.

amctl agent traces export​

Export the traces that match a set of filters, with their spans, as JSON. Suitable for offline analysis or attaching to an incident ticket.

Each trace includes up to 10,000 spans. If any trace has more, the file holds its first 10,000, and the response sets spansTruncated to true.

amctl agent traces export <agent> [flags]

Arguments​

NameDescription
<agent>Agent name. Optional if the directory is linked.

Example​

# Failed traces from the last hour that used the github MCP server
amctl agent traces export support-bot --since 1h --status error --mcp-server github > traces.json

Options​

export takes the same filter flags as amctl agent traces. It also takes:

NameTypeDefaultDescription
--sincestringrequiredTime window, for example 1h. Not required when --start and --end are set.
--startstring(none)Window start, RFC 3339. Needs --end, and cannot be used with --since.
--endstring(none)Window end, RFC 3339. Needs --start.
--limitint100Maximum traces to export (1 to 100).
--sortstringdescasc or desc.
--envstring(linked env)Environment to query.

amctl agent trace​

Show span details for a single trace. With --span, expand a specific span to full detail.

amctl agent trace <agent> <trace-id> [flags]

Arguments​

NameDescription
<agent>Agent name. Optional if the directory is linked, or when --from-url is a URL or path that names the agent.
<trace-id>Trace ID. Optional when the --from-url URL has a trace open.

Examples​

# Span summary
amctl agent trace support-bot 4bf92f3577b34da6a3ce929d0e0e4736

# Full detail for a specific span
amctl agent trace support-bot 4bf92f3577b34da6a3ce929d0e0e4736 --span a2b3c4d5e6f70812

# The trace open in a Console URL
amctl agent trace --from-url 'https://console.example.com/org/acme/project/triage/agents/support-bot/environment/dev/observability/traces?timeRange=1d&selectedTrace=4bf92f3577b34da6a3ce929d0e0e4736'

Options​

NameTypeDefaultDescription
--sincestring24hTime window to search.
--startstring(none)Window start, RFC 3339. Needs --end, and cannot be used with --since.
--endstring(none)Window end, RFC 3339. Needs --start.
--spanstring(none)Show full detail for the given span ID.
--limitint1000Maximum spans to return.
--console-urlboolfalsePrint the Console path that opens this trace.
--from-urlstring(none)Show the trace open in a Console URL (its selectedTrace), searched over the URL's time range, or 1 hour when it has none.
--envstring(linked env)Environment to query.

See Also​