mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
docs(cli): document ! bash commands and session persistence in CLI docs
This commit is contained in:
@@ -95,6 +95,30 @@ Here are all available slash commands:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### Bash commands
|
||||||
|
|
||||||
|
Start a line with `!` to run a shell command. The output is added to the conversation as a tool result.
|
||||||
|
|
||||||
|
```bash frame="none"
|
||||||
|
!ls -la
|
||||||
|
```
|
||||||
|
|
||||||
|
Commands run in your session's working directory and share state across runs. Environment variables and directory changes persist while the session is open.
|
||||||
|
|
||||||
|
```bash frame="none"
|
||||||
|
!export FOO=bar
|
||||||
|
!echo $FOO
|
||||||
|
```
|
||||||
|
|
||||||
|
Chain commands with `&&` or `;`, and quote paths with spaces. Use absolute paths when possible for reliability.
|
||||||
|
|
||||||
|
```bash frame="none"
|
||||||
|
!npm install && npm test
|
||||||
|
!python "/path/with spaces/script.py"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### Editor setup
|
### Editor setup
|
||||||
|
|
||||||
Both the `/editor` and `/export` commands use the editor specified in your `EDITOR` environment variable.
|
Both the `/editor` and `/export` commands use the editor specified in your `EDITOR` environment variable.
|
||||||
@@ -233,7 +257,7 @@ opencode github run
|
|||||||
##### Flags
|
##### Flags
|
||||||
|
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
| --------- | ------------------------------------------------ |
|
| --------- | -------------------------------------- |
|
||||||
| `--event` | GitHub mock event to run the agent for |
|
| `--event` | GitHub mock event to run the agent for |
|
||||||
| `--token` | GitHub personal access token |
|
| `--token` | GitHub personal access token |
|
||||||
|
|
||||||
@@ -290,7 +314,7 @@ This starts an HTTP server that provides API access to opencode functionality wi
|
|||||||
#### Flags
|
#### Flags
|
||||||
|
|
||||||
| Flag | Short | Description |
|
| Flag | Short | Description |
|
||||||
| ------------ | ----- | ------------------------------------------ |
|
| ------------ | ----- | --------------------- |
|
||||||
| `--port` | `-p` | Port to listen on |
|
| `--port` | `-p` | Port to listen on |
|
||||||
| `--hostname` | `-h` | Hostname to listen on |
|
| `--hostname` | `-h` | Hostname to listen on |
|
||||||
|
|
||||||
@@ -319,7 +343,7 @@ opencode upgrade v0.1.48
|
|||||||
#### Flags
|
#### Flags
|
||||||
|
|
||||||
| Flag | Short | Description |
|
| Flag | Short | Description |
|
||||||
| ---------- | ----- | --------------------------------------------------------- |
|
| ---------- | ----- | ----------------------------------------------------------------- |
|
||||||
| `--method` | `-m` | The installation method that was used; curl, npm, pnpm, bun, brew |
|
| `--method` | `-m` | The installation method that was used; curl, npm, pnpm, bun, brew |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user