Elffuss BraidHub

kikocis/continue public

4940c71be2bf · 3.2 KiBRawPermalink
1---
2title: "Continue CLI (cn)"
3---
4
5<Warning>Continue CLI (cn) is currently in Alpha</Warning>
6
7`cn` is an open-source, modular coding agent for the command line.
8
9It provides a battle-tested agent loop so you can simply plug in your model, rules, and tools.
10
11![cn](/images/cn-demo.gif)
12
13## Quick start
14
15<Info>
16 Make sure you have [Node.js 18 or higher
17 installed](https://nodejs.org/en/download/).
18</Info>
19
20```bash
21# Install
22npm i -g @continuedev/cli
23
24# Interactive mode
25cn
26
27# Headless mode
28cn -p "Generate a conventional commit name for the current git changes"
29```
30
31## Basic usage
32
33Out of the box, `cn` comes with tools that let it understand your codebase, edit files, run terminal commands, and more (if you approve). You can ask `cn` to:
34
35- Fix failing tests
36- Find something in the codebase
37- Execute a refactor
38- Write a new feature
39- And a lot more
40
41Use '@' to give it file context, or '/' to run slash commands.
42
43If you want to resume a previous conversation, run `cn --resume`.
44
45## Headless mode (`-p` flag)
46
47In headless mode, `cn` will only output its final response, making it perfect for Unix Philosophy-style scripting and automation. For example, you could pipe your git diff into `cn` to generate a commit message, and write this to a file:
48
49```bash
50echo "$(git diff) Generate a conventional commit name for the current git changes" | cn -p > commit-message.txt
51```
52
53## Configuration
54
55`cn` uses [`config.yaml`](./reference.mdx), the exact same configuration file as Continue. This means that you can log in to [Continue Hub](./hub/introduction.mdx) or use your existing local configuration.
56
57To switch between configurations, you can use the `/config` slash command in `cn`, or you can start it with the `--config` flag (e.g. `cn --config continuedev/default-agent` or `cn --config ~/.continue/config.yaml`).
58
59### Models
60
61Learn how to add custom models [here](./customization/models.mdx). Then, you can use the `/model` slash command to switch between them in `cn`.
62
63### Rules
64
65`cn` supports [rules](./customize/deep-dives/rules.mdx) in the same way as the Continue IDE extensions. You can also use the `--rule` flag to manually include a rule from the hub. For example, `cn --rule nate/spanish` will tell `cn` to use [this rule](https://hub.continue.dev/nate/spanish) to always speak in Spanish.
66
67### Tools
68
69`cn` supports MCP tools, which can be configured in the [same way](./customize/deep-dives/mcp.mdx) as with the Continue IDE extensions.
70
71#### Tool Permissions
72
73`cn` includes a tool permission system to make sure you approve of the agent's actions. It will begin with minimal permissions but as you approve tool calls, it will add policies to `~/.continue/permissions.yaml` to remember your preferences.
74
75If you want to explicitly allow or deny tools for a single session, you can use the command line flags `--allow`, `--ask`, and `--exclude`. For example:
76
77```bash
78# Always allow the Write tool
79cn --allow Write()
80
81# Always ask before running curl
82cn --ask Bash(curl*)
83
84# Never use the Fetch tool
85cn --exclude Fetch
86```
87
88## Troubleshooting
89
90Run `cn` with the `--verbose` flag to see more detailed logs. These will be output to `~/.continue/logs/cn.log`.
91
92If you have feedback on the alpha, please [share in our Discord](https://discord.com/invite/EfJEfdFnDQ).