Run tasks with the CLI
Run one-shot and interactive tasks with the Test Companion CLI, and use slash commands, keyboard shortcuts, and approvals in the interactive session.
You can give tc a task in two ways. Both ways use the same agent. In both, you describe what you want in plain language, the same way you would ask a colleague.
| Mode | Command | Behavior |
|---|---|---|
| Interactive session | tc |
Opens a chat session in your terminal. This is the default. The agent asks questions and requests approval before sensitive actions. |
| One-shot task | tc "create test cases for the login flow" |
Runs one task and exits. The agent still pauses for input when it needs it, unless you run it headless with --yolo. tc run "<task>" is the same command in its explicit form. |
Global flags
A flag is an option you add after a command to change how it runs, such as --yolo. The following flags work on a one-shot prompt and on most subcommands. To see the flags of a single command, run tc <command> --help.
| Flag | Effect |
|---|---|
--yolo |
Approves every question and permission without pausing. Required for unattended runs. |
--auto-approve |
Sets which file permissions the run grants without asking. Run tc run --help for its options. |
--json |
Prints a machine-readable JSON event stream instead of the rendered interface. Runs headless. |
-v, --verbose
|
Prints verbose output for debugging a run. |
-c <dir>, --config <dir>
|
Uses the given directory for configuration instead of ~/.testcompanion. |
--check-update |
Checks for a newer release now instead of using the cached update check. |
Run headless in CI
This section applies when a continuous integration (CI) pipeline, such as GitHub Actions or Jenkins, runs tc for you. For an unattended run with machine-readable output, combine --yolo and --json:
tc "create and run a smoke test for the checkout page" --yolo --json
In CI, branch on the exit code to tell a passing run from a failing test or a blocked run.
Drive tc from another AI coding agent
If you use Claude Code or Cursor, you can let that agent run tc for you. Run the following command in your terminal:
tc agent-skill
The command installs the tc skill into Claude Code at ~/.claude/skills/tc/SKILL.md. The skill teaches Claude Code how to run tc headlessly, including the tc run --json output format.
To print the skill file instead of installing it, add --print with the target: --print claude-code, --print cursor, or --print generic. Use the Cursor output to create a Cursor rules file.
Interactive session
In your terminal, run tc with no arguments to start a session. Type a request, such as create test cases for the login flow, and press Enter. The agent responds, and the conversation continues turn by turn. To leave the session, type /exit.
Slash commands
Type / to open the command menu, then keep typing to filter it. The session includes the following built-in commands:
| Command | Description |
|---|---|
/help |
Show the list of commands. |
/clear |
Clear the screen and start a fresh conversation. |
/retry |
Run the last request again. |
/usage |
Show session usage: context, credits, and tokens. |
/tm |
Open the Test Management panel. |
/tra |
Browse failing builds in Test Reporting & Analytics and fix them. |
/cases |
Review generated test cases and save them to a folder. |
/app [id\|path] [android\|ios] |
Test a mobile app. Pick an app to explore and generate test cases, or automate it. |
/settings |
View and change settings. |
/skills |
List loaded skills and their paths. |
/resume |
Resume a past session. |
/feedback |
Rate the session and leave a comment. |
/mcp |
Manage MCP servers: status, sign-in, and tool approvals. Available only when MCP is enabled for your account. |
/exit |
Quit the session. |
The agent also accepts three prompt commands. Type /newtask to carry the current context into a fresh task. Type /smol to condense the conversation and free up context. Type /newrule to save a rule from the current conversation.
Keyboard shortcuts
| Key | Action |
|---|---|
Enter |
Send the message. |
Ctrl+J or Alt+Enter
|
Insert a new line. |
Tab |
Complete a slash command or an @ mention. |
Up arrow and Down arrow
|
Move through your message history or through suggestions. |
@ |
Mention a file to add it as context. |
Esc |
Cancel the current action. Press again to clear the input. |
Ctrl+C |
Press twice to exit the session. |
Approvals
Before the agent takes a sensitive action, the turn pauses and shows an approval card. Sensitive actions include running a command, editing a file, and calling a Model Context Protocol (MCP) tool. The card offers three choices:
- Approve runs the action one time.
- Approve always remembers your choice for that action.
- Reject skips the action.
To reject with a reason, type a message instead of choosing an option. The agent receives your message as the reason. One-shot runs with --yolo or --json show no card and approve every action. Use the interactive session when you want to approve each action.
Next steps
-
CLI command reference: Look up every
tccommand. -
CLI configuration and troubleshooting: Configure
tc, branch on exit codes in CI, and fix common problems.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!