cloudaxe-opencode/packages/docs/index.mdx

164 lines
4.1 KiB
Text
Raw Permalink Normal View History

2025-12-05 21:41:35 +00:00
---
2026-07-06 04:57:23 +00:00
title: "Intro"
description: "Get started with OpenCode."
2025-12-05 21:41:35 +00:00
---
2026-07-09 20:55:34 +00:00
<Warning>
These docs are for the beta version of OpenCode, which will become OpenCode 2.0. The beta is still changing: we may
wipe your data, things may break, and APIs, configuration, and plugin APIs may change.
</Warning>
2026-07-06 04:57:23 +00:00
## 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
2026-07-18 00:49:42 +00:00
bun install -g --trust @opencode-ai/cli@next
2026-07-06 04:57:23 +00:00
```
</Tab>
<Tab title="pnpm">
```bash
2026-07-18 00:49:42 +00:00
pnpm add -g --allow-build=@opencode-ai/cli @opencode-ai/cli@next
2026-07-06 04:57:23 +00:00
```
</Tab>
<Tab title="Yarn">
```bash
yarn global add @opencode-ai/cli@next
```
</Tab>
</Tabs>
2026-07-18 00:49:42 +00:00
The package uses a trusted postinstall script to select the native binary for your platform. The Bun and pnpm commands
above explicitly allow that script to run.
<Note>During beta, the binary is called `opencode2`.</Note>
2026-07-06 04:57:23 +00:00
### Homebrew
Homebrew installation is not available in beta.
### Arch Linux
Arch Linux installation is not available in beta.
### Windows
<Tip>
2026-07-09 20:55:34 +00:00
For the best experience on Windows, install [Windows Subsystem for Linux
(WSL)](https://learn.microsoft.com/windows/wsl/install), open your Linux distribution, and use one of the beta package
manager commands above.
2026-07-06 04:57:23 +00:00
</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.
---
2026-07-10 17:39:32 +00:00
#### 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.
---
2026-07-06 04:57:23 +00:00
## Connect
With OpenCode you can use any LLM provider by configuring its API key.
2026-07-06 05:29:08 +00:00
Run `/connect` in the TUI and select your provider.
2026-07-06 04:57:23 +00:00
2026-07-06 05:29:08 +00:00
```text
/connect
```
2026-07-06 04:57:23 +00:00
2026-07-06 05:29:08 +00:00
If you'd like easy access to all the best coding models you can try out
[OpenCode Console](https://console.opencode.ai).
2026-07-06 04:57:23 +00:00
2026-07-06 05:29:08 +00:00
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.
2026-07-06 04:57:23 +00:00
2026-07-09 20:55:34 +00:00
Use `/models` to browse the providers and models available to your project. See [Providers](/providers) for connection and
configuration details.
2026-07-06 04:57:23 +00:00
---
## 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
2026-07-06 05:29:08 +00:00
Ask OpenCode to add a feature by describing the desired behavior and providing relevant context.
2026-07-06 04:57:23 +00:00
```text
2026-07-06 05:29:08 +00:00
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.
2026-07-06 04:57:23 +00:00
```
2026-07-06 05:29:08 +00:00
<Tip>Give OpenCode plenty of context and examples.</Tip>
2026-07-06 04:57:23 +00:00
### Undo changes
Use `/undo` when a change isn't what you wanted.
```text
/undo
```
2026-07-09 20:55:34 +00:00
OpenCode stages a conversation revert and restores your original message so you can revise it. In a Git repository, it
also restores file changes when snapshots were captured successfully. Run `/undo` multiple times to move the conversation
2026-07-09 22:00:30 +00:00
boundary back, or use `/redo` to restore the staged conversation and files. See [Undo](/snapshots) for
2026-07-09 20:55:34 +00:00
limitations and safety details.
2026-07-06 04:57:23 +00:00
```text
/redo
```
---
## Customize
Make OpenCode your own by [picking a theme](/themes), [customizing
2026-07-09 20:55:34 +00:00
keybinds](https://opencode.ai/docs/keybinds), [configuring formatters](/formatters), [creating commands](/commands), or
editing the [OpenCode config](/config).