The Trace Learn CLI is an agent-friendly command line client over the Trace Learn API gateway. It uses the same public surface as the SDKs and MCP tools, so product operations stay behind the API instead of calling storage or billing providers directly.

Install

npm install -g @tx-agent-kit/cli
tx-agent-kit login
You can also run it without installing:
npx @tx-agent-kit/cli login
npx @tx-agent-kit/cli teams list-teams --organization-id <organizationId>
npx @tx-agent-kit/cli assets list-assets --team-id <teamId>
The package installs a single tx-agent-kit binary. It defaults to the production API.

Authentication

Create an API key in Trace Learn from Organization settings - API Keys. Use it as a bearer token:
TX_AGENT_KIT_TOKEN=<token> tx-agent-kit whoami
For interactive terminal use, you can also sign in with Device Authorization Flow:
tx-agent-kit login
tx-agent-kit whoami
tx-agent-kit logout
tx-agent-kit login starts Device Authorization Flow and stores a local auth profile at ~/.tx-agent-kit/auth.json with owner-only permissions. Later commands reuse that profile automatically.

Environments

The CLI defaults to the production API. Use TX_AGENT_KIT_API_URL or --api-url to target another environment.
TX_AGENT_KIT_API_URL=https://api-staging.tracelearn.app tx-agent-kit login

Common Commands

tx-agent-kit organizations list-organizations --fields response.data.id,response.data.name
tx-agent-kit teams list-teams --organization-id <organizationId> --fields response.data.id,response.data.name
tx-agent-kit teams get-team <teamId>

tx-agent-kit assets list-assets --team-id <teamId> --fields response.total,response.data
tx-agent-kit assets search-assets "diagnostic worksheet" --team-id <teamId>
tx-agent-kit assets request-upload --team-id <teamId> --dry-run

tx-agent-kit billing get-credit-balance --organization-id <organizationId>
tx-agent-kit trace-learn get-trace-learn-student-dashboard

Agent-Friendly Output

Use --json for a stable command envelope:
tx-agent-kit assets list-assets --team-id <teamId> --json
Use --fields to keep responses compact:
tx-agent-kit surfaces list --fields key,cliCommand,mcpTool,apiStatus
Use --request @payload.json for larger requests:
tx-agent-kit assets update-asset-metadata --dry-run --request @payload.json

Safety

Mutating commands and paid-read operations should be previewed with --dry-run first. Run the final command with --yes only after reviewing the plan or cost estimate.
tx-agent-kit billing create-top-up-session --organization-id <organizationId> --amount-dollars 10 --success-url https://staging.tracelearn.app/billing/success --cancel-url https://staging.tracelearn.app/billing --dry-run
tx-agent-kit billing create-top-up-session --organization-id <organizationId> --amount-dollars 10 --success-url https://staging.tracelearn.app/billing/success --cancel-url https://staging.tracelearn.app/billing --yes

Surface Discovery

The CLI can inspect the generated API-backed surface used by CLI and MCP:
tx-agent-kit surfaces list --fields key,cliCommand,mcpTool,apiMethod,apiPath
tx-agent-kit surfaces describe assets.list_assets
tx-agent-kit schema assets.list_assets

Agent Skills

Install bundled Codex or Claude Code skills:
tx-agent-kit skills list
tx-agent-kit skills install --target codex --dry-run
tx-agent-kit skills install --target claude