CodeTorch.CLI 7.1.241

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global CodeTorch.CLI --version 7.1.241
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CodeTorch.CLI --version 7.1.241
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CodeTorch.CLI&version=7.1.241
                    
nuke :add-package CodeTorch.CLI --version 7.1.241
                    

CodeTorch CLI

Command-line tool for managing AI coding tasks in the CodeTorch portal.

Documentation

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

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

Inventory commands are read-only and 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> --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 get <id> --stages Get task details with stage status
ctc task stages <id> Show task stages with status and skip eligibility
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
ctc task artifacts <id> <stage> --list List stage artifacts
ctc task artifacts <id> <stage> <type> Get artifact content
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.
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)

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

Other

Command Description
ctc stats --org <id> Show task statistics
ctc me Show current user info
ctc preview "<desc>" --org <id> Preview task classification

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 key
  • CODETORCH_API_URL - API URL
  • CODETORCH_ENV - Environment name
  • CODETORCH_TOOL_TOKEN - Scoped tool grant token for ctc tool db and ctc tool log
  • CODETORCH_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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
7.1.259 83 10/14/2026
7.1.258 78 10/14/2026
7.1.257 86 10/13/2026
7.1.256 76 10/13/2026
7.1.255 80 10/13/2026
7.1.254 73 10/13/2026
7.1.253 88 10/13/2026
7.1.252 89 10/12/2026
7.1.251 89 10/12/2026
7.1.250 80 10/12/2026
7.1.249 83 10/12/2026
7.1.248 83 10/12/2026
7.1.247 80 10/12/2026
7.1.246 81 10/12/2026
7.1.245 95 10/12/2026
7.1.244 80 10/12/2026
7.1.243 83 10/12/2026
7.1.242 79 10/12/2026
7.1.241 83 10/12/2026
7.1.240 95 10/11/2026
Loading failed