| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- ---
- title: "Intro"
- description: "Get started with OpenCode."
- ---
- [**OpenCode**](https://opencode.ai) is an open source AI coding agent. It's available as a terminal-based interface or
- desktop app.
- <img
- src="https://raw.githubusercontent.com/anomalyco/opencode/dev/packages/web/src/assets/lander/screenshot.png"
- alt="OpenCode TUI with the opencode theme"
- />
- Let's get started.
- ---
- #### Prerequisites
- To use OpenCode in your terminal, you'll need:
- 1. A modern terminal emulator like:
- - [Ghostty](https://ghostty.org), Linux and macOS
- - [WezTerm](https://wezterm.org), cross-platform
- - [Alacritty](https://alacritty.org), cross-platform
- - [Kitty](https://sw.kovidgoyal.net/kitty/), Linux and macOS
- 2. API keys for the LLM providers you want to use.
- ---
- ## Install
- <Note>The curl install script is not available in beta.</Note>
- You can also install it with the following package managers.
- <Tabs>
- <Tab title="npm">
- ```bash
- npm install -g @opencode-ai/cli@next
- ```
- </Tab>
- <Tab title="bun">
- ```bash
- bun install -g @opencode-ai/cli@next
- ```
- </Tab>
- <Tab title="pnpm">
- ```bash
- pnpm install -g @opencode-ai/cli@next
- ```
- </Tab>
- <Tab title="Yarn">
- ```bash
- yarn global add @opencode-ai/cli@next
- ```
- </Tab>
- </Tabs>
- <Note>During beta, the executable is named `opencode2`.</Note>
- ### Homebrew
- Homebrew installation is not available in beta.
- ### Arch Linux
- Arch Linux installation is not available in beta.
- ### Windows
- <Tip>
- For the best experience on Windows, use [Windows Subsystem for Linux
- (WSL)](https://opencode.ai/docs/windows-wsl). It provides better performance and full compatibility with OpenCode's
- features.
- </Tip>
- <Tabs>
- <Tab title="chocolatey">
- Chocolatey installation is not available in beta.
- </Tab>
- <Tab title="scoop">
- Scoop installation is not available in beta.
- </Tab>
- <Tab title="mise">
- Mise installation is not available in beta.
- </Tab>
- <Tab title="docker">
- Docker installation is not available in beta.
- </Tab>
- </Tabs>
- Standalone binaries are not available in beta.
- ---
- ## Connect
- With OpenCode you can use any LLM provider by configuring its API key.
- Run `/connect` in the TUI and select your provider.
- ```text
- /connect
- ```
- If you'd like easy access to all the best coding models you can try out
- [OpenCode Console](https://console.opencode.ai).
- You can also try [OpenCode Go](https://opencode.ai/go) a $10/month subscription
- plan that grants you access to the best open source models.
- See the current [provider directory](https://opencode.ai/docs/providers#directory).
- ---
- ## Usage
- You are now ready to use OpenCode in your project. Here are a few common workflows.
- ### Ask questions
- Ask OpenCode to explain your codebase.
- <Tip>Use `@` to fuzzy search for files in the project.</Tip>
- ```text
- How is authentication handled in @packages/functions/src/api/index.ts
- ```
- ### Add features
- Ask OpenCode to add a feature by describing the desired behavior and providing relevant context.
- ```text
- When a user deletes a note, flag it as deleted in the database.
- Create a screen that shows recently deleted notes.
- From this screen, the user can restore a note or permanently delete it.
- ```
- <Tip>Give OpenCode plenty of context and examples.</Tip>
- ### Undo changes
- Use `/undo` when a change isn't what you wanted.
- ```text
- /undo
- ```
- OpenCode reverts the changes and restores your original message so you can revise it. Run `/undo` multiple times to undo
- multiple changes, or use `/redo` to reapply them.
- ```text
- /redo
- ```
- ---
- ## Customize
- Make OpenCode your own by [picking a theme](https://opencode.ai/docs/themes), [customizing
- keybinds](https://opencode.ai/docs/keybinds), [configuring formatters](https://opencode.ai/docs/formatters), [creating
- commands](https://opencode.ai/docs/commands), or editing the [OpenCode config](https://opencode.ai/docs/config).
|