Skip to main content

About Terminal Integration

Cheetah AI provides full terminal integration, allowing you to execute shell commands, manage long-running processes, and automate development workflows through natural language. Instead of switching between your editor and terminal, you can ask the AI to run commands, interpret their output, and take action based on the results. Terminal integration is particularly powerful in Agent mode, where the AI can run commands as part of larger workflows. For example, when implementing a feature, the Agent might install dependencies, run tests, and fix any failures automatically.

Running Commands

Execute any shell command by asking the AI in natural language:
"Run npm install"
"Execute the test suite"
"Check the git status"
"Build the project for production"
The AI translates your request into the appropriate command, executes it, and shows you the output. You don’t need to remember exact command syntax - describe what you want to accomplish and the AI figures out the right command.

Command Output Handling

The AI doesn’t just run commands - it reads and interprets the output to provide meaningful assistance: Error Interpretation - When a command fails, the AI analyzes the error message and explains what went wrong. It can often suggest fixes or automatically attempt to resolve the issue. Result Analysis - After running tests, the AI can summarize which tests passed and failed, identify patterns in failures, and suggest fixes for failing tests. Workflow Continuation - Based on command results, the AI decides what to do next. If tests pass, it might proceed to the next step. If they fail, it might investigate and fix the issues. Example interaction:
You: "Run npm test"
AI: [executes tests, observes 2 failures]
AI: "Two tests failed in UserService.test.ts. The failures are related to
     missing mock data for the new getUserById function. Would you like me
     to update the test fixtures to include the required mock data?"

Working Directory

By default, commands run in your workspace root directory. You can specify a different directory when needed:
"Run npm install in the backend folder"
"Execute pytest in the tests/ directory"
"Run cargo build in the cli/ folder"
The AI handles path resolution automatically, so you can use relative paths from your workspace root.

Persistent Terminals

Some processes need to run continuously, like development servers, file watchers, or database connections. Cheetah AI supports persistent terminals for these long-running processes.

Starting Background Processes

"Start the development server"
"Run npm run dev in a background terminal"
"Start the database in a persistent terminal"
When you start a process in a persistent terminal, it continues running in the background while you work on other tasks. The AI can start multiple persistent terminals for different processes.

Managing Background Processes

You can check on and control background processes:
"Show me the output from the dev server"
"What's the status of the background terminal?"
"Stop the running development server"
"Kill all background processes"

Why Use Persistent Terminals?

Persistent terminals solve several problems: Non-blocking - Regular commands block the AI until they complete. Persistent terminals let the AI continue working while processes run in the background. Continuous processes - Development servers, watchers, and similar tools are designed to run continuously. Persistent terminals keep them running as long as you need them. Output access - You can check the output of background processes at any time, which is useful for monitoring logs or debugging issues.

Common Use Cases

Package Management

"Install axios and lodash"
"Update all dependencies to their latest versions"
"Remove unused packages"
"Run npm audit and fix vulnerabilities"
The AI understands package managers (npm, yarn, pnpm) and can install, update, and manage dependencies. It reads package.json to understand your project’s dependency structure.

Git Operations

"Commit these changes with a descriptive message"
"Create a new branch called feature/user-auth"
"Show the git log for the last 10 commits"
"Stash my current changes"
"Pull the latest changes from main"
The AI can perform most git operations. For commits, it analyzes your changes and generates appropriate commit messages. For complex operations like rebasing or resolving conflicts, it provides guidance and executes commands step by step.

Build and Test

"Build the project for production"
"Run tests for the auth module only"
"Check for TypeScript errors"
"Run the linter and fix auto-fixable issues"
The AI understands build tools and test frameworks. It can run specific tests, interpret test output, and help fix failing tests.

Database Operations

"Run database migrations"
"Seed the development database"
"Reset the test database"
For projects with database tooling, the AI can run migrations, seeds, and other database commands.

Command Timeout Behavior

Regular commands have timeout behavior to prevent blocking: Standard commands - Commands timeout after 8 seconds of inactivity. This handles most quick commands like installs, builds, and tests. Long operations - For commands that take longer, the AI waits for completion signals rather than timing out. Background processes - Processes in persistent terminals run indefinitely until you stop them.
"Run the full test suite"  → Waits for completion
"Build for production"     → Waits for build to finish
"Start dev server"         → Runs in persistent terminal

Safety Considerations

The AI exercises caution with potentially destructive commands: Confirmation required - Commands that could cause data loss or system changes require confirmation:
  • rm -rf and recursive deletions
  • Database drops or truncations
  • Force pushes to remote repositories
  • System-level modifications
Explanation provided - Before running risky commands, the AI explains what the command will do and asks for confirmation. Alternatives suggested - When possible, the AI suggests safer alternatives to destructive operations.

Tips and Best Practices

Avoid Pagers for Long Output

Commands like git diff or git log may open interactive pagers (vim, less) that can block execution. Pipe output to cat to avoid this:
"Run git diff | cat"
"Show git log --oneline | head -20"
The AI often handles this automatically, but you can be explicit if needed. Request multiple related commands in sequence:
"Install dependencies, run migrations, then start the server"
The AI executes them in order and handles any errors that occur along the way.

Use Persistent Terminals for Servers

Development servers should always run in persistent terminals:
"Start the dev server in a background terminal"
This keeps the server running while you continue working on other tasks.

Check Command Results

After running commands, you can ask about the results:
"Did the tests pass?"
"Were there any errors in the build?"
"What was the exit code?"

Let the AI Handle Errors

When commands fail, the AI can often diagnose and fix the issue:
You: "Run npm install"
AI: [command fails with peer dependency error]
AI: "The installation failed due to a peer dependency conflict. I can fix
     this by using --legacy-peer-deps. Would you like me to try that?"