Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ echo '{"message":"hi"}' | agent
opencode:

```bash
echo '{"message":"hi"}' | opencode run --format json --model opencode/grok-code
echo '{"message":"hi"}' | opencode run --format json --model opencode/gpt-5-nano
```

### Plain Text Input (@link-assistant/agent only)
Expand All @@ -60,7 +60,7 @@ echo '{"message":"hello world"}' | agent
**opencode:**

```bash
echo '{"message":"hello world"}' | opencode run --format json --model opencode/grok-code
echo '{"message":"hello world"}' | opencode run --format json --model opencode/gpt-5-nano
```

## File Operations
Expand All @@ -78,7 +78,7 @@ echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo
**opencode:**

```bash
echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo hello world"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo hello world"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

**Example with description:**
Expand All @@ -100,7 +100,7 @@ echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/pat
**opencode:**

```bash
echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/path/to/file.txt"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/path/to/file.txt"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### write Tool
Expand All @@ -116,7 +116,7 @@ echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/t
**opencode:**

```bash
echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/tmp/test.txt","content":"Hello World"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/tmp/test.txt","content":"Hello World"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### edit Tool
Expand All @@ -132,7 +132,7 @@ echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp
**opencode:**

```bash
echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp/test.txt","old_string":"Hello","new_string":"Hi"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp/test.txt","old_string":"Hello","new_string":"Hi"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### list Tool
Expand All @@ -148,7 +148,7 @@ echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}
**opencode:**

```bash
echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

## Search Tools
Expand All @@ -170,7 +170,7 @@ echo '{"message":"find ts files","tools":[{"name":"glob","params":{"pattern":"sr
**opencode:**

```bash
echo '{"message":"find js files","tools":[{"name":"glob","params":{"pattern":"**/*.js"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"find js files","tools":[{"name":"glob","params":{"pattern":"**/*.js"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### grep Tool
Expand All @@ -193,7 +193,7 @@ echo '{"message":"search error","tools":[{"name":"grep","params":{"pattern":"err
**opencode:**

```bash
echo '{"message":"search pattern","tools":[{"name":"grep","params":{"pattern":"TODO","output_mode":"content"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search pattern","tools":[{"name":"grep","params":{"pattern":"TODO","output_mode":"content"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### websearch Tool
Expand All @@ -211,7 +211,7 @@ echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"Re
**opencode (requires OPENCODE_EXPERIMENTAL_EXA=true):**

```bash
echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"TypeScript latest features"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"TypeScript latest features"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### codesearch Tool
Expand All @@ -229,7 +229,7 @@ echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"
**opencode (requires OPENCODE_EXPERIMENTAL_EXA=true):**

```bash
echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"React hooks implementation"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"React hooks implementation"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

## Execution Tools
Expand All @@ -252,7 +252,7 @@ mkdir -p .link-assistant-agent
echo '{"experimental":{"batch_tool":true}}' > .link-assistant-agent/opencode.json

# Then run
echo '{"message":"run batch","tools":[{"name":"batch","params":{"tool_calls":[{"tool":"bash","parameters":{"command":"echo hello"}},{"tool":"bash","parameters":{"command":"echo world"}}]}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"run batch","tools":[{"name":"batch","params":{"tool_calls":[{"tool":"bash","parameters":{"command":"echo hello"}},{"tool":"bash","parameters":{"command":"echo world"}}]}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### task Tool
Expand All @@ -268,7 +268,7 @@ echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"
**opencode:**

```bash
echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"Analyze codebase","prompt":"Find all TODO comments in JavaScript files","subagent_type":"general-purpose"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"Analyze codebase","prompt":"Find all TODO comments in JavaScript files","subagent_type":"general-purpose"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

## Utility Tools
Expand All @@ -290,7 +290,7 @@ echo '{"message":"read todos","tools":[{"name":"todoread","params":{}}]}' | agen
**opencode:**

