| 1 | --- |
| 2 | title: "Install Continue CLI" |
| 3 | description: "Get Continue CLI installed and configured for command-line AI coding assistance and automation" |
| 4 | sidebarTitle: "Install" |
| 5 | --- |
| 6 | |
| 7 | <Info> |
| 8 | Make sure you have [Node.js 18 or higher |
| 9 | installed](https://nodejs.org/en/download/). |
| 10 | </Info> |
| 11 | |
| 12 | ## Installation |
| 13 | |
| 14 | Install Continue CLI globally using npm: |
| 15 | |
| 16 | ```bash |
| 17 | npm i -g @continuedev/cli |
| 18 | ``` |
| 19 | |
| 20 | ## Two Ways to Use Continue CLI |
| 21 | |
| 22 | <Info> |
| 23 | **Quick Overview**: Continue CLI works in two modes - TUI for interactive |
| 24 | conversations or headless for automated commands. |
| 25 | </Info> |
| 26 | |
| 27 | <Tabs> |
| 28 | <Tab title="TUI Mode"> |
| 29 | **Interactive development sessions** |
| 30 | |
| 31 | Start a conversation with AI in your terminal: |
| 32 | |
| 33 | ```bash |
| 34 | cn |
| 35 | > @src/app.js Generate unit tests for this component |
| 36 | ``` |
| 37 | |
| 38 | Perfect for exploration, debugging, and iterative development. |
| 39 | |
| 40 | </Tab> |
| 41 | |
| 42 | <Tab title="Headless Mode"> |
| 43 | **Automation and scripting** |
| 44 | |
| 45 | Single commands that return results: |
| 46 | |
| 47 | ```bash |
| 48 | cn -p "Generate a commit message for current changes" |
| 49 | cn -p "Review the last 5 commits for issues" |
| 50 | ``` |
| 51 | |
| 52 | Perfect for CI/CD, git hooks, and automated workflows. |
| 53 | |
| 54 | </Tab> |
| 55 | </Tabs> |
| 56 | |
| 57 | ## Setup |
| 58 | |
| 59 | <Tabs> |
| 60 | <Tab title="cn TUI Mode"> |
| 61 | |
| 62 | For interactive development and exploration: |
| 63 | |
| 64 | <Steps> |
| 65 | <Step title="Login to Continue CLI"> |
| 66 | ```bash |
| 67 | cn login |
| 68 | ``` |
| 69 | This will open your browser to authenticate with Continue Hub. |
| 70 | </Step> |
| 71 | |
| 72 | <Step title="Test TUI Mode"> |
| 73 | Start an interactive session: |
| 74 | ```bash |
| 75 | cn |
| 76 | ``` |
| 77 | |
| 78 | Try asking a question: |
| 79 | |
| 80 | ``` |
| 81 | > Tell me about the CLI |
| 82 | ``` |
| 83 | |
| 84 | </Step> |
| 85 | </Steps> |
| 86 | </Tab> |
| 87 | <Tab title="cn Headless Mode"> |
| 88 | |
| 89 | For automation workflows and scripting: |
| 90 | |
| 91 | <Steps> |
| 92 | <Step title="Get API Key for Automation"> |
| 93 | For automation workflows, get an API key: |
| 94 | 1. Visit [Continue Hub API Keys](https://hub.continue.dev/settings/api-keys) |
| 95 | 2. Click **"+ New API Key"** |
| 96 | 3. Copy the API key immediately (you won't see it again!) |
| 97 | 4. Login using your Continue account |
| 98 | </Step> |
| 99 | |
| 100 | <Step title="Add Secrets for Workflows"> |
| 101 | Store secure credentials for CLI workflows: |
| 102 | 1. Visit [Continue Hub Secrets](https://hub.continue.dev/settings/secrets) |
| 103 | 2. Add your API keys and sensitive data |
| 104 | 3. Reference in configurations with `${{ secrets.SECRET_NAME }}` |
| 105 | </Step> |
| 106 | |
| 107 | <Step title="Test Headless Mode"> |
| 108 | Try headless mode for automation: |
| 109 | ```bash |
| 110 | cn -p "Generate a conventional commit message for the current git changes" |
| 111 | ``` |
| 112 | </Step> |
| 113 | </Steps> |
| 114 | </Tab> |
| 115 | </Tabs> |
| 116 | |
| 117 | ## What's Next? |
| 118 | |
| 119 | <CardGroup cols={2}> |
| 120 | <Card title="Quick Start Guide" icon="rocket" href="/cli/quick-start"> |
| 121 | Learn basic usage with practical examples |
| 122 | </Card> |
| 123 | |
| 124 | <Card title="Create your first workflow" icon="gear" href="/guides/posthog-github-continuous-ai"> |
| 125 | Build automated workflows with Continue CLI |
| 126 | </Card> |
| 127 | </CardGroup> |
| 128 | |
| 129 | ## Getting Help |
| 130 | |
| 131 | If you encounter issues: |
| 132 | |
| 133 | - Ask for help in [our discussions](https://github.com/continuedev/continue/discussions) |
| 134 | - Report bugs on [GitHub](https://github.com/continuedev/continue) |