GeezerVison is showing github.com — docs: add tui doc · meatcar/opencode@2dea8f0
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +17-5Lines changed: 17 additions & 5 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | --- | 2 | | -model: openai/gpt-5 | 3 | | -reasoningEffort: medium | 4 | 2 | description: ALWAYS use this when writing docs | 5 | 3 | --- | 6 | 4 |
| 7 | 5 | You are an expert technical documentation writer | 8 | 6 |
| 9 | 7 | You are not verbose | 10 | 8 |
| 11 | | -Every chunk of text should be followed by an example or something besides text | 12 | | -to look at. | | 9 | +The title of the page should be a word or a 2-3 word phrase | 13 | 10 |
| 14 | | -Chunks of text should not be more than 2 sentences long. | | 11 | +The description should be one short line, should not start with "The", should | | 12 | +avoid repeating the title of the page, should be 5-10 words long | | 13 | + | | 14 | +Chunks of text should not be more than 2 sentences long | | 15 | + | | 16 | +Each section is spearated by a divider of 3 dashes | | 17 | + | | 18 | +The section titles are short with only the first letter of the word capitalized | | 19 | + | | 20 | +The section titles are in the imperative mood | | 21 | + | | 22 | +The section titles should not repeat the term used in the page title, for | | 23 | +example, if the page title is "Models", avoid using a section title like "Add | | 24 | +new models". This might be unavoidable in some cases, but try to avoid it. | | 25 | + | | 26 | +Check out the /packages/web/src/content/docs/docs/index.mdx as an example. |
Collapse file Copy file name to clipboardExpand all lines: packages/web/astro.config.mjs +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -69,7 +69,7 @@ export default defineConfig({ | 69 | 69 |
| 70 | 70 | { | 71 | 71 | label: "Usage", | 72 | | - items: ["docs/cli", "docs/ide", "docs/share", "docs/github"], | | 72 | + items: ["docs/tui", "docs/cli", "docs/ide", "docs/share", "docs/github"], | 73 | 73 | }, | 74 | 74 |
| 75 | 75 | { | |
Collapse file Copy file name to clipboardExpand all lines: packages/web/src/content/docs/docs/cli.mdx +3-124Lines changed: 3 additions & 124 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | --- | 2 | 2 | title: CLI | 3 | | -description: The opencode CLI options and commands. | | 3 | +description: opencode CLI options and commands. | 4 | 4 | --- | 5 | 5 |
| 6 | 6 | import { Tabs, TabItem } from "@astrojs/starlight/components" | 7 | 7 |
| 8 | | -Running the opencode CLI starts it for the current directory. | | 8 | +The opencode CLI accepts commands as documented on this page. You can run any of the available commands to interact with opencode programmatically. | 9 | 9 |
| 10 | 10 | ```bash | 11 | | -opencode | | 11 | +opencode run "Explain how closures work in JavaScript" | 12 | 12 | ``` | 13 | 13 |
| 14 | | -Or you can start it for a specific working directory. | 15 | | - | 16 | | -```bash | 17 | | -opencode /path/to/project | 18 | | -``` | 19 | | - | 20 | | ---- | 21 | | - | 22 | | -## Slash commands | 23 | | - | 24 | | -When using the opencode CLI, you can type `/` followed by a command name to quickly execute actions. For example: | 25 | | - | 26 | | -:::tip | 27 | | -You can also use `@` to reference files in your messages. | 28 | | -::: | 29 | | - | 30 | | -```bash frame="none" | 31 | | -/help | 32 | | -``` | 33 | | - | 34 | | -Here are all available slash commands: | 35 | | - | 36 | | -- **`/help`** | 37 | | - | 38 | | - Show the help dialog. | 39 | | - | 40 | | -- **`/editor`** | 41 | | - | 42 | | - Open external editor for composing messages. Uses the editor set in your `EDITOR` environment variable. [Learn more](#editor-setup). | 43 | | - | 44 | | -- **`/export`** | 45 | | - | 46 | | - Export current conversation to Markdown and open in your default editor. Uses the editor set in your `EDITOR` environment variable. [Learn more](#editor-setup). | 47 | | - | 48 | | -- **`/new`** | 49 | | - | 50 | | - Start a new session. _Alias_: `/clear` | 51 | | - | 52 | | -- **`/sessions`** | 53 | | - | 54 | | - List and switch between sessions. _Aliases_: `/resume`, `/continue` | 55 | | - | 56 | | -- **`/share`** | 57 | | - | 58 | | - Share current session. [Learn more](/docs/share). | 59 | | - | 60 | | -- **`/unshare`** | 61 | | - | 62 | | - Unshare current session. [Learn more](/docs/share#un-sharing). | 63 | | - | 64 | | -- **`/compact`** | 65 | | - | 66 | | - Compact the current session. _Alias_: `/summarize` | 67 | | - | 68 | | -- **`/details`** | 69 | | - | 70 | | - Toggle tool execution details. | 71 | | - | 72 | | -- **`/models`** | 73 | | - | 74 | | - List available models. | 75 | | - | 76 | | -- **`/themes`** | 77 | | - | 78 | | - List available themes. | 79 | | - | 80 | | -- **`/init`** | 81 | | - | 82 | | - Create or update `AGENTS.md` file. [Learn more](/docs/rules). | 83 | | - | 84 | | -- **`/undo`** | 85 | | - | 86 | | - Undo last message. | 87 | | - | 88 | | -- **`/redo`** | 89 | | - | 90 | | - Redo message. | 91 | | - | 92 | | -- **`/exit`** | 93 | | - | 94 | | - Exit opencode. _Aliases_: `/quit`, `/q` | 95 | | - | 96 | | ---- | 97 | | - | 98 | | -### Bash commands | 99 | | - | 100 | | -Start a line with `!` to run a shell command. The output is added to the conversation as a tool result. | 101 | | - | 102 | | -```bash frame="none" | 103 | | -!ls -la | 104 | | -``` | 105 | | - | 106 | | ---- | 107 | | - | 108 | | -### Editor setup | 109 | | - | 110 | | -Both the `/editor` and `/export` commands use the editor specified in your `EDITOR` environment variable. | 111 | | - | 112 | | -<Tabs> | 113 | | - <TabItem label="Linux/macOS"> | 114 | | - ```bash export EDITOR=nano # or vim, code, etc. ``` To make it permanent, add this to your shell profile; | 115 | | - `~/.bashrc`, `~/.zshrc`, etc. | 116 | | - </TabItem> | 117 | | - <TabItem label="Windows (CMD)"> | 118 | | - ```bash set EDITOR=notepad # or code, vim, etc. ``` To make it permanent, use **System Properties** > **Environment | 119 | | - Variables**. | 120 | | - </TabItem> | 121 | | - <TabItem label="Windows (PowerShell)"> | 122 | | - ```bash $env:EDITOR = "notepad" # or "code", "vim", etc. ``` To make it permanent, add this to your PowerShell | 123 | | - profile. | 124 | | - </TabItem> | 125 | | -</Tabs> | 126 | | - | 127 | | -Popular editor options include: | 128 | | - | 129 | | -- `code` - Visual Studio Code | 130 | | -- `vim` - Vim editor | 131 | | -- `nano` - Nano editor | 132 | | -- `notepad` - Windows Notepad | 133 | | -- `subl` - Sublime Text | 134 | | - | 135 | 14 | --- | 136 | 15 |
| 137 | 16 | ## Commands | |
Collapse file Copy file name to clipboardExpand all lines: packages/web/src/content/docs/docs/index.mdx +8-8Lines changed: 8 additions & 8 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -157,16 +157,16 @@ help. | 157 | 157 |
| 158 | 158 | You can ask opencode to explain the codebase to you. | 159 | 159 |
| 160 | | -```txt frame="none" | | 160 | +:::tip | | 161 | +Use the `@` key to fuzzy search for files in the project. | | 162 | +::: | | 163 | + | | 164 | +```txt frame="none" "@packages/functions/src/api/index.ts" | 161 | 165 | How is authentication handled in @packages/functions/src/api/index.ts | 162 | 166 | ``` | 163 | 167 |
| 164 | 168 | This is helpful if there's a part of the codebase that you didn't work on. | 165 | 169 |
| 166 | | -:::tip | 167 | | -Use the `@` key to fuzzy search for files in the project. | 168 | | -::: | 169 | | - | 170 | 170 | --- | 171 | 171 |
| 172 | 172 | ### Add features | @@ -238,7 +238,7 @@ You can ask opencode to add new features to your project. Though we first recomm | 238 | 238 | For more straightforward changes, you can ask opencode to directly build it | 239 | 239 | without having to review the plan first. | 240 | 240 |
| 241 | | -```txt frame="none" | | 241 | +```txt frame="none" "@packages/functions/src/settings.ts" "@packages/functions/src/notes.ts" | 242 | 242 | We need to add authentication to the /settings route. Take a look at how this is | 243 | 243 | handled in the /notes route in @packages/functions/src/notes.ts and implement | 244 | 244 | the same logic in @packages/functions/src/settings.ts | @@ -253,7 +253,7 @@ changes. | 253 | 253 |
| 254 | 254 | Let's say you ask opencode to make some changes. | 255 | 255 |
| 256 | | -```txt frame="none" | | 256 | +```txt frame="none" "@packages/functions/src/api/index.ts" | 257 | 257 | Can you refactor the function in @packages/functions/src/api/index.ts? | 258 | 258 | ``` | 259 | 259 |
| @@ -267,7 +267,7 @@ using the `/undo` command. | 267 | 267 | opencode will now revert the changes you made and show your original message | 268 | 268 | again. | 269 | 269 |
| 270 | | -```txt frame="none" | | 270 | +```txt frame="none" "@packages/functions/src/api/index.ts" | 271 | 271 | Can you refactor the function in @packages/functions/src/api/index.ts? | 272 | 272 | ``` | 273 | 273 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/web/src/content/docs/docs/providers.mdx -2Lines changed: 0 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -614,8 +614,6 @@ In this example: | 614 | 614 |
| 615 | 615 | ### OpenAI | 616 | 616 |
| 617 | | -https://platform.openai.com/api-keys | 618 | | -
| 619 | 617 | 1. Head over to the [OpenAI Platform console](https://platform.openai.com/api-keys), click **Create new secret key**, and copy the key. | 620 | 618 |
| 621 | 619 | 2. Run `opencode auth login` and select OpenAI. | |
|