cli.mdx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. ---
  2. title: CLI
  3. description: OpenCode CLI options and commands.
  4. ---
  5. import { Tabs, TabItem } from "@astrojs/starlight/components"
  6. The OpenCode CLI by default starts the [TUI](/docs/tui) when run without any arguments.
  7. ```bash
  8. opencode
  9. ```
  10. But it also accepts commands as documented on this page. This allows you to interact with OpenCode programmatically.
  11. ```bash
  12. opencode run "Explain how closures work in JavaScript"
  13. ```
  14. ---
  15. ### tui
  16. Start the OpenCode terminal user interface.
  17. ```bash
  18. opencode [project]
  19. ```
  20. #### Flags
  21. | Flag | Short | Description |
  22. | ------------------------------------------- | ----- | ----------------------------------------------------------------------- |
  23. | <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
  24. | <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
  25. | <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
  26. | <nobr><code>{"--prompt"}</code></nobr> | | Prompt to use |
  27. | <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use in the form of provider/model |
  28. | <nobr><code>{"--agent"}</code></nobr> | | Agent to use |
  29. | <nobr><code>{"--port"}</code></nobr> | | Port to listen on |
  30. | <nobr><code>{"--hostname"}</code></nobr> | | Hostname to listen on |
  31. | <nobr><code>{"--mdns"}</code></nobr> | | Enable mDNS discovery |
  32. | <nobr><code>{"--mdns-domain"}</code></nobr> | | Custom mDNS domain name |
  33. | <nobr><code>{"--cors"}</code></nobr> | | Additional browser origin(s) to allow CORS |
  34. ---
  35. ## Commands
  36. The OpenCode CLI also has the following commands.
  37. ---
  38. ### agent
  39. Manage agents for OpenCode.
  40. ```bash
  41. opencode agent [command]
  42. ```
  43. ---
  44. #### create
  45. Create a new agent with custom configuration.
  46. ```bash
  47. opencode agent create
  48. ```
  49. This command will guide you through creating a new agent with a custom system prompt and permission configuration. Anything you don't allow is denied in the generated agent's frontmatter.
  50. #### Flags
  51. | Flag | Short | Description |
  52. | ------------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  53. | <nobr><code>{"--path"}</code></nobr> | | Directory to write the agent file to (defaults to global or `.opencode/agent` based on the prompt) |
  54. | <nobr><code>{"--description"}</code></nobr> | | What the agent should do |
  55. | <nobr><code>{"--mode"}</code></nobr> | | Agent mode: `all`, `primary`, or `subagent` |
  56. | <nobr><code>{"--permissions"}</code></nobr> | | Comma-separated list of permissions to allow (default: all). Available: `bash`, `read`, `edit`, `glob`, `grep`, `webfetch`, `task`, `todowrite`, `websearch`, `lsp`, `skill`. Anything omitted is denied. Alias: `--tools` |
  57. | <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use, in `provider/model` format |
  58. Passing all of `--path`, `--description`, `--mode`, and `--permissions` runs the command non-interactively.
  59. ---
  60. #### list
  61. List all available agents.
  62. ```bash
  63. opencode agent list
  64. ```
  65. ---
  66. ### attach
  67. Attach a terminal to an already running OpenCode backend server started via `serve` or `web` commands.
  68. ```bash
  69. opencode attach [url]
  70. ```
  71. This allows using the TUI with a remote OpenCode backend. For example:
  72. ```bash
  73. # Start the backend server for web/mobile access
  74. opencode web --port 4096 --hostname 0.0.0.0
  75. # In another terminal, attach the TUI to the running backend
  76. opencode attach http://10.20.30.40:4096
  77. ```
  78. #### Flags
  79. | Flag | Short | Description |
  80. | ---------------------------------------- | ----- | -------------------------------------------------------------------------- |
  81. | <nobr><code>{"--dir"}</code></nobr> | | Working directory to start TUI in |
  82. | <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
  83. | <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
  84. | <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
  85. | <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
  86. | <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
  87. ---
  88. ### auth
  89. Command to manage credentials and login for providers.
  90. ```bash
  91. opencode auth [command]
  92. ```
  93. ---
  94. #### login
  95. OpenCode is powered by the provider list at [Models.dev](https://models.dev), so you can use `opencode auth login` to configure API keys for any provider you'd like to use. This is stored in `~/.local/share/opencode/auth.json`.
  96. ```bash
  97. opencode auth login
  98. ```
  99. When OpenCode starts up it loads the providers from the credentials file. And if there are any keys defined in your environments or a `.env` file in your project.
  100. ##### Flags
  101. | Flag | Short | Description |
  102. | ---------------------------------------- | ----- | ---------------------------------------------------- |
  103. | <nobr><code>{"--provider"}</code></nobr> | `-p` | Provider ID or name to log in to |
  104. | <nobr><code>{"--method"}</code></nobr> | `-m` | Login method label to use, skipping method selection |
  105. ---
  106. #### list
  107. Lists all the authenticated providers as stored in the credentials file.
  108. ```bash
  109. opencode auth list
  110. ```
  111. Or the short version.
  112. ```bash
  113. opencode auth ls
  114. ```
  115. ---
  116. #### logout
  117. Logs you out of a provider by clearing it from the credentials file.
  118. ```bash
  119. opencode auth logout
  120. ```
  121. ---
  122. ### github
  123. Manage the GitHub agent for repository automation.
  124. ```bash
  125. opencode github [command]
  126. ```
  127. ---
  128. #### install
  129. Install the GitHub agent in your repository.
  130. ```bash
  131. opencode github install
  132. ```
  133. This sets up the necessary GitHub Actions workflow and guides you through the configuration process. [Learn more](/docs/github).
  134. ---
  135. #### run
  136. Run the GitHub agent. This is typically used in GitHub Actions.
  137. ```bash
  138. opencode github run
  139. ```
  140. ##### Flags
  141. | Flag | Description |
  142. | ------------------------------------- | -------------------------------------- |
  143. | <nobr><code>{"--event"}</code></nobr> | GitHub mock event to run the agent for |
  144. | <nobr><code>{"--token"}</code></nobr> | GitHub personal access token |
  145. ---
  146. ### mcp
  147. Manage Model Context Protocol servers.
  148. ```bash
  149. opencode mcp [command]
  150. ```
  151. ---
  152. #### add
  153. Add an MCP server to your configuration.
  154. ```bash
  155. opencode mcp add
  156. ```
  157. This command will guide you through adding either a local or remote MCP server.
  158. ---
  159. #### list
  160. List all configured MCP servers and their connection status.
  161. ```bash
  162. opencode mcp list
  163. ```
  164. Or use the short version.
  165. ```bash
  166. opencode mcp ls
  167. ```
  168. ---
  169. #### auth
  170. Authenticate with an OAuth-enabled MCP server.
  171. ```bash
  172. opencode mcp auth [name]
  173. ```
  174. If you don't provide a server name, you'll be prompted to select from available OAuth-capable servers.
  175. You can also list OAuth-capable servers and their authentication status.
  176. ```bash
  177. opencode mcp auth list
  178. ```
  179. Or use the short version.
  180. ```bash
  181. opencode mcp auth ls
  182. ```
  183. ---
  184. #### logout
  185. Remove OAuth credentials for an MCP server.
  186. ```bash
  187. opencode mcp logout [name]
  188. ```
  189. ---
  190. #### debug
  191. Debug OAuth connection issues for an MCP server.
  192. ```bash
  193. opencode mcp debug <name>
  194. ```
  195. ---
  196. ### models
  197. List all available models from configured providers.
  198. ```bash
  199. opencode models [provider]
  200. ```
  201. This command displays all models available across your configured providers in the format `provider/model`.
  202. This is useful for figuring out the exact model name to use in [your config](/docs/config/).
  203. You can optionally pass a provider ID to filter models by that provider.
  204. ```bash
  205. opencode models anthropic
  206. ```
  207. #### Flags
  208. | Flag | Description |
  209. | --------------------------------------- | ------------------------------------------------------------ |
  210. | <nobr><code>{"--refresh"}</code></nobr> | Refresh the models cache from models.dev |
  211. | <nobr><code>{"--verbose"}</code></nobr> | Use more verbose model output (includes metadata like costs) |
  212. Use the `--refresh` flag to update the cached model list. This is useful when new models have been added to a provider and you want to see them in OpenCode.
  213. ```bash
  214. opencode models --refresh
  215. ```
  216. ---
  217. ### run
  218. Run opencode in non-interactive mode by passing a prompt directly.
  219. ```bash
  220. opencode run [message..]
  221. ```
  222. This is useful for scripting, automation, or when you want a quick answer without launching the full TUI. For example.
  223. ```bash "opencode run"
  224. opencode run Explain the use of context in Go
  225. ```
  226. You can also attach to a running `opencode serve` instance to avoid MCP server cold boot times on every run:
  227. ```bash
  228. # Start a headless server in one terminal
  229. opencode serve
  230. # In another terminal, run commands that attach to it
  231. opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
  232. ```
  233. #### Flags
  234. | Flag | Short | Description |
  235. | ------------------------------------------------------------ | ----- | -------------------------------------------------------------------------- |
  236. | <nobr><code>{"--command"}</code></nobr> | | The command to run, use message for args |
  237. | <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
  238. | <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
  239. | <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
  240. | <nobr><code>{"--share"}</code></nobr> | | Share the session |
  241. | <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use in the form of provider/model |
  242. | <nobr><code>{"--agent"}</code></nobr> | | Agent to use |
  243. | <nobr><code>{"--file"}</code></nobr> | `-f` | File(s) to attach to message |
  244. | <nobr><code>{"--format"}</code></nobr> | | Format: default (formatted) or json (raw JSON events) |
  245. | <nobr><code>{"--title"}</code></nobr> | | Title for the session (uses truncated prompt if no value provided) |
  246. | <nobr><code>{"--attach"}</code></nobr> | | Attach to a running opencode server (e.g., http://localhost:4096) |
  247. | <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
  248. | <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
  249. | <nobr><code>{"--dir"}</code></nobr> | | Directory to run in, or path on the remote server when attaching |
  250. | <nobr><code>{"--port"}</code></nobr> | | Port for the local server (defaults to random port) |
  251. | <nobr><code>{"--variant"}</code></nobr> | | Model variant (provider-specific reasoning effort) |
  252. | <nobr><code>{"--thinking"}</code></nobr> | | Show thinking blocks |
  253. | <nobr><code>{"--dangerously-skip-permissions"}</code></nobr> | | Auto-approve permissions that are not explicitly denied (dangerous!) |
  254. ---
  255. ### serve
  256. Start a headless OpenCode server for API access. Check out the [server docs](/docs/server) for the full HTTP interface.
  257. ```bash
  258. opencode serve
  259. ```
  260. This starts an HTTP server that provides API access to opencode functionality without the TUI interface. Set `OPENCODE_SERVER_PASSWORD` to enable HTTP basic auth (username defaults to `opencode`).
  261. #### Flags
  262. | Flag | Description |
  263. | ------------------------------------------- | ------------------------------------------ |
  264. | <nobr><code>{"--port"}</code></nobr> | Port to listen on |
  265. | <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
  266. | <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
  267. | <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
  268. | <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
  269. ---
  270. ### session
  271. Manage OpenCode sessions.
  272. ```bash
  273. opencode session [command]
  274. ```
  275. ---
  276. #### list
  277. List all OpenCode sessions.
  278. ```bash
  279. opencode session list
  280. ```
  281. ##### Flags
  282. | Flag | Short | Description |
  283. | ----------------------------------------- | ----- | ------------------------------------ |
  284. | <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limit to N most recent sessions |
  285. | <nobr><code>{"--format"}</code></nobr> | | Output format: table or json (table) |
  286. ---
  287. #### delete
  288. Delete an OpenCode session.
  289. ```bash
  290. opencode session delete <sessionID>
  291. ```
  292. ---
  293. ### stats
  294. Show token usage and cost statistics for your OpenCode sessions.
  295. ```bash
  296. opencode stats
  297. ```
  298. #### Flags
  299. | Flag | Description |
  300. | --------------------------------------- | --------------------------------------------------------------------------- |
  301. | <nobr><code>{"--days"}</code></nobr> | Show stats for the last N days (all time) |
  302. | <nobr><code>{"--tools"}</code></nobr> | Number of tools to show (all) |
  303. | <nobr><code>{"--models"}</code></nobr> | Show model usage breakdown (hidden by default). Pass a number to show top N |
  304. | <nobr><code>{"--project"}</code></nobr> | Filter by project (all projects, empty string: current project) |
  305. ---
  306. ### export
  307. Export session data as JSON.
  308. ```bash
  309. opencode export [sessionID]
  310. ```
  311. If you don't provide a session ID, you'll be prompted to select from available sessions.
  312. #### Flags
  313. | Flag | Description |
  314. | ---------------------------------------- | ------------------------------------- |
  315. | <nobr><code>{"--sanitize"}</code></nobr> | Redact sensitive transcript/file data |
  316. ---
  317. ### import
  318. Import session data from a JSON file or OpenCode share URL.
  319. ```bash
  320. opencode import <file>
  321. ```
  322. You can import from a local file or an OpenCode share URL.
  323. ```bash
  324. opencode import session.json
  325. opencode import https://opncd.ai/s/abc123
  326. ```
  327. ---
  328. ### web
  329. Start a headless OpenCode server with a web interface.
  330. ```bash
  331. opencode web
  332. ```
  333. This starts an HTTP server and opens a web browser to access OpenCode through a web interface. Set `OPENCODE_SERVER_PASSWORD` to enable HTTP basic auth (username defaults to `opencode`).
  334. #### Flags
  335. | Flag | Description |
  336. | ------------------------------------------- | ------------------------------------------ |
  337. | <nobr><code>{"--port"}</code></nobr> | Port to listen on |
  338. | <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
  339. | <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
  340. | <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
  341. | <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
  342. ---
  343. ### acp
  344. Start an ACP (Agent Client Protocol) server.
  345. ```bash
  346. opencode acp
  347. ```
  348. This command starts an ACP server that communicates via stdin/stdout using nd-JSON.
  349. #### Flags
  350. | Flag | Description |
  351. | ------------------------------------------- | ------------------------------------------ |
  352. | <nobr><code>{"--cwd"}</code></nobr> | Working directory |
  353. | <nobr><code>{"--port"}</code></nobr> | Port to listen on |
  354. | <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
  355. | <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
  356. | <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
  357. | <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
  358. ---
  359. ### plugin
  360. Install a plugin and update your config.
  361. ```bash
  362. opencode plugin <module>
  363. ```
  364. Or use the alias.
  365. ```bash
  366. opencode plug <module>
  367. ```
  368. #### Flags
  369. | Flag | Short | Description |
  370. | -------------------------------------- | ----- | ------------------------------- |
  371. | <nobr><code>{"--global"}</code></nobr> | `-g` | Install in global config |
  372. | <nobr><code>{"--force"}</code></nobr> | `-f` | Replace existing plugin version |
  373. ---
  374. ### pr
  375. Fetch and checkout a GitHub PR branch, then run OpenCode.
  376. ```bash
  377. opencode pr <number>
  378. ```
  379. ---
  380. ### db
  381. Database tools.
  382. ```bash
  383. opencode db [query]
  384. ```
  385. #### Flags
  386. | Flag | Description |
  387. | -------------------------------------- | ------------------------------ |
  388. | <nobr><code>{"--format"}</code></nobr> | Output format: `json` or `tsv` |
  389. ---
  390. #### path
  391. Print the database path.
  392. ```bash
  393. opencode db path
  394. ```
  395. ---
  396. ### debug
  397. Debugging and troubleshooting tools.
  398. ```bash
  399. opencode debug [command]
  400. ```
  401. ---
  402. ### uninstall
  403. Uninstall OpenCode and remove all related files.
  404. ```bash
  405. opencode uninstall
  406. ```
  407. #### Flags
  408. | Flag | Short | Description |
  409. | ------------------------------------------- | ----- | ------------------------------------------- |
  410. | <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Keep configuration files |
  411. | <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Keep session data and snapshots |
  412. | <nobr><code>{"--dry-run"}</code></nobr> | | Show what would be removed without removing |
  413. | <nobr><code>{"--force"}</code></nobr> | `-f` | Skip confirmation prompts |
  414. ---
  415. ### upgrade
  416. Updates opencode to the latest version or a specific version.
  417. ```bash
  418. opencode upgrade [target]
  419. ```
  420. To upgrade to the latest version.
  421. ```bash
  422. opencode upgrade
  423. ```
  424. To upgrade to a specific version.
  425. ```bash
  426. opencode upgrade v0.1.48
  427. ```
  428. #### Flags
  429. | Flag | Short | Description |
  430. | -------------------------------------- | ----- | ----------------------------------------------------------------- |
  431. | <nobr><code>{"--method"}</code></nobr> | `-m` | The installation method that was used; curl, npm, pnpm, bun, brew |
  432. ---
  433. ## Global Flags
  434. The opencode CLI takes the following global flags.
  435. | Flag | Short | Description |
  436. | ------------------------------------------ | ----- | ------------------------------------ |
  437. | <nobr><code>{"--help"}</code></nobr> | `-h` | Display help |
  438. | <nobr><code>{"--version"}</code></nobr> | `-v` | Print version number |
  439. | <nobr><code>{"--print-logs"}</code></nobr> | | Print logs to stderr |
  440. | <nobr><code>{"--log-level"}</code></nobr> | | Log level (DEBUG, INFO, WARN, ERROR) |
  441. | <nobr><code>{"--pure"}</code></nobr> | | Run without external plugins |
  442. ---
  443. ## Environment variables
  444. OpenCode can be configured using environment variables.
  445. | Variable | Type | Description |
  446. | ------------------------------------- | ------- | ------------------------------------------------- |
  447. | `OPENCODE_AUTO_SHARE` | boolean | Automatically share sessions |
  448. | `OPENCODE_GIT_BASH_PATH` | string | Path to Git Bash executable on Windows |
  449. | `OPENCODE_CONFIG` | string | Path to config file |
  450. | `OPENCODE_TUI_CONFIG` | string | Path to TUI config file |
  451. | `OPENCODE_CONFIG_DIR` | string | Path to config directory |
  452. | `OPENCODE_CONFIG_CONTENT` | string | Inline json config content |
  453. | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Disable automatic update checks |
  454. | `OPENCODE_DISABLE_PRUNE` | boolean | Disable pruning of old data |
  455. | `OPENCODE_DISABLE_TERMINAL_TITLE` | boolean | Disable automatic terminal title updates |
  456. | `OPENCODE_PERMISSION` | string | Inlined json permissions config |
  457. | `OPENCODE_DISABLE_DEFAULT_PLUGINS` | boolean | Disable default plugins |
  458. | `OPENCODE_DISABLE_LSP_DOWNLOAD` | boolean | Disable automatic LSP server downloads |
  459. | `OPENCODE_ENABLE_EXPERIMENTAL_MODELS` | boolean | Enable experimental models |
  460. | `OPENCODE_DISABLE_AUTOCOMPACT` | boolean | Disable automatic context compaction |
  461. | `OPENCODE_DISABLE_CLAUDE_CODE` | boolean | Disable reading from `.claude` (prompt + skills) |
  462. | `OPENCODE_DISABLE_CLAUDE_CODE_PROMPT` | boolean | Disable reading `~/.claude/CLAUDE.md` |
  463. | `OPENCODE_DISABLE_CLAUDE_CODE_SKILLS` | boolean | Disable loading `.claude/skills` |
  464. | `OPENCODE_DISABLE_MODELS_FETCH` | boolean | Disable fetching models from remote sources |
  465. | `OPENCODE_DISABLE_MOUSE` | boolean | Disable mouse capture in the TUI |
  466. | `OPENCODE_FAKE_VCS` | string | Fake VCS provider for testing purposes |
  467. | `OPENCODE_CLIENT` | string | Client identifier (defaults to `cli`) |
  468. | `OPENCODE_ENABLE_EXA` | boolean | Enable Exa web search tools |
  469. | `OPENCODE_SERVER_PASSWORD` | string | Enable basic auth for `serve`/`web` |
  470. | `OPENCODE_SERVER_USERNAME` | string | Override basic auth username (default `opencode`) |
  471. | `OPENCODE_MODELS_URL` | string | Custom URL for fetching models configuration |
  472. ---
  473. ### Experimental
  474. These environment variables enable experimental features that may change or be removed.
  475. | Variable | Type | Description |
  476. | ----------------------------------------------- | ------- | --------------------------------------- |
  477. | `OPENCODE_EXPERIMENTAL` | boolean | Enable the experimental umbrella flag |
  478. | `OPENCODE_EXPERIMENTAL_ICON_DISCOVERY` | boolean | Enable icon discovery |
  479. | `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT` | boolean | Disable copy on select in TUI |
  480. | `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` | number | Default timeout for bash commands in ms |
  481. | `OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX` | number | Max output tokens for LLM responses |
  482. | `OPENCODE_EXPERIMENTAL_FILEWATCHER` | boolean | Enable file watcher for entire dir |
  483. | `OPENCODE_EXPERIMENTAL_OXFMT` | boolean | Enable oxfmt formatter |
  484. | `OPENCODE_EXPERIMENTAL_LSP_TOOL` | boolean | Enable experimental LSP tool |
  485. | `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER` | boolean | Disable file watcher |
  486. | `OPENCODE_EXPERIMENTAL_EXA` | boolean | Enable experimental Exa features |
  487. | `OPENCODE_EXPERIMENTAL_LSP_TY` | boolean | Enable TY LSP for python files |
  488. | `OPENCODE_EXPERIMENTAL_PLAN_MODE` | boolean | Enable plan mode |
  489. | `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` | boolean | Enable background subagent tasks |
  490. | `OPENCODE_EXPERIMENTAL_EVENT_SYSTEM` | boolean | Enable experimental event system |
  491. | `OPENCODE_EXPERIMENTAL_NATIVE_LLM` | boolean | Enable native LLM request path |
  492. | `OPENCODE_EXPERIMENTAL_PARALLEL` | boolean | Enable parallel web search execution |
  493. | `OPENCODE_EXPERIMENTAL_SCOUT` | boolean | Enable Scout subagent |
  494. | `OPENCODE_EXPERIMENTAL_WORKSPACES` | boolean | Enable workspace support |