CodeTorch.CLI
7.1.330
See the version list below for details.
dotnet tool install --global CodeTorch.CLI --version 7.1.330
dotnet new tool-manifest
dotnet tool install --local CodeTorch.CLI --version 7.1.330
#tool dotnet:?package=CodeTorch.CLI&version=7.1.330
nuke :add-package CodeTorch.CLI --version 7.1.330
CodeTorch CLI
Command-line tool for managing AI coding tasks in the CodeTorch portal.
Documentation
- Agent Guide - Comprehensive guide for AI agents using the CLI
- Troubleshooting - Known issues and solutions
- Specification - Design specification and API details
- Fleet delegation - Hand work to the CodeTorch fleet, wait on it, read results (
ctc skill printprints the agent skill)
Installation
dotnet tool install --global CodeTorch.CLI
For cloud coding environments, use the install script that matches the machine:
curl -fsSL https://raw.githubusercontent.com/PhilOchu/codetorch/main/tools/cli/scripts/install-ctc.sh | bash
The Linux installer installs the latest published CLI by default and adds ctc to the current session PATH plus common shell profiles. Pin a version only when you need a controlled rollback or rollout:
curl -fsSL https://raw.githubusercontent.com/PhilOchu/codetorch/main/tools/cli/scripts/install-ctc.sh | CODETORCH_CLI_VERSION=7.1.6 bash
irm https://raw.githubusercontent.com/PhilOchu/codetorch/main/tools/cli/scripts/install-ctc.ps1 | iex
Quick Start
# Configure environment and API key
ctc config env prod
ctc config set api-key <your-api-key>
ctc config set org <organization-id>
# Submit a task and monitor progress (exits at approval gates)
ctc run "Fix the login bug" --org <org-id> --repo <repo-id>
# Submit with automatic approval of all gates
ctc run "Fix the login bug" --org <org-id> --repo <repo-id> --auto-approve
# Or use individual commands
ctc task get "#123" --org <org-id> --stages
ctc task messages "#123" --org <org-id>
ctc task approve "#123" --org <org-id>
Cloud Tool Gateway
Cloud agents can use scoped tool grants without a full CodeTorch user API key.
export CODETORCH_API_URL=https://<portal-api>
export CODETORCH_TOOL_TOKEN=ctg_xxx
ctc tool db targets
ctc tool db schema dev-catalog
ctc tool db query dev-catalog --sql "select top 10 * from dbo.Users"
ctc tool log targets
ctc tool log query app-dev --search "error"
ctc tool devslot targets
Create grants from an authenticated operator session:
ctc tool grant create claude-dev --org <org-id> --expires-days 7 --db dev-catalog=<environment-id>:<database-id>:ro
ctc tool grant create claude-preview --org <org-id> --devslot api=<workspace-id>:api:"Tenant API Slot"
ctc tool grant list --org <org-id>
ctc tool grant revoke <grant-id> --org <org-id>
Commands
Configuration
| Command | Description |
|---|---|
ctc config show |
Show current configuration |
ctc config set <key> <value> |
Set a configuration value |
ctc config env <name> |
Switch environment (prod, local) |
Resources
| Command | Description |
|---|---|
ctc orgs |
List organizations |
ctc workspaces --org <id> |
List workspaces |
ctc repos --org <id> --workspace <id> |
List repositories |
ctc tasks --org <id> |
List tasks |
ctc tasks --org <id> --json |
List tasks as JSON |
ctc workflows |
List available workflows |
ctc workflow <slug-or-id> |
Show workflow details with stage definitions |
ctc workflow <slug-or-id> --json |
Workflow and stage codes as JSON (the codes --stage-prompt and task reroute --to accept) |
ctc execution-policy list [--org <id>] [--env <name>] [--json] |
List effective policy IDs, keys, scopes, and current versions |
ctc execution-policy show <key> [--org <id>] [--env <name>] [--json] |
Show the policy resolved by the Portal for the organization and its saved routes in priority order |
ctc workflow policy-switch <slug-or-id> --to <key> [--keep <key>]... --reason "<text>" [--revert-after <utc>] [--expected-version <id>] [--json] |
Publish a workflow version that moves stage and default execution policy keys to <key>, leaving --keep keys (and the workflow's own keep-keys) alone. A standing agent needs authority 2+ and a workflow that opted in with standingPolicySwitch config. Exits 1 on a 409 (stale --expected-version, or a switch already in place). |
ctc workflow policy-revert <slug-or-id> [--reason "<text>"] [--expected-version <id>] [--json] |
Restore the keys the switch recorded. If a person changed a stage since, prints those stages, changes nothing and exits 1. Nothing recorded is a no-op. |
The Portal applies organization overrides to both policy reads. In JSON, list
returns policies and show returns policy and routes. Routes show configured
harnesses, model offerings, reasoning effort, and allowed credential types.
Use ctc task usage for recorded provider attempts.
Provider usage
| Command | Description |
|---|---|
ctc usage [--json] |
Per coding provider: outcome, active/until, max utilization %, soonest reset, credits, usable; then Fleet: N machines online, B of T slots busy, I idle. --json prints the full view (windows included). Output is tab-separated when redirected or with --plain. |
Automation Inventory
| Command | Description |
|---|---|
ctc automation list --org <id> |
List repository automation instances across accessible workspaces and repositories |
ctc automation list --org <id> --workspace <id> --source blueprint |
List blueprint-managed instances in one workspace |
ctc automation show <automation-id> --workspace <id> --repo <id> |
Show full automation, provenance, triggers, and recent runs |
ctc automation export <automation-id> --workspace <id> --repo <id> --output <path> |
Export the composite automation snapshot with byte count and SHA-256 readback |
ctc automation run <automation-id> --workspace <id> --repo <id> |
Run the automation now (conditions are always evaluated) and print the run |
Inventory commands other than run are read-only. All of them return structured JSON. show and
export include 20 recent runs by default; pass --runs 0 to omit run history.
Export refuses to overwrite a file unless --force is supplied.
Task Operations
| Command | Description |
|---|---|
ctc run "<desc>" --org <id> --repo <id> |
Create task and watch progress (exits on approval gates) |
ctc run "<desc>" --org <id> --repo <id> --skip-stages "Stage1,Stage2" |
Create task and pre-skip named stages |
ctc task create "<desc>" --org <id> --repo <id> |
Create a new task |
ctc task create "<desc>" --org <id> --repo <id> --machine <name\|id> |
Create a task that runs only on that agent machine |
ctc task create "<desc>" --org <id> --repo <id> --goal <goal-id> |
Create a task linked to a goal |
ctc task create "<desc>" --org <id> --repo <id> --workflow question --coding-provider <provider-id> --model <model-id> |
Create a task pinned to a workflow, provider, and model |
ctc task create "<desc>" --org <id> --repo <id> --not-before 2026-02-20T18:00:00Z |
Create a queued task that cannot dispatch before the given time |
ctc task create "<desc>" --org <id> --repo <id> --json |
Create a task and output JSON |
ctc task create "<desc>" --org <id> --repo <id> --skip-stages "Stage1,Stage2" |
Create task and pre-skip named stages |
ctc task create "<desc>" --depends-on <id>,#<n> |
Create a task that waits until the listed tasks succeed |
ctc task create "<desc>" --idempotency-key <key> --json |
Repeat-safe create: the same key and request returns the same task (idempotentReplay: true); a different request with the key is refused (409) |
ctc task create "<desc>" --workflow <slug> --stage-prompt <stageCode>=<text> [--stage-prompt-mode append\|replace] |
Steer one stage for this task only: appended to (default) or replacing the workflow stage's prompt; repeat --stage-prompt per stage |
ctc task get <id> --stages |
Get task details with stage status |
ctc task get <id> --json [--stages] |
Task (and stages) as returned by the API, including runRevision |
ctc task result <id> [--json] |
The task's result for its current run revision: status, outcome, verdict, summary, final answer and its source stage, branch publish state, PR, artifacts and state keys |
ctc task usage <id> [--org <org-id>] [--env <name>] [--json] |
Show all recorded provider attempts for a task GUID or quoted #number, including failures |
ctc task pr <id> [--title <t>] [--body <b>] |
Open the pull request for the task's pushed branch |
ctc task stages <id> |
Show task stages with status and skip eligibility |
ctc task stages <id> --json |
Task stages as returned by the API |
ctc task skip-stage <id> "<stage-name>" |
Skip a pending stage |
ctc task skip-stage <id> "<stage-name>" --unskip |
Unskip a previously skipped stage |
ctc task messages <id> |
View messages for current stage; streamed text deltas are merged into one row per block (--limit counts blocks, --max-content <n> sets the per-row length, default 400) |
ctc task messages <id> --raw |
One row per raw message, unmerged |
ctc task messages <id> --json |
One JSON entry per raw message (never merged) |
ctc task artifacts <id> <stage> --list |
List stage artifacts and their IDs. With --json, use artifacts[].id. |
ctc task artifacts <id> <stage> <type> |
Get the latest artifact of that type. |
ctc task artifacts <id> --stage-id <stage-id> --artifact-id <artifact-id> [--json\|--raw] |
Get the exact artifact from the list. A stage name can also be used in place of --stage-id. |
ctc task approve <id> |
Approve stage awaiting approval (use --allow-skipped-stages to acknowledge failed/cancelled guarded stages at Human Review) |
ctc task request-changes <id> -f "<feedback>" |
Request changes to a stage (feedback required) |
ctc task reroute <id> -i "<instructions>" [--to <stage>] [--pr <number-or-url>] |
Send a task to any stage of its workflow (forward or back, created if needed) with instructions; without --to the judge picks. An approval wait is superseded, not approved. --list-targets shows the stages; --idempotency-key <key> makes a repeat return the first reroute instead of applying it again. |
ctc task switch-workflow <id> --version <n\|latest> [--to <stage>] [-i "<instructions>"] [--dry-run] [--force] [--json] |
Move a live task to another version of its workflow, forward or back (for example to pick up a prompt fix). Only a version with the same enabled stages (sort order, stage type, stage code) is accepted; prompt and setting differences are listed. --dry-run only checks compatibility (exit 1 when the switch would be refused). Refused while a stage is running or waiting for approval unless --force. --to then reroutes to that stage with the instructions. See docs/task-workflow-version-switch.md. |
ctc task pause <id> |
Pause a task |
ctc task resume <id> |
Resume a paused task |
ctc task cancel <id> |
Cancel a task (auto-proceeds in non-interactive shells) |
ctc task cancel <id> --reason "Superseded by #2477" |
Cancel a task with an audit reason |
ctc task cancel <id> --comment "Duplicate request" |
Cancel a task with an audit comment |
ctc task archive <id> |
Archive a task (auto-proceeds in non-interactive shells) |
ctc task archive <id> --reason "Delivered" |
Complete/archive a task with an audit reason |
ctc task archive <id> --comment "Verified in prod" |
Complete/archive a task with an audit comment |
ctc task retry <id> |
Retry a failed task (auto-proceeds in non-interactive shells) |
ctc task usage reads the task's Portal API usage receipts in the order returned
by the API. The recorded model identifier may come from runtime statistics or
fall back to the configured profile model. The recorded account column shows the
attempt's reported account ID and available name. A name joined by recorded ID
is the current display name. A name-only row shows the supplied label.
Credential attribution is unverified. Reasoning effort is unreported.
With --json, the top-level fields are taskId (GUID) and attempts (array,
empty when there are no receipts). Each attempt contains attemptNumber (integer),
stageId and taskStageExecutionId (GUIDs or null), stageTypeName, providerType, profileName,
and modelIdentifier (strings or null), and status (succeeded, rate-limited,
crashed, or failed, in precedence order). The API can report an unreported
provider type as Unknown. The stage type is the backend classification and
may differ from the workflow's display name. Use stageId to match a stage.
Each attempt also includes codingProviderId (the recorded account GUID or null)
and providerAccountDisplayName (the display label or null). Null means
unreported, including when an older API omits either field.
If artifact commands return 404, check the API host. An inherited
CODETORCH_API_URL can point to the Agent API. For an operator read, set
CODETORCH_PORTAL_API_URL=https://portalapi.codetorch.com in the current
process and rerun ctc task artifacts <task-id> --org <org-id> --stage-id <stage-id> --list --json.
Use an ID from that list to verify exact retrieval with --artifact-id.
Goal Operations
| Command | Description |
|---|---|
ctc goal list --org <id> |
List goals |
ctc goal create --org <id> --workspace <id> --repo <id> --title "..." --description "..." |
Create a goal |
ctc goal show <goal-id> --org <id> |
Show goal details |
ctc goal start <goal-id> --org <id> |
Start a goal |
ctc goal pause <goal-id> --org <id> --reason "..." |
Pause a goal |
ctc goal resume <goal-id> --org <id> |
Resume a goal |
ctc goal archive <goal-id> --org <id> |
Archive a goal |
ctc goal settings <goal-id> --batch-size 3 |
Update goal settings |
ctc goal issues <goal-id> --org <id> |
List goal issues |
ctc goal rubric list <goal-id> --org <id> |
List rubric items |
ctc goal rubric add <goal-id> --criterion "..." --weight 30 --org <id> |
Add a rubric item |
ctc goal rubric update <goal-id> <rubric-id> --weight 20 |
Update a rubric item |
ctc goal rubric remove <goal-id> <rubric-id> --org <id> |
Remove a rubric item |
Flows
Scripts whose task() calls are fleet tasks, run and journaled locally. Guide: docs/flows.md.
| Command | Description |
|---|---|
ctc flow run <script.js> [--args <json\|@file>] [--repo <id>] [--workflow-default <slug>] [--json] |
Run a flow until it ends; prints the run id, progress, then the output JSON |
ctc flow run <script.js> --from-run <runId> [--redo-failed] [--start-at <cmd>] [--redo <cmds>] |
Restart from a step, reusing the earlier run's finished results |
ctc flow resume <runId> |
Continue an interrupted run (finished steps replay, nothing is re-created) |
ctc flow status <runId> [--json] |
Phases, and each task's number, status and PR |
ctc flow logs <runId> [--json \| --follow] [--remote] |
Read a run's progress as a snapshot, or follow its plaintext log until it ends |
ctc flow stop <runId> [--cancel-tasks] |
Stop a run; optionally cancel its running tasks and open asks |
ctc flow list |
Local runs, newest first |
Other
| Command | Description |
|---|---|
ctc stats --org <id> |
Show task statistics |
ctc me |
Show current user info |
ctc preview "<desc>" --org <id> |
Preview task classification |
ctc skill print [--name codetorch-delegate] [--format markdown\|json] |
Print a skill shipped with ctc (the codetorch-delegate delegation guide), for agents that do not load Claude Code skills |
Tool Gateway
| Command | Description |
|---|---|
ctc tool grant create |
Create a scoped tool grant for cloud agents |
ctc tool grant list |
List scoped tool grants |
ctc tool grant show <id> |
Show a scoped tool grant |
ctc tool grant revoke <id> |
Revoke a scoped tool grant |
ctc tool capabilities |
Show what a tool token can do |
ctc tool db targets |
List database targets available to a tool token |
ctc tool db schema <target> |
Show database schema for a target |
ctc tool db query <target> --sql "<sql>" |
Run a database query through a tool token |
ctc tool log targets |
List log targets available to a tool token |
ctc tool log query <target> |
Query logs through a tool token |
ctc tool devslot targets |
List dev slot apps available to a tool token |
ctc tool devslot claim --workspace <id> --app <app> |
Claim a dev slot lease |
ctc tool image publish --app <app> --context <path> |
Build and push a scratch image |
ctc tool devslot deploy-image --app <app> --image <image> |
Deploy an image to a claimed dev slot |
ctc tool devslot urls |
Show URLs for the current lease |
ctc tool devslot cleanup |
Release the current lease |
Tool gateway read commands support agent-friendly output:
ctc tool db targets --json
ctc tool log targets --plain
ctc tool capabilities --json
ctc tool devslot targets --json
ctc tool db query dev-catalog --sql "select top 5 name from sys.tables" --json
When stdout is redirected, tool gateway commands automatically use plain text instead of terminal table rendering.
Exit Codes (ctc run)
| Code | Meaning |
|---|---|
0 |
Task completed successfully |
1 |
Task failed or was cancelled |
2 |
Task is awaiting approval (use ctc task approve to continue) |
Configuration
Configuration is stored in ~/.codetorch/config.json.
Environment Variables (override config file):
CODETORCH_API_KEY- API keyCODETORCH_API_URL- API URLCODETORCH_ENV- Environment nameCODETORCH_TOOL_TOKEN- Scoped tool grant token forctc tool dbandctc tool logCODETORCH_CLI_VERSION- Optional CLI version used by install scripts
Note: Environment variables take precedence over config file. See Troubleshooting for common issues.
Confirmation Behavior
Destructive commands (approve, request-changes, cancel, archive, retry) are agent-first: invoking the command is treated as intent.
| Context | Behavior |
|---|---|
| Non-interactive shell (no TTY) | Proceeds automatically, logs the action |
| Interactive shell (TTY) | Prompts with default Yes |
--yes / -y flag |
Proceeds without prompting (backward-compatible no-op in non-interactive shells) |
--confirm global flag |
Always prompts; blocks in non-interactive shells (opt-in strict mode) |
Use --confirm when you want the old require-explicit-yes behavior regardless of environment.
Task ID Formats
Both formats work:
#123- Task number (easier to use)5835baea-c48a-4101-9974-0b414a89967a- Full GUID
Requirements
- .NET 10.0 Runtime or later
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.369 | 0 | 11/23/2026 |
| 7.1.365 | 67 | 11/22/2026 |
| 7.1.358 | 76 | 11/20/2026 |
| 7.1.333 | 312 | 11/16/2026 |
| 7.1.331 | 99 | 11/16/2026 |
| 7.1.330 | 106 | 11/16/2026 |
| 7.1.329 | 94 | 11/16/2026 |
| 7.1.328 | 88 | 11/16/2026 |
| 7.1.327 | 89 | 11/16/2026 |
| 7.1.326 | 91 | 11/16/2026 |
| 7.1.325 | 86 | 11/16/2026 |
| 7.1.324 | 95 | 11/16/2026 |
| 7.1.323 | 83 | 11/16/2026 |
| 7.1.322 | 86 | 11/16/2026 |
| 7.1.321 | 86 | 11/16/2026 |
| 7.1.320 | 90 | 11/16/2026 |
| 7.1.319 | 86 | 11/16/2026 |
| 7.1.318 | 83 | 11/16/2026 |
| 7.1.317 | 88 | 11/16/2026 |
| 7.1.316 | 83 | 11/16/2026 |