```bash
echo '{"message":"add todos","tools":[{"name":"todowrite","params":{"todos":[{"content":"Implement feature X","status":"pending","activeForm":"Implementing feature X"}]}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"add todos","tools":[{"name":"todowrite","params":{"todos":[{"content":"Implement feature X","status":"pending","activeForm":"Implementing feature X"}]}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

### webfetch Tool
Expand All @@ -306,7 +306,7 @@ echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https:
**opencode:**

```bash
echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https://example.com","prompt":"Summarize the content"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https://example.com","prompt":"Summarize the content"}}]}' | opencode run --format json --model opencode/gpt-5-nano
```

## Output Format
Expand Down
14 changes: 7 additions & 7 deletions MODELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This agent supports multiple model providers. By default, it uses models from th
All models are accessed using the format `<provider>/<model-id>`. Use the `--model` option to specify which model to use:

```bash
echo "hi" | agent --model opencode/grok-code
echo "hi" | agent --model opencode/gpt-5-nano
```

## OpenCode Zen Pricing
Expand All @@ -28,9 +28,10 @@ Below are the prices per 1M tokens for OpenCode Zen models. Models are sorted by
| Model | Model ID | Input | Output | Cached Read | Cached Write |
| ---------------------------------------- | --------------------------- | ------ | ------ | ----------- | ------------ |
| **Free Models (Output: $0.00)** |
| Grok Code Fast 1 | `opencode/grok-code` | Free | Free | Free | - |
| GPT 5 Nano | `opencode/gpt-5-nano` | Free | Free | Free | - |
| Big Pickle | `opencode/big-pickle` | Free | Free | Free | - |
| **Discontinued Free Models** |
| ~~Grok Code Fast 1~~ | `opencode/grok-code` | ~~Free~~ | ~~Free~~ | ~~Free~~ | - |
| **Paid Models (sorted by output price)** |
| Qwen3 Coder 480B | `opencode/qwen3-coder-480b` | $0.45 | $1.50 | - | - |
| GLM 4.6 | `opencode/glm-4-6` | $0.60 | $2.20 | $0.10 | - |
Expand All @@ -51,14 +52,16 @@ Below are the prices per 1M tokens for OpenCode Zen models. Models are sorted by

## Default Model

The default model is **Grok Code Fast 1** (`opencode/grok-code`), which is completely free. This model provides excellent performance for coding tasks with no cost.
The default model is **GPT 5 Nano** (`opencode/gpt-5-nano`), which is completely free. This model provides good performance for coding tasks with no cost.

> **Note:** Grok Code Fast 1 (`opencode/grok-code`) was previously the default free model, but xAI ended the free tier for this model on OpenCode Zen in January 2026. See [Case Study #133](docs/case-studies/issue-133/README.md) for details.

## Usage Examples

### Using the Default Model (Free)

```bash
# Uses opencode/grok-code by default
# Uses opencode/gpt-5-nano by default
echo "hello" | agent
```

Expand All @@ -67,9 +70,6 @@ echo "hello" | agent
```bash
# Big Pickle (free)
echo "hello" | agent --model opencode/big-pickle

# GPT 5 Nano (free)
echo "hello" | agent --model opencode/gpt-5-nano
```

### Using Paid Models
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ See [rust/README.md](rust/README.md) for full documentation.

We're creating a slimmed-down, public domain version of OpenCode CLI focused on the "agentic run mode" for use in virtual machines, Docker containers, and other environments where unrestricted AI agent access is acceptable. This is **not** for general desktop use - it's for isolated environments where you want maximum AI agent freedom.

**OpenCode Compatibility**: We maintain 100% compatibility with OpenCode's JSON event streaming format, so tools expecting `opencode run --format json --model opencode/grok-code` output will work with our agent-cli.
**OpenCode Compatibility**: We maintain 100% compatibility with OpenCode's JSON event streaming format, so tools expecting `opencode run --format json --model opencode/gpt-5-nano` output will work with our agent-cli.

## Features

Expand Down Expand Up @@ -92,7 +92,7 @@ echo '{"message":"hi"}' | agent
**With custom model:**

```bash
echo "hi" | agent --model opencode/grok-code
echo "hi" | agent --model opencode/gpt-5-nano
```

**Direct prompt mode:**
Expand Down
Loading