diff --git a/.claude/skills/docs-style/SKILL.md b/.claude/skills/docs-style/SKILL.md new file mode 100644 index 00000000000..d65086856cd --- /dev/null +++ b/.claude/skills/docs-style/SKILL.md @@ -0,0 +1,41 @@ +--- +name: docs-style +description: Style guidelines for writing and updating documentation. Use when writing new docs, updating existing docs, or reviewing docs for quality. +--- + +# Docs Style Guide + +## Principles + +- **Be concise** — no filler. Make it easy to find what you're looking for +- **Task-oriented** — frame around what the user is trying to do, not what the product can do +- **Progressive disclosure** — guide from introduction to advanced use-cases. Don't throw users into the deep end +- **Real examples over abstract explanations** — show, don't describe +- **Code snippets must be copy-pasteable** — no placeholder values that silently break, no missing imports +- **Prerequisites up front** — don't surprise the user halfway through +- **One topic per page** — if you're covering two things, split it +- **Link, don't repeat** — reference other docs instead of duplicating content +- **Scannable headings** — skimming the TOC should reveal the page structure +- **Show expected output** — after a step, tell the user what they should see +- **Consistent terminology** — pick one term for a concept, use it everywhere +- **Screenshots/GIFs for key product features** — use visuals when they teach faster than text +- **Know which type of doc you're writing** — a tutorial (learning), a how-to (completing a task), a reference (looking something up), or an explanation (understanding why). Don't mix them in one page +- **Tutorials should be completable** — a user following every step should end up with a working result, every time +- **Reference docs should be exhaustive and consistent** — cover everything, use the same structure for every entry + +## Tone + +- **Don't be patronizing** — the reader is a developer. Don't tell them when to use something in a "when to use X vs Y" comparison table. If the distinction matters, state it plainly at the top of the relevant section in a sentence, then move on. +- **Respect the reader's time** — open with the command or code, not a paragraph explaining what they're about to see. Lead with the thing, then explain. +- **No personality** — the docs aren't a character. Don't try to be warm, clever, or endearing. No "Let's dive in!", no "The Magic of...", no "Pro Tip:", no emoji in headings. Developers see through it instantly and it reads like marketing copy wearing a docs costume. Just be direct and clinical. The docs serve information, they don't have a relationship with the reader. +- **Inline guidance over callout boxes** — prefer weaving tips into the prose rather than using ``, ``, ``, etc. These components break reading flow and look heavy when overused. Reserve them for truly critical warnings (e.g. data loss, security). One per page is a good ceiling; zero is often fine. +- **Examples should feel real** — use realistic file paths, realistic prompts, realistic tasks. Not `> Tell me about the CLI` but `> @tests/auth.test.ts This test started failing after the last migration`. +- **Examples earn their place** — don't add "Example: Doing X" sections that are just English prompts in a code block. Examples are valuable when they demonstrate non-obvious syntax, flags, piping, or configuration. If the reader could figure it out from the rest of the page, skip the example. +- **No "Next Steps" sections** — don't end pages with a "Next Steps" or "What's Next?" section with CardGroups linking to other pages. The sidebar navigation already does this. If a link to another page is relevant, put it inline where the context is, not in a generic footer. +- **Page title = sidebar title** — the `title` in frontmatter should match the sidebar label. Drop `sidebarTitle` unless there's a genuine reason for them to differ. Don't stuff extra context into the page title (e.g., "Continue CLI (cn) Overview" → "Overview"). +- **No subtitle/description in frontmatter** — don't use the `description` field. The opening paragraph of the page should provide whatever context is needed. Metadata subtitles add clutter and duplicate what the prose already says. + +## Headings + +- **Direct and plain, not clever or engaging** — headings should just say what the section is about. Verbs are fine when they're direct ("Resume previous sessions"). Gerund phrases that sound like tutorial chapter titles are not ("Giving Context with @" → "`@` Context"). The test isn't grammatical — it's tonal. If it sounds like a friendly narrator is walking you through something, rewrite it. If it just plainly states what the section covers, it's good. +- **Scannable over descriptive** — skimming the TOC should reveal the page structure at a glance. Keep headings short and plain. diff --git a/docs/agents/overview.mdx b/docs/agents/overview.mdx index 5499428f260..8a51d9cc84f 100644 --- a/docs/agents/overview.mdx +++ b/docs/agents/overview.mdx @@ -1,7 +1,7 @@ --- title: "Cloud Agents & Continuous AI" description: "Standardized Cloud Agent workflows that combine prompts, rules, and tools to complete specific, repeatable tasks" -sidebarTitle: "Overview" +sidebarTitle: "Agents" --- ## What are Cloud Agents? diff --git a/docs/cli/configuration.mdx b/docs/cli/configuration.mdx new file mode 100644 index 00000000000..851dec6bab4 --- /dev/null +++ b/docs/cli/configuration.mdx @@ -0,0 +1,77 @@ +--- +title: "Configuration" +--- + +`cn` resolves its configuration (models, MCP servers, rules, etc.) from several sources, in this order: + +1. **`--config` flag** — a file path or hub assistant slug passed at launch +2. **Saved config** — the last-used configuration, persisted across sessions +3. **Default** — your first assistant from [Continue](https://continue.dev), or `~/.continue/config.yaml` if you're not logged in + +## `--config` flag + +Point `cn` at a local YAML file or a hub assistant: + +```bash +# Local file +cn --config ./my-config.yaml + +# Hub assistant +cn --config my-org/my-assistant +``` + +This overrides any saved preference for the current session. + +## Switching at runtime + +Use `/config` inside a TUI session to switch between available configurations: + +``` +> /config +``` + +This shows your available assistants and local configs. The selection is saved for next time. + +## `config.yaml` + +If you're not logged in to Continue, `cn` looks for `~/.continue/config.yaml`. This file uses the same format as the IDE extensions — see [config.yaml reference](/customize/deep-dives/configuration) for the full schema. + +## CLI-specific flags + +Several flags inject configuration at launch without editing a file: + +```bash +# Add models from the hub +cn --model my-org/claude-sonnet + +# Add MCP servers from the hub +cn --mcp my-org/github-mcp + +# Add rules (file path, hub slug, or inline string) +cn --rule ./rules/style.md +cn --rule my-org/code-review-rules +cn --rule "Always use TypeScript strict mode" + +# Load an agent file from the hub +cn --agent my-org/pr-reviewer +``` + +All of these are repeatable — pass them multiple times to add multiple items. + +## Organization + +If you belong to multiple organizations on Continue, use `--org` to specify which one: + +```bash +cn --org my-team -p "Review this PR" +``` + +In TUI mode, `/config` lets you switch organizations interactively. + +## Secrets + +Store sensitive values (API keys, tokens) in [Continue → Settings → Secrets](https://continue.dev/settings/secrets). Reference them in config with: + +```yaml +${{ secrets.MY_API_KEY }} +``` diff --git a/docs/cli/guides.mdx b/docs/cli/guides.mdx deleted file mode 100644 index 89e96b56650..00000000000 --- a/docs/cli/guides.mdx +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: "Guides" -url: "/guides/overview#mcp-integration-cookbooks" ---- \ No newline at end of file diff --git a/docs/cli/headless-mode.mdx b/docs/cli/headless-mode.mdx new file mode 100644 index 00000000000..f493869ff6f --- /dev/null +++ b/docs/cli/headless-mode.mdx @@ -0,0 +1,86 @@ +--- +title: "Headless Mode" +--- + +Run `cn -p "your prompt"` to execute a single task without an interactive session. The agent runs to completion and prints its response to stdout. + +```bash +cn -p "Generate a conventional commit message for the staged changes" +``` + +## Piping + +Pipe data into `cn` to include it as context: + +```bash +git diff --staged | cn -p "Write a commit message for this diff" +cat error.log | cn -p "Explain what went wrong" +curl -s https://api.example.com/health | cn -p "Is this healthy?" +``` + +Pipe the output into other tools: + +```bash +cn -p "Generate a commit message" | git commit -F - +cn -p "List all TODO comments in src/" --silent > todos.txt +``` + +## Output options + +| Flag | Effect | +|------|--------| +| `--silent` | Strip `` tags and excess whitespace from output | +| `--format json` | Output structured JSON | + +`--silent` is useful when piping output into another program. `--format json` is useful for parsing results programmatically. + +## Tool permissions + +In headless mode, tools that would normally prompt for approval (`ask` permission) are automatically excluded — there's no one to approve them. To enable write operations, explicitly allow them: + +```bash +# Allow the agent to write files +cn -p "Fix the type errors in src/" --allow Write --allow Edit + +# Allow everything +cn -p "Set up the project" --allow "*" +``` + +See [tool permissions](/cli/tool-permissions) for the full policy system. + +## Authentication in CI + +Set `CONTINUE_API_KEY` instead of running `cn login`: + +```bash +export CONTINUE_API_KEY=your-key-here +cn -p "Review the PR for security issues" +``` + +Get an API key from [Continue → Settings → API Keys](https://continue.dev/settings/api-keys). Store it as a secret in your CI provider. + +## Resume in headless mode + +Resume a previous session without interactive input: + +```bash +cn -p --resume +``` + +This replays the previous session's history, which can be useful for inspecting past results in automation. + +## Examples + +```bash +# Git hooks +cn -p "Review staged changes for obvious bugs" --silent + +# CI pipeline — allow file writes for auto-fix +cn -p "Fix all ESLint errors in src/" --allow Write --allow Edit --allow Bash + +# Generate docs from code +cn -p "@src/api/ Generate OpenAPI documentation for these endpoints" --silent > api-docs.yaml + +# Use a specific assistant +cn -p "Triage this error log" --config my-org/error-triage-assistant +``` diff --git a/docs/cli/install.mdx b/docs/cli/install.mdx index 07bd47b56c9..0204cbde6da 100644 --- a/docs/cli/install.mdx +++ b/docs/cli/install.mdx @@ -1,7 +1,5 @@ --- -title: "Install Continue CLI" -description: "Get Continue CLI installed and configured for command-line AI coding assistance and automation" -sidebarTitle: "Install" +title: "Install" --- import { OSAutoDetect } from '/snippets/OSAutoDetect.jsx' @@ -9,132 +7,40 @@ import CLIInstall from '/snippets/cli-install.mdx' - - -## Installation - -## Two Ways to Use Continue CLI - - - **Quick Overview**: Continue CLI works in two modes - TUI for interactive - conversations or headless for automated commands. - - - - -**Interactive development sessions** - -Start a conversation with AI in your terminal: - -```bash -cn -> @src/app.js Generate unit tests for this component -``` - -Perfect for exploration, debugging, and iterative development. - - - - -**Automation and scripting** - -Single commands that return results: +Verify the installation: ```bash -cn -p "Generate a commit message for current changes" -cn -p "Review the last 5 commits for issues" +cn --version ``` -Perfect for CI/CD, git hooks, and automated workflows. - - - - -## Setup - - - +## Authentication -For interactive development and exploration: +### Log in with Continue - - ```bash cn login ``` -This will open your browser to authenticate with Continue Mission Control. - - -Start an interactive session: -```bash -cn -``` +This opens your browser to authenticate with [Continue](https://continue.dev). Once authenticated, `cn` can use your configured assistants, models, and MCP servers from the platform. -Try asking a question: +### API key (headless / CI) -``` -> Tell me about the CLI -``` +For automation environments where there's no browser, set the `CONTINUE_API_KEY` environment variable: - - - - - -For automation workflows and scripting: - - - -For automation workflows, get an API key: -1. Visit [Continue Mission Control API Keys](https://continue.dev/settings/api-keys) -2. Click **"+ New API Key"** -3. Copy the API key immediately (you won't see it again!) -4. Login using your Continue account - - - -Store secure credentials for CLI workflows: -1. Visit [Continue Mission Control Secrets](https://continue.dev/settings/secrets) -2. Add your API keys and sensitive data -3. Reference in configurations with `${{ secrets.SECRET_NAME }}` - - - -Try headless mode for automation: ```bash -cn -p "Generate a conventional commit message for the current git changes" +export CONTINUE_API_KEY=your-key-here +cn -p "your prompt" ``` - - - - - -## What's Next? - - - Learn basic usage with practical examples - +Get an API key from [Continue → Settings → API Keys](https://continue.dev/settings/api-keys). - - Build automated workflows with Continue CLI - - +### Local API key -## Getting Help +If you don't want to use Continue, you can use an Anthropic API key directly. On first launch, `cn` will prompt you to choose between logging in with Continue or entering an Anthropic API key. -If you encounter issues: +## Requirements -- Ask for help in [our discussions](https://github.com/continuedev/continue/discussions) -- Report bugs on [GitHub](https://github.com/continuedev/continue) +- **Node.js 20+** — needed for the npm install path. The shell installer bundles its own runtime. +- A [Continue](https://continue.dev) account, or an Anthropic API key. diff --git a/docs/cli/overview.mdx b/docs/cli/overview.mdx index 9c0e9c51cab..4db3796b670 100644 --- a/docs/cli/overview.mdx +++ b/docs/cli/overview.mdx @@ -1,7 +1,5 @@ --- -title: "Continue CLI (cn) Overview" -description: "Command-line interface for automated coding tasks, scripting, and headless development workflows with Continue's AI coding capabilities" -sidebarTitle: "Overview" +title: "Overview" --- import { OSAutoDetect } from '/snippets/OSAutoDetect.jsx' @@ -9,234 +7,46 @@ import CLIInstall from '/snippets/cli-install.mdx' +Continue CLI (`cn`) is a terminal-based coding agent. It can edit files, run commands, and work through multi-step tasks — the same agent that powers the Continue IDE extensions, running in your terminal. + -**Continue enables developers to ship faster with Continuous AI.** - - - Build features from descriptions. Debug and fix issues. Navigate any codebase. - Automate tedious tasks. - - -## Get Started in 30 Seconds - -Prerequisites: - -- [Node.js 18 or newer](https://nodejs.org/en/download/) -- A [Continue Mission Control](https://continue.dev) account (recommended) or local configuration +## Install -Then navigate to your project and start coding: - -```bash -cd your-awesome-project -cn -# You'll be prompted to set up on first use -``` - -That's it! You're ready to start automating with Continue CLI. - -[Continue with CLI Quickstart →](/cli/quick-start) - -## Two Ways to Use Continue CLI - -Continue CLI offers two distinct modes designed for different workflows: - -### TUI Mode: Interactive Development - -**Perfect for exploration, debugging, and iterating on AI workflows** +## First run ```bash +cd your-project cn -> @src/components/UserProfile.js Review this component for security issues -> Generate comprehensive unit tests -> Suggest performance improvements -``` - -- **Interactive conversations** with your codebase -- **Iterate and refine** prompts and approaches -- **Explore and understand** complex codebases -- **Perfect for experimentation** and learning - -### Headless Mode: Production Automation - -**Perfect for CI/CD, automation, and reliable workflows** - -```bash -cn -p "Generate a conventional commit message for staged changes" -cn -p "Review pull request changes for security vulnerabilities" -cn -p "Update documentation based on recent code changes" ``` -- **Single-command execution** for automation -- **Reliable, repeatable results** for production use -- **CI/CD and pipeline integration** -- **Git hooks and automated workflows** - - - **Tool Permissions in TUI vs Headless Mode** - - Continue CLI tools have three permission levels: - - **allow**: Executes automatically without confirmation - - **ask**: Prompts for user confirmation before execution (e.g., `writeFile`, `runTerminalCommand`) - - **exclude**: Tool is not available to the AI - - **In headless mode**, tools with "ask" permission are automatically excluded to prevent the AI from seeing tools it cannot call. This ensures reliable automation without user intervention. - - **In TUI mode**, tools with "ask" permission are available and will prompt for confirmation when the AI attempts to use them. - - 💡 **Tip**: If your workflow requires tools that need confirmation (like file writes or terminal commands), use TUI mode. For fully automated workflows with read-only operations, use headless mode. - - -### Development Workflow: TUI → Headless - - - **Pro Tip**: Start in TUI mode to iterate on your AI agent. Once - you have a workflow that works reliably, deploy it as a Continuous AI - automation. - - -1. **Experiment in TUI mode** to perfect your agent -2. **Test different approaches** interactively until you get consistent results -3. **Convert successful workflows** to automated Continuous AI commands -4. **Deploy in production** with confidence in your proven approach - -## Why developers love Continue CLI - -- **Works in your terminal**: Not another chat window. Not another IDE. Continue CLI meets you where you already work, with the tools you already love. -- **Takes action**: Continue CLI can directly edit files, run commands, and create commits. Need more? Check out our [MCPs](/customize/deep-dives/mcp). -- **Automate tasks**: Create issues from PostHog data, automatically assign labels to issues, and more. Do all this in a single command from your developer machines, or automatically in CI. -- **Flexible development flow**: Start interactive, then automate proven workflows. - -## Key Capabilities - -### Context Engineering - -- Use `@` to reference files and provide context -- Use `/` to run slash commands for specific tasks -- Access the same context providers as IDE extensions - -### Tool Integration - -- File editing and creation -- Terminal command execution -- Codebase understanding and analysis -- Git integration -- Web search and documentation access +On first launch you'll be asked to log in with [Continue](https://continue.dev) or enter an Anthropic API key. After that, you're in a session and can start typing. -### Model Flexibility - -- Switch between models with `/model` command -- Use any model configured in your `config.yaml` -- Access Continue Mission Control models and configurations - -## Continue Mission Control Integration - -Continue CLI integrates seamlessly with [Continue Mission Control](https://continue.dev) for: - -### API Access - -Get an API key for automation workflows: - -1. Visit [Continue Mission Control API Keys](https://continue.dev/settings/api-keys) -2. Create a new API key -3. Use with `cn login` or in your automation scripts - -### Secrets Management - -Store secure credentials for CLI workflows: - -1. Visit [Continue Mission Control Secrets](https://continue.dev/settings/secrets) -2. Add your API keys and sensitive data -3. Reference in configurations with `${{ secrets.SECRET_NAME }}` - -### Configuration Sync - -- Cloud-managed configurations automatically sync -- Share configurations across team members -- Version control for your AI workflows - -## Common Use Cases - -### TUI Mode Examples - -**Interactive development and exploration:** - - -```bash Codebase Exploration -# Start interactive session -cn -> @src/components Find all unused React components -> /explain How does authentication work in this codebase? -> @auth/ What security patterns are used here? -``` - -```bash Iterative Debugging -# Debug issues interactively -cn -> @tests/auth.test.js This test is failing, help me understand why -> @src/auth/middleware.js Let's examine this middleware -> /debug What could be causing the timeout error? -``` - -```bash Workflow Development -# Develop and test automation workflows -cn -> @package.json @CHANGELOG.md Generate a release notes template -> # Test and refine the approach -> # Once working, convert to: cn -p "Generate release notes" -``` - - - -### Headless Mode Examples - -**Production automation and scripting:** - - -```bash Git Automation -# Generate commit messages -cn -p "Generate a conventional commit message for the current changes" - -# Code review automation - -cn -p "Review the current git changes for bugs and suggest improvements" - -```` - -```bash CI/CD Integration -# In your pipeline scripts -cn -p "Analyze test failures and suggest fixes" - -# Automated documentation updates -cn -p "@README.md Update this documentation based on recent changes" -```` - -```bash Issue Management -# Create GitHub issues from PostHog data -cn -p "@posthog-data.json Create GitHub issues for UX problems found in this session data" - -# Automated security audits -cn -p "Scan the codebase for potential security vulnerabilities" -``` +## Two modes - +**[TUI mode](/cli/tui-mode)** — run `cn` to start an interactive session. You type messages, reference files with `@`, approve tool calls, and iterate with the agent. This is the default. -## Next Steps +**[Headless mode](/cli/headless-mode)** — run `cn -p "your prompt"` for single-shot automation. The agent runs to completion and prints its response to stdout. Use this in scripts, CI/CD, and git hooks. - - - Learn basic commands and common workflows - +## Common flags - - Install Continue CLI and set up your environment - +| Flag | Effect | +|------|--------| +| `-p "prompt"` | Headless mode — run prompt and exit | +| `--config ` | Use a specific config file or assistant | +| `--resume` | Resume the most recent session | +| `--auto` | Allow all tools without prompting | +| `--readonly` | Plan mode — read-only tools only | +| `--allow ` | Allow a specific tool (repeatable) | +| `--exclude ` | Exclude a specific tool (repeatable) | +| `--rule ` | Add a rule — file path, hub slug, or string (repeatable) | +| `--mcp ` | Add an MCP server from the hub (repeatable) | +| `--model ` | Add a model from the hub (repeatable) | +| `--agent ` | Load an agent file from the hub | +| `--verbose` | Enable verbose logging | - - Task-specific tutorials and examples - - +Run `cn --help` for the full list. diff --git a/docs/cli/quick-start.mdx b/docs/cli/quick-start.mdx deleted file mode 100644 index dbda8ec50a6..00000000000 --- a/docs/cli/quick-start.mdx +++ /dev/null @@ -1,186 +0,0 @@ ---- -title: "Continue CLI Quick Start" -description: "Get hands-on experience with Continue CLI through practical examples and common use cases" -sidebarTitle: "Quick Start" ---- - -Get hands-on experience with Continue CLI through practical development workflows. - - - - TUI Mode (`cn` command) is for **large development tasks** that require - agentic workflows with human oversight. Perfect for complex refactors, - feature implementation, or one-off automation tasks that need monitoring and - iteration. - - - Headless Mode (`-p` flag) is for **reliable, repeatable tasks** that no - longer need constant supervision. Perfect for CI/CD pipelines, git hooks, - and automated workflows you've already tested and refined. - - - -## TUI Mode: Large Development Tasks - -Make sure you have [Continue CLI installed](/cli/install) and are in a project directory. - -### Example: Implementing a New Feature - -```bash -# Navigate to your project directory -cd your-awesome-project - -# Start TUI Mode for complex development work -cn -``` - -**Example workflow for adding authentication:** - -``` -> I need to add JWT authentication to this Express app. Let me start by showing you the current structure. - -> @src/app.js @package.json Here's my current setup. Can you implement JWT auth with middleware, login/register routes, and user model? - -> [Agent analyzes codebase and implements auth system] -> [You review changes, test, and provide feedback] -> [Agent iterates based on your input until the feature is complete] -``` - -### Example: Complex Refactoring - -```bash -cn -``` - -**Refactoring a monolithic component:** - -``` -> @src/components/Dashboard.jsx This component is 800 lines and does too much. Help me break it into smaller, reusable components. - -> [Agent analyzes component structure] -> [Proposes component breakdown strategy] -> [You approve approach] -> [Agent implements the refactor with proper props and state management] -> [You test and request adjustments] -``` - -### When to Use TUI Mode - -✅ **Large development tasks** that need oversight -✅ **Complex refactors** requiring multiple steps -✅ **New feature implementation** with unknowns -✅ **One-off automation tasks** you haven't done before -✅ **Debugging complex issues** that need exploration - -## Headless Mode: Automated Workflows - -Once you've refined a workflow in TUI Mode, convert it to Continuous AI for automation. - -### Example: From REPL → Continuous AI - -**Step 1: Develop in TUI Mode** - -```bash -cn -> @package.json @CHANGELOG.md Generate release notes for version 2.1.0 -> [Test and refine the prompt until it works perfectly] -``` - -**Step 2: Convert to Continuous AI** - -```bash -# Now use the refined workflow in automation -cn -p "Generate release notes for the current version based on package.json and recent commits" -``` - -### Common Continuous AI Workflows - -```bash -# Git automation -cn -p "Generate a conventional commit message for staged changes" -cn -p "Review the last 3 commits for potential issues" - -# Code quality -cn -p "Fix all TypeScript errors in the src/ directory" -cn -p "Update outdated dependencies and fix breaking changes" - -# Documentation -cn -p "@README.md Update documentation based on recent changes" -cn -p "Generate API documentation from JSDoc comments" - -# CI/CD integration -cn -p "Analyze test failures and create GitHub issue with findings" -cn -p "Update version numbers and create release branch" -``` - -### When to Use Headless Mode - -✅ **Proven workflows** you've tested in TUI Mode -✅ **Repetitive tasks** that no longer need oversight -✅ **CI/CD automation** in pipelines -✅ **Git hooks** for automated checks -✅ **Scheduled tasks** that run unattended - - - **Tool Permission Differences Between Modes** - - Tools requiring user confirmation ("ask" permission) like `writeFile` and `runTerminalCommand` are: - - **Available in TUI mode** - AI can use them with your approval - - **Excluded in headless mode** - AI cannot see or call them - - This prevents the AI from attempting operations that require user interaction when running in automated environments. Choose TUI mode if your workflow needs tools that modify files or run commands. - - -### Available Slash Commands - -Common slash commands available in CLI: - -- `/clear` - Clear the chat history -- `/compact` - Summarize chat history into a compact form -- `/config` - Switch configuration or organization -- `/exit` - Exit the chat -- `/fork` - Start a forked chat session from the current history -- `/help` - Show help message -- `/info` - Show session information including usage statistics (cost, tokens, cache usage) -- `/init` - Create an AGENTS.md file -- `/login` - Authenticate with your account -- `/logout` - Sign out of your current session -- `/mcp` - Manage MCP server connections -- `/model` - Switch between available chat models -- `/resume` - Resume a previous chat session -- `/whoami` - Check who you're currently logged in as - -Use `/help` to see all available commands. - -## The Development Workflow - - - **Recommended Approach**: Start complex tasks in TUI Mode to iterate and - refine your approach. Once you have a reliable workflow, convert it to - Headless Mode for automation. - - -### Workflow Pattern - -1. **🔬 Experiment in TUI Mode** - - - Try complex development tasks with human oversight - - Iterate on prompts and approaches until they work reliably - - Test edge cases and refine the agent's behavior - -2. **⚡ Automate with Continuous AI** - - Convert proven REPL workflows to single commands - - Deploy in CI/CD, git hooks, or scheduled tasks - - Run with confidence knowing the approach is tested - -## Next Steps - - - - Build an automated PostHog to GitHub issues workflow - - - - Learn to build and deploy AI-powered development workflows - - diff --git a/docs/cli/tool-permissions.mdx b/docs/cli/tool-permissions.mdx new file mode 100644 index 00000000000..5273a116dd4 --- /dev/null +++ b/docs/cli/tool-permissions.mdx @@ -0,0 +1,92 @@ +--- +title: "Tool Permissions" +--- + +Every tool has one of three permission levels: + +| Permission | Behavior | +|------------|----------| +| `allow` | Runs automatically, no prompt | +| `ask` | Prompts for approval before running (TUI only) | +| `exclude` | Hidden from the agent entirely | + +## Defaults + +Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`) default to `allow`. Write tools (`Edit`, `MultiEdit`, `Write`) and `Bash` default to `ask`. In [headless mode](/cli/headless-mode), `ask` tools are excluded since there's no one to approve them. + +## Overriding with flags + +Use `--allow`, `--ask`, and `--exclude` to override defaults at launch: + +```bash +# Allow file writes without prompting +cn --allow Write --allow Edit + +# Exclude terminal commands +cn --exclude Bash + +# Allow everything (headless automation) +cn -p "Set up the project" --allow "*" +``` + +Flags take precedence over all other permission sources. + +## Tool matching patterns + +Flags accept tool matching patterns: + +- `Write` — matches any call to the `Write` tool +- `Write(*)` — same as above +- `Write(**/*.ts)` — matches `Write` calls where the primary argument matches the glob `**/*.ts` + +```bash +# Allow writing only to TypeScript files +cn --allow "Write(**/*.ts)" + +# Allow bash but not for install commands +cn --allow Bash --exclude "Bash(npm install*)" +``` + +## `permissions.yaml` + +Persistent permissions are stored in `~/.continue/permissions.yaml`. This file is updated when you choose "Continue + don't ask again" in the TUI approval prompt. + +```yaml +# ~/.continue/permissions.yaml +allow: + - Read(*) + - Write(**/*.ts) + +ask: + - Bash + +exclude: [] +``` + +You can edit this file directly, but it's primarily managed by the TUI. Changes take effect on the next session. + +## Precedence + +When multiple sources define a permission for the same tool, the highest-priority source wins: + +1. **Mode policies** — `--auto` and `--readonly` override everything (see below) +2. **CLI flags** — `--allow`, `--ask`, `--exclude` +3. **`permissions.yaml`** — persistent personal settings +4. **Defaults** — built-in policies + +## Modes + +Modes are a shorthand for common permission sets. Switch modes with `Shift+Tab` during a TUI session, or set them at launch: + +```bash +cn --auto # Allow all tools without prompting +cn --readonly # Plan mode — read-only tools only, no file writes +``` + +| Mode | Effect | +|------|--------| +| **normal** (default) | Uses configured permissions | +| **plan** (`--readonly`) | Excludes all write tools, allows reads and `Bash` | +| **auto** (`--auto`) | Allows everything — `*: allow` | + +Plan and auto modes are absolute overrides. They ignore `--allow`, `--exclude`, and `permissions.yaml` entirely. diff --git a/docs/cli/tui-mode.mdx b/docs/cli/tui-mode.mdx new file mode 100644 index 00000000000..44999ed6073 --- /dev/null +++ b/docs/cli/tui-mode.mdx @@ -0,0 +1,60 @@ +--- +title: "TUI Mode" +--- + +Run `cn` to start an interactive session. You get a prompt where you can type messages, reference files with `@`, and use slash commands. `cn` uses the same underlying agent as the Continue IDE extensions. + + + + + +## `@` Context + +Use `@` to point the agent at specific files or directories: + +``` +> @src/auth/middleware.ts Why is this middleware rejecting valid tokens? +> @tests/ Write missing test cases for the auth module +> @package.json @tsconfig.json Help me set up path aliases +``` + +The agent reads the referenced files and uses them as context for its response. + +## Slash Commands + +Type `/` to see available commands. Run `/help` for the full list. + +| Command | What it does | +|---------|-------------| +| `/model` | Switch between configured chat models | +| `/config` | Switch configuration or organization | +| `/compact` | Summarize chat history to free up context | +| `/fork` | Branch the conversation from the current point | +| `/resume` | Pick up a previous session | +| `/info` | Show token usage and cost for this session | +| `/init` | Create an `AGENTS.md` file for the current project | +| `/mcp` | Manage MCP server connections | + +## Resume previous sessions + +Pick up where you left off: + +```bash +# Resume the most recent session +cn --resume + +# Or use the slash command inside a session +> /resume +``` + +This restores the full conversation history, so the agent remembers prior context. + +## Tool Permissions + +Tools that can modify your system (file writes, terminal commands) prompt for approval before executing. You get three options: + +- **Continue** — approve this call +- **Continue + don't ask again** — approve and save a policy rule to `~/.continue/permissions.yaml` +- **No** — reject the call and give the agent new instructions + +Read-only tools (`Read`, `List`, `Search`, `Fetch`) run automatically. See [tool permissions](/cli/tool-permissions) for the full policy system. diff --git a/docs/docs.json b/docs/docs.json index 2674ab96165..1374083c408 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -11,24 +11,18 @@ "navigation": { "tabs": [ { - "tab": "Documentation", + "tab": "Mission Control", "groups": [ - { - "group": "Getting Started", - "icon": "rocket-launch", - "pages": ["index", "overview"] - }, { "group": "Mission Control", "icon": "globe", "pages": [ - "mission-control/index", + "index", + "agents/overview", "mission-control/tasks", - "mission-control/workflows", { "group": "Integrations", "pages": [ - "mission-control/integrations", "mission-control/integrations/github", "mission-control/integrations/sentry", "mission-control/integrations/snyk", @@ -39,59 +33,25 @@ "mission-control/integrations/supabase" ] }, - "mission-control/metrics", - "mission-control/sharing", - { - "group": "Governance", - "pages": [ - "mission-control/governance/creating-an-org", - "mission-control/governance/org-permissions", - "mission-control/governance/pricing" - ] - }, - { - "group": "Secrets", - "pages": [ - "mission-control/secrets/secret-types", - "mission-control/secrets/secret-resolution" - ] - }, - { - "group": "Configs", - "pages": [ - "mission-control/configs/intro", - "mission-control/configs/use-a-config", - "mission-control/configs/create-a-config", - "mission-control/configs/edit-a-config" - ] - } - ] - }, - { - "group": "Agents", - "icon": "robot", - "pages": [ - "agents/intro", - "agents/overview", - "agents/create-and-edit" + "mission-control/metrics" ] - }, + } + ] + }, + { + "tab": "CLI", + "groups": [ { "group": "CLI", "icon": "terminal", "pages": [ "cli/overview", "cli/install", - "cli/quick-start", - "cli/guides", - "cli/configuration" + "cli/tui-mode", + "cli/headless-mode", + "cli/configuration", + "cli/tool-permissions" ] - }, - { - "group": "Help", - "icon": "book-open", - "expanded": false, - "pages": ["faqs", "troubleshooting", "CONTRIBUTING"] } ] }, @@ -247,85 +207,48 @@ "reference/deprecated-codebase", "reference/deprecated-docs" ] - } - ] - }, - { - "tab": "Guides", - "groups": [ - { - "group": "Getting Started", - "icon": "rocket-launch", - "pages": ["guides/overview"] }, { - "group": "Cloud Agents", - "icon": "cloud", + "group": "Guides", + "expanded": false, + "icon": "compass", "pages": [ - "guides/cloud-agents/cloud-agents-taxonomy", - "guides/cloud-agents/guide-to-cloud-agents", - "guides/cloud-agents/when-to-use-cloud-agents", - "guides/cloud-agents/from-task-to-automation", - "guides/cloud-agents/cloud-agents-vs-ci", - "guides/cloud-agents/operating-cloud-agents-safely", - "guides/cloud-agents/automated-security-remediation-with-snyk" + "guides/understanding-configs", + "guides/configuring-models-rules-tools", + "guides/codebase-documentation-awareness", + "guides/plan-mode-guide", + "guides/ollama-guide", + "guides/instinct", + "guides/running-continue-without-internet", + "guides/custom-code-rag", + "guides/how-to-self-host-a-model" ] }, { - "group": "Guides", - "icon": "compass", + "group": "Help", + "icon": "book-open", + "expanded": false, + "pages": ["faqs", "troubleshooting", "CONTRIBUTING"] + }, + { + "group": "Continue Hub (deprecated)", + "expanded": false, + "icon": "box-archive", "pages": [ { - "group": "Understanding Continue", - "pages": [ - "guides/understanding-configs", - "guides/configuring-models-rules-tools", - "guides/codebase-documentation-awareness", - "guides/plan-mode-guide", - "guides/ollama-guide", - "guides/instinct", - "guides/running-continue-without-internet", - "guides/custom-code-rag", - "guides/how-to-self-host-a-model" - ] - }, - { - "group": "CLI Guides", - "pages": [ - "guides/cli", - "guides/run-agents-locally", - "guides/doc-writing-agent-cli" - ] - }, - { - "group": "Continuous AI Guides", - "pages": [ - "guides/continuous-ai", - "guides/continuous-ai-readiness-assessment" - ] - }, - { - "group": "Integration Guides", + "group": "Secrets", "pages": [ - "guides/notion-continue-guide", - "guides/github-pr-review-bot" + "mission-control/secrets/secret-types", + "mission-control/secrets/secret-resolution" ] }, { - "group": "Cookbooks", + "group": "Configs", "pages": [ - "guides/posthog-github-continuous-ai", - "guides/continue-docs-mcp-cookbook", - "guides/github-mcp-continue-cookbook", - "guides/atlassian-mcp-continue-cookbook", - "guides/sanity-mcp-continue-cookbook", - "guides/sentry-mcp-error-monitoring", - "guides/snyk-mcp-continue-cookbook", - "guides/supabase-mcp-database-workflow", - "guides/dlt-mcp-continue-cookbook", - "guides/netlify-mcp-continuous-deployment", - "guides/chrome-devtools-mcp-performance", - "guides/klavis-mcp-continue-cookbook" + "mission-control/configs/intro", + "mission-control/configs/use-a-config", + "mission-control/configs/create-a-config", + "mission-control/configs/edit-a-config" ] } ] @@ -1505,6 +1428,34 @@ { "source": "/hub/integrations/sentry", "destination": "/mission-control/integrations/sentry" + }, + { + "source": "/mission-control/workflows", + "destination": "/mission-control" + }, + { + "source": "/mission-control/sharing", + "destination": "/mission-control" + }, + { + "source": "/mission-control/governance/creating-an-org", + "destination": "/mission-control" + }, + { + "source": "/mission-control/governance/org-permissions", + "destination": "/mission-control" + }, + { + "source": "/mission-control/governance/pricing", + "destination": "/mission-control" + }, + { + "source": "/agents/intro", + "destination": "/agents/overview" + }, + { + "source": "/agents/create-and-edit", + "destination": "/agents/overview" } ] }