mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 18:24:21 +01:00
docs: tweak styles
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: CLI
|
||||
description: The opencode CLI options and commands.
|
||||
---
|
||||
|
||||
Running the opencode CLI starts it for the current directory.
|
||||
@@ -20,6 +21,8 @@ opencode /path/to/project
|
||||
|
||||
The opencode CLI also has the following commands.
|
||||
|
||||
---
|
||||
|
||||
### run
|
||||
|
||||
Run opencode in non-interactive mode by passing a prompt directly.
|
||||
@@ -53,6 +56,8 @@ Command to manage credentials and login for providers.
|
||||
opencode auth [command]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### login
|
||||
|
||||
Logs you into a provider and saves them in the credentials file in `~/.local/share/opencode/auth.json`.
|
||||
@@ -63,6 +68,8 @@ opencode auth login
|
||||
|
||||
When opencode starts up it will loads the providers from the credentials file. And if there are any keys defined in your environments or a `.env` file in your project.
|
||||
|
||||
---
|
||||
|
||||
#### list
|
||||
|
||||
Lists all the authenticated providers as stored in the credentials file.
|
||||
@@ -77,6 +84,8 @@ Or the short version.
|
||||
opencode auth ls
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### logout
|
||||
|
||||
Logs you out of a provider by clearing it from the credentials file.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Config
|
||||
description: Using the opencode JSON config.
|
||||
---
|
||||
|
||||
You can configure opencode using a JSON config file that can be placed in:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Intro
|
||||
description: Get started with opencode.
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
@@ -62,12 +63,12 @@ brew install sst/tap/opencode
|
||||
paru -S opencode-bin
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### Windows
|
||||
|
||||
Right now the automatic installation methods do not work properly on Windows. However you can grab the binary from the [Releases](https://github.com/sst/opencode/releases).
|
||||
|
||||
---
|
||||
|
||||
## Providers
|
||||
|
||||
We recommend signing up for Claude Pro or Max, running `opencode auth login` and selecting Anthropic. It's the most cost-effective way to use opencode.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Keybinds
|
||||
description: Customize your keybinds.
|
||||
---
|
||||
|
||||
opencode has a list of keybinds that you can customize through the opencode config.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: MCP servers
|
||||
description: Add local and remote MCP tools.
|
||||
---
|
||||
|
||||
You can add external tools to opencode using the _Model Context Protocol_, or MCP. opencode supports both:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Models
|
||||
description: Configuring an LLM provider and model.
|
||||
---
|
||||
|
||||
opencode uses the [AI SDK](https://ai-sdk.dev/) and [Models.dev](https://models.dev) to support for **75+ LLM providers** and it supports running local models.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Rules
|
||||
description: Set custom instructions for opencode.
|
||||
---
|
||||
|
||||
You can provide custom instructions to opencode by creating an `AGENTS.md` file. This is similar to `CLAUDE.md` or Cursor's rules. It contains instructions that will be included in the LLM's context to customize its behavior for your specific project.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Themes
|
||||
description: Select a built-in theme or define your own.
|
||||
---
|
||||
|
||||
With opencode you can select from one of several built-in themes, use a theme that adapts to your terminal theme, or define your own custom theme.
|
||||
@@ -62,6 +63,8 @@ You can select a theme by bringing up the theme select with the `/theme` command
|
||||
|
||||
opencode supports a flexible JSON-based theme system that allows users to create and customize themes easily.
|
||||
|
||||
---
|
||||
|
||||
### Hierarchy
|
||||
|
||||
Themes are loaded from multiple directories in the following order where later directories override earlier ones:
|
||||
@@ -73,6 +76,8 @@ Themes are loaded from multiple directories in the following order where later d
|
||||
|
||||
If multiple directories contain a theme with the same name, the theme from the directory with higher priority will be used.
|
||||
|
||||
---
|
||||
|
||||
### Creating a theme
|
||||
|
||||
To create a custom theme, create a JSON file in one of the theme directories.
|
||||
@@ -91,6 +96,8 @@ mkdir -p .opencode/themes
|
||||
vim .opencode/themes/my-theme.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JSON format
|
||||
|
||||
Themes use a flexible JSON format with support for:
|
||||
@@ -101,6 +108,23 @@ Themes use a flexible JSON format with support for:
|
||||
- **Dark/light variants**: `{"dark": "#000", "light": "#fff"}`
|
||||
- **No color**: `"none"` - Uses the terminal's default color or transparent
|
||||
|
||||
---
|
||||
|
||||
### Color definitions
|
||||
|
||||
The `defs` section is optional and it allows you to define reusable colors that can be referenced in the theme.
|
||||
|
||||
---
|
||||
|
||||
### Terminal defaults
|
||||
|
||||
The special value `"none"` can be used for any color to inherit the terminal's default color. This is particularly useful for creating themes that blend seamlessly with your terminal's color scheme:
|
||||
|
||||
- `"text": "none"` - Uses terminal's default foreground color
|
||||
- `"background": "none"` - Uses terminal's default background color
|
||||
|
||||
---
|
||||
|
||||
### Example
|
||||
|
||||
Here's an example of a custom theme:
|
||||
@@ -330,14 +354,3 @@ Here's an example of a custom theme:
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Color definitions
|
||||
|
||||
The `defs` section is optional and it allows you to define reusable colors that can be referenced in the theme.
|
||||
|
||||
### Terminal defaults
|
||||
|
||||
The special value `\"none\"` can be used for any color to inherit the terminal's default color. This is particularly useful for creating themes that blend seamlessly with your terminal's color scheme:
|
||||
|
||||
- `"text": "none"` - Uses terminal's default foreground color
|
||||
- `"background": "none"` - Uses terminal's default background color
|
||||
|
||||
Reference in New Issue
Block a user