Selaa lähdekoodia

docs: add env vars sections

Aiden Cline 2 kuukautta sitten
vanhempi
sitoutus
b93614cb81
2 muutettua tiedostoa jossa 37 lisäystä ja 1 poistoa
  1. 0 1
      packages/opencode/src/flag/flag.ts
  2. 37 0
      packages/web/src/content/docs/cli.mdx

+ 0 - 1
packages/opencode/src/flag/flag.ts

@@ -18,7 +18,6 @@ export namespace Flag {
   export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL")
   export const OPENCODE_EXPERIMENTAL_ICON_DISCOVERY =
     OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY")
-  export const OPENCODE_EXPERIMENTAL_WATCHER = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_WATCHER")
   export const OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT = truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT")
   export const OPENCODE_ENABLE_EXA =
     truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA")

+ 37 - 0
packages/web/src/content/docs/cli.mdx

@@ -269,3 +269,40 @@ The opencode CLI takes the following global flags.
 | `--version`    | `-v`  | Print version number                 |
 | `--print-logs` |       | Print logs to stderr                 |
 | `--log-level`  |       | Log level (DEBUG, INFO, WARN, ERROR) |
+
+---
+
+## Environment variables
+
+OpenCode can be configured using environment variables.
+
+| Variable                              | Type    | Description                            |
+| ------------------------------------- | ------- | -------------------------------------- |
+| `OPENCODE_AUTO_SHARE`                 | boolean | Automatically share sessions           |
+| `OPENCODE_GIT_BASH_PATH`              | string  | Path to Git Bash executable on Windows |
+| `OPENCODE_CONFIG`                     | string  | Path to config file                    |
+| `OPENCODE_CONFIG_DIR`                 | string  | Path to config directory               |
+| `OPENCODE_CONFIG_CONTENT`             | string  | Inline json config content             |
+| `OPENCODE_DISABLE_AUTOUPDATE`         | boolean | Disable automatic update checks        |
+| `OPENCODE_DISABLE_PRUNE`              | boolean | Disable pruning of old data            |
+| `OPENCODE_PERMISSION`                 | string  | Inlined json permissions config        |
+| `OPENCODE_DISABLE_DEFAULT_PLUGINS`    | boolean | Disable default plugins                |
+| `OPENCODE_DISABLE_LSP_DOWNLOAD`       | boolean | Disable automatic LSP server downloads |
+| `OPENCODE_ENABLE_EXPERIMENTAL_MODELS` | boolean | Enable experimental models             |
+| `OPENCODE_DISABLE_AUTOCOMPACT`        | boolean | Disable automatic context compaction   |
+| `OPENCODE_CLIENT`                     | string  | Client identifier (defaults to `cli`)  |
+| `OPENCODE_ENABLE_EXA`                 | boolean | Enable Exa web search tools            |
+
+---
+
+### Experimental
+
+These environment variables enable experimental features that may change or be removed.
+
+| Variable                                        | Type    | Description                             |
+| ----------------------------------------------- | ------- | --------------------------------------- |
+| `OPENCODE_EXPERIMENTAL`                         | boolean | Enable all experimental features        |
+| `OPENCODE_EXPERIMENTAL_ICON_DISCOVERY`          | boolean | Enable icon discovery                   |
+| `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT`  | boolean | Disable copy on select in TUI           |
+| `OPENCODE_EXPERIMENTAL_BASH_MAX_OUTPUT_LENGTH`  | number  | Max output length for bash commands     |
+| `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` | number  | Default timeout for bash commands in ms |