### Install Dependencies and Start Development Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/desktop/README.md
Install project dependencies using Bun and then start the development server.
```bash
bun install
bun dev
```
--------------------------------
### Install Mintlify CLI and Start Dev Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/quickstart.mdx
Install the Mintlify CLI globally and then run the development server in your project directory. Open http://localhost:3000 to view your live documentation. Changes are automatically updated.
```bash
npm i -g mint
mint dev
```
--------------------------------
### Starting am
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/TUTORIAL.md
Run the 'am' command to start the application after installation.
```bash
am
```
--------------------------------
### Clone and Run Project Locally
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Clone the repository, navigate into the project directory, install dependencies, and start the development server.
```bash
git clone https://github.com/n0facearia/n0face-opencode-fork.git
cd n0face-opencode-fork
bun install
bun dev
```
--------------------------------
### Install opencode GitHub Action
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/github/README.md
Run this command in your GitHub repository's terminal to initiate the installation process for the opencode GitHub Action. It guides you through app installation, workflow creation, and secret setup.
```bash
opencode github install
```
--------------------------------
### Manual Install (Full Fork)
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/TUTORIAL.md
Clone the repository, navigate to the opencode package, install Bun, and then install dependencies and build the project.
```bash
git clone https://github.com/n0facearia/n0face-opencode-fork.git
cd n0face-opencode-fork/packages/opencode
npm i -g bun
bun install
bun run build
```
--------------------------------
### Mintlify Tabs Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/ai-tools/cursor.mdx
Shows how to use tabs to present alternative content, such as installation commands for different operating systems (macOS, Windows, Linux).
```Tabs
```bash
brew install node
npm install -g package-name
```
```powershell
choco install nodejs
npm install -g package-name
```
```bash
sudo apt install nodejs npm
npm install -g package-name
```
```
--------------------------------
### Install OpenCode with curl
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Use this command to install OpenCode using a curl script. This is the easiest way to get started.
```bash
curl -fsSL https://opencode.ai/install | bash
```
--------------------------------
### Install SDK
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/sdk.mdx
Install the opencode SDK from npm. This is the first step to using the SDK in your project.
```bash
npm install @opencode-ai/sdk
```
--------------------------------
### Run a Specific Prompt
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Provides a direct example of running a prompt to get an explanation.
```bash
opencode run Explain the use of context in Go
```
--------------------------------
### Install OpenCode with Bun
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode globally using Bun. Ensure you have Bun installed.
```bash
bun install -g opencode-ai
```
--------------------------------
### Start Web App Dev Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Starts the web application development server.
```bash
bun dev:web
```
--------------------------------
### One-command Install AM
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Downloads a prebuilt binary for Linux/macOS, adds it to your PATH, and installs mode configurations. Ensure you have Bun 1.3+ and Git installed.
```bash
curl -fsSL https://raw.githubusercontent.com/n0facearia/n0face-opencode-fork/main/install.sh | bash
```
--------------------------------
### Start Electron Desktop App
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Starts the Electron desktop application development server.
```bash
bun dev:desktop
```
--------------------------------
### Install Script Execution Output
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/TUTORIAL.md
This output shows the execution of the install script, including dependency installation and build process. It highlights potential issues like duplicate keys in bun.lock and build errors.
```bash
bash: line 10: BASH_SOURCE[0]: unbound variable
bash: line 10: cd: null directory
┌─ AM Installer ──────────────────────────────────────────┐
│ │
│ Installs AM CLI + 10-mode agent system: │
│ manager, design, frontend, backend, database, │
│ cleanup, security, testing, devops, documentation │
└──────────────────────────────────────────────────────────┘
Building AM from source...
git: git version 2.54.0
bun: 1.3.14
Cloning repository...
Cloning into '/tmp/tmp.notuJNv7UX'...
remote: Enumerating objects: 5558, done.
remote: Counting objects: 100% (5558/5558), done.
remote: Compressing objects: 100% (4627/4627), done.
remote: Total 5558 (delta 761), reused 4602 (delta 737), pack-reused 0 (from 0)
Receiving objects: 100% (5558/5558), 50.75 MiB | 291.00 KiB/s, done.
Resolving deltas: 761/761, done.
Installing dependencies...
bun install v1.3.14 (0d9b296a)
522 | "packages/plugin": {
^
warn: Duplicate key "packages/plugin" in object literal
at bun.lock:522:5
574 | "packages/sdk/js": {
^
warn: Duplicate key "packages/sdk/js" in object literal
at bun.lock:574:5
494 | "packages/plugin": {
^
error: Duplicate workspace name: '@am-ai/plugin'
at bun.lock:494:5
InvalidWorkspaceObject: failed to parse lockfile: 'bun.lock'
warn: Ignoring lockfile
warn: incorrect peer dependency "@stripe/stripe-js@8.6.1"
warn: incorrect peer dependency "react@18.2.0"
warn: incorrect peer dependency "react-dom@18.2.0"
warn: incorrect peer dependency "solid-js@1.9.10"
warn: incorrect peer dependency "effect@4.0.0-beta.66"
+ @actions/artifact@5.0.1
+ @tsconfig/bun@1.0.9
+ @types/mime-types@3.0.1
+ @typescript/native-preview@7.0.0-dev.20251207.1
+ glob@13.0.5 (v13.0.6 available)
+ husky@9.1.7
+ oxlint@1.60.0 (v1.67.0 available)
+ oxlint-tsgolint@0.21.0 (v0.23.0 available)
+ prettier@3.6.2 (v3.8.3 available)
+ semver@7.8.1
+ sst@3.18.10 (v4.14.3 available)
+ turbo@2.8.13 (v2.9.15 available)
+ @aws-sdk/client-s3@3.933.0 (v3.1053.0 available)
+ heap-snapshot-toolkit@1.1.3
+ typescript@5.8.2 (v6.0.3 available)
4570 packages installed [351.06s]
Building binary (may take a few minutes)...
$ bun run script/build.ts --single --skip-install
opencode script {
"channel": "main",
"version": "0.0.0-main-202605311303",
"preview": true,
"release": false,
"team": [
"adamdotdevin",
"Brendonovich",
"fwang",
"Hona",
"iamdavidhill",
"jayair",
"jlongster",
"kitlangton",
"kommander",
"MrMushrooooom",
"nexxeln",
"R44VC0RP",
"rekram1-node",
"thdxr",
"simonklee",
"vimtor",
"actions-user",
"opencode",
"opencode-agent[bot]"
]
}
Generated models-snapshot.js
Loaded 20 migrations
Building Web UI to embed in the binary
$ vite build
vite v7.1.4 building for production...
transforming...
✓ 20 modules transformed.
✗ Build failed in 939ms
error during build:
[@tailwindcss/vite:generate:build] Can't resolve '@opencode-ai/ui/styles/tailwind' in '/tmp/tmp.notuJNv7UX/packages/app/src'
file: /tmp/tmp.notuJNv7UX/packages/app/src/index.css
at finishWithoutResolve (/tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/Resolver.js:942:18)
at /tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/Resolver.js:1034:14
at /tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/Resolver.js:1111:5
at eval (eval at create (/tmp/tmp.notuJNv7UX/node_modules/.bun/tapable@2.3.3/node_modules/tapable/lib/HookCodeFactory.js:31:10), :15:1)
at /tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/Resolver.js:1111:5
at eval (eval at create (/tmp/tmp.notuJNv7UX/node_modules/.bun/tapable@2.3.3/node_modules/tapable/lib/HookCodeFactory.js:31:10), :27:1)
at /tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:94:43
at /tmp/tmp.notuJNv7UX/node_modules/.bun/enhanced-resolve@5.22.0/node_modules/enhanced-resolve/lib/Resolver.js:1111:5
```
--------------------------------
### Start Headless OpenCode Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Use the 'serve' command to start a headless OpenCode server for API access. Set OPENCODE_SERVER_PASSWORD for basic authentication.
```bash
opencode serve
```
--------------------------------
### Mintlify Request Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/ai-tools/cursor.mdx
Provides an example of a cURL request using the RequestExample component.
```bash
curl -X POST 'https://api.example.com/users' \
-H 'Content-Type: application/json' \
-d '{"name": "John Doe", "email": "john@example.com"}'
```
--------------------------------
### Install OpenCode with Mise
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode using Mise by specifying the GitHub repository.
```bash
mise use -g github:n0facearia/n0face-opencode-fork
```
--------------------------------
### Install OpenCode with Yarn
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode globally using Yarn. Ensure you have Yarn installed.
```bash
yarn global add opencode-ai
```
--------------------------------
### Install OpenCode with npm
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode globally using npm. Ensure you have Node.js installed.
```bash
npm install -g opencode-ai
```
--------------------------------
### Manual Install AM from Source
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Clones the full fork repository, installs dependencies using Bun, and builds the project. This method includes TUI customizations.
```bash
git clone https://github.com/n0facearia/n0face-opencode-fork.git
cd n0face-opencode-fork/packages/opencode
bun install
bun run build
```
--------------------------------
### Start OpenCode Web Interface
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Start an OpenCode server with a web interface. This command opens a browser for access. Set OPENCODE_SERVER_PASSWORD for basic authentication.
```bash
opencode web
```
--------------------------------
### Install Dependencies
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/app/README.md
Install project dependencies using npm, pnpm, or yarn.
```bash
$ npm install # or pnpm install or yarn install
```
--------------------------------
### Install Dependencies with Bun
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/README.md
Use this command to install project dependencies when using Bun.
```bash
bun install
```
--------------------------------
### Install OpenCode with Scoop on Windows
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode on Windows using the Scoop package manager.
```bash
scoop install opencode
```
--------------------------------
### opencode.json Configuration Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/core/src/plugin/skill/customize-opencode.md
This is a comprehensive example of the opencode.json configuration file, illustrating various settings for models, agents, skills, references, commands, providers, plugins, and permissions.
```json
{
"$schema": "https://opencode.ai/config.json",
"username": "string",
"model": "provider/model-id",
"small_model": "provider/model-id",
"default_agent": "agent-name",
"shell": "/bin/zsh",
"logLevel": "DEBUG" | "INFO" | "WARN" | "ERROR",
"share": "manual" | "auto" | "disabled",
"autoupdate": true | false | "notify",
"snapshot": true,
"instructions": ["AGENTS.md", "docs/style.md"],
"skills": {
"paths": [".opencode/skills", "/abs/path/to/skills"],
"urls": ["https://example.com/.well-known/skills/"]
},
"references": {
"docs": {
"path": "../docs",
"description": "Use for product behavior and documentation conventions"
},
"sdk": {
"repository": "owner/sdk",
"branch": "main",
"description": "Use for SDK implementation details",
"hidden": true
}
},
"agent": {
"my-agent": {
"model": "anthropic/claude-sonnet-4-6",
"mode": "subagent",
"description": "...",
"permission": { "edit": "deny" }
}
},
"command": {
"deploy": { "description": "...", "prompt": "..." }
},
"provider": {
"anthropic": { "options": { "apiKey": "..." } }
},
"disabled_providers": ["openai"],
"enabled_providers": ["anthropic"],
"mcp": {
"playwright": {
"type": "local",
"command": ["npx", "-y", "@playwright/mcp"],
"enabled": true,
"env": {}
},
"remote-thing": {
"type": "remote",
"url": "https://...",
"headers": { "Authorization": "Bearer ..." }
}
},
"plugin": [
"opencode-gemini-auth",
"opencode-foo@1.2.3",
"./local-plugin.ts",
["opencode-bar", { "option": "value" }]
],
"permission": {
"edit": "deny",
"bash": { "git *": "allow", "*": "ask" }
},
"formatter": false,
"lsp": false,
"experimental": {
"primary_tools": ["edit"],
"mcp_timeout": 30000
},
"tool_output": { "max_lines": 200, "max_bytes": 8192 },
"compaction": { "auto": true, "tail_turns": 15 }
}
```
--------------------------------
### Start OpenCode TUI with hostname flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and specifies the hostname to listen on.
```bash
opencode --hostname
```
--------------------------------
### Install Plugin with OpenCode CLI
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Use this command to install a plugin and update your configuration. You can also use the 'plug' alias.
```bash
opencode plugin
```
```bash
opencode plug
```
--------------------------------
### SKILL.md Frontmatter Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/core/src/plugin/skill/customize-opencode.md
Example of the frontmatter for a SKILL.md file, including required 'name' and 'description' fields, along with optional metadata.
```markdown
---
name: my-skill
description: One sentence covering what this skill does AND when to trigger it. Front-load the literal keywords or filenames the user is likely to say.
---
# My Skill
(skill body in markdown: instructions, examples, references)
```
--------------------------------
### Setting Up a New Project
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/TUTORIAL.md
Navigate to your project directory and use the '/new-project' command within 'am' to set up a new project, providing details like name, type, and stack.
```bash
cd ~/my-new-project
am
```
```bash
/new-project
```
--------------------------------
### TUI Configuration Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/config.mdx
Example of a tui.json file for customizing the TUI experience. Settings like scroll speed, acceleration, diff style, and mouse support can be configured.
```json
{
"$schema": "https://opencode.ai/tui.json",
"scroll_speed": 3,
"scroll_acceleration": {
"enabled": true
},
"diff_style": "auto",
"mouse": true
}
```
--------------------------------
### Setup Virtual Framebuffer for Headless Linux Environments
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/troubleshooting.mdx
In headless Linux environments, use 'xvfb' to simulate a display server for copy/paste functionality. This involves installing xvfb, starting a virtual display, and setting the DISPLAY environment variable.
```bash
apt install -y xvfb
# and run:
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:99.0
```
--------------------------------
### GET /api/fs/tree Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/specs/v2/api.html
This example demonstrates how to retrieve a directory tree using the GET /api/fs/tree endpoint. It shows how to specify the path, directory, and an optional workspace.
```http
GET /api/fs/tree?path=.&directory=/repo/app&workspace=ws_123
```
--------------------------------
### GET /api/fs/tree
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/specs/v2/api.html
Browses the directory structure starting from a specified path.
```APIDOC
## GET /api/fs/tree
### Description
Browses the directory structure starting from a specified path.
### Method
GET
### Endpoint
/api/fs/tree
### Parameters
#### Query Parameters
- **path** (string) - Required - The path to the directory to browse.
### Purpose
Browse a directory.
```
--------------------------------
### Mintlify Steps Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/ai-tools/cursor.mdx
Demonstrates how to structure step-by-step instructions for procedures, including verification steps and warnings.
```Steps
Run `npm install` to install required packages.
Verify installation by running `npm list`.
Create a `.env` file with your API credentials.
```bash
API_KEY=your_api_key_here
```
Never commit API keys to version control.
```
--------------------------------
### Start Local Development Server on Custom Port
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/development.mdx
Customize the port Mintlify runs on by using the --port flag. This example starts the server on port 3333.
```bash
mint dev --port 3333
```
--------------------------------
### Start Local Development Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/README.md
Run the Mintlify development server from the root of your documentation project. This command requires a `docs.json` file to be present.
```bash
mint dev
```
--------------------------------
### Start SolidStart Development Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/console/app/README.md
Run `npm run dev` to start the development server. Use the `-- --open` flag to automatically open the application in your browser.
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
--------------------------------
### Prompt TUI for Codebase Summary
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/tui.mdx
Example of a text prompt to get a summary of the codebase from the TUI.
```text
Give me a quick summary of the codebase.
```
--------------------------------
### Initialize OpenCode for Project
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Run the /init command in your project's root directory to have OpenCode analyze the project and create an AGENTS.md file.
```bash
/init
```
--------------------------------
### E2E Testing Setup
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/app/README.md
Installs Playwright browsers and runs end-to-end tests locally. Supports filtering tests with a grep argument.
```bash
bunx playwright install chromium
bun run test:e2e:local
bun run test:e2e:local -- --grep "settings"
```
--------------------------------
### Prompt to Use 'mcp_everything' Tool
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/mcp-servers.mdx
Example prompt demonstrating how to invoke the 'mcp_everything' tool for a specific task.
```text
use the mcp_everything tool to add the number 3 and 4
```
--------------------------------
### Run Project with Bun
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/README.md
Execute your project's entry point using the Bun runtime.
```bash
bun run index.ts
```
--------------------------------
### Explain an Issue with opencode
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/github/README.md
Use this command in a GitHub issue comment to have opencode explain the entire issue thread. No specific setup is required beyond the initial installation.
```bash
/opencode explain this issue
```
--------------------------------
### Install OpenCode with pnpm
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode globally using pnpm. Ensure you have pnpm installed.
```bash
pnpm install -g opencode-ai
```
--------------------------------
### Moving Initialization Boundaries
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/specs/effect/todo.md
This task focuses on moving directory creation and `Flock` setup behind explicit initialization boundaries where feasible. This separates setup logic from core functionality.
```text
Move directory creation and `Flock` setup behind an explicit init boundary where possible.
```
--------------------------------
### Configuration with Mode Awareness
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/docs/audit/migration-plan.md
Example of a configuration file demonstrating mode awareness. It specifies the default mode, whether switching is allowed, and maps modes to their respective prompt files.
```json
// .am/am.jsonc
{
"mode": {
"default": "cleanup", // or "design", "security"
"allow_switch": true,
"prompts": {
"cleanup": ".am/cleanup.mode.md",
"design": ".am/design.mode.md",
"security": ".am/security.mode.md"
}
}
}
```
--------------------------------
### Verify Agents SDK Installation
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/test/fixture/skills/agents-sdk/SKILL.md
Check if the agents package is installed in your project. If not, install it using npm.
```bash
npm ls agents # Should show agents package
```
```bash
npm install agents
```
--------------------------------
### Example SKILL.md Frontmatter and Content
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/skills.mdx
This example demonstrates the required YAML frontmatter and Markdown content for a `SKILL.md` file, including name, description, license, compatibility, and metadata, along with a description of the skill's functionality and usage.
```markdown
---
name: git-release
description: Create consistent releases and changelogs
license: MIT
compatibility: opencode
metadata:
audience: maintainers
workflow: github
---
## What I do
- Draft release notes from merged PRs
- Propose a version bump
- Provide a copy-pasteable `gh release create` command
## When to use me
Use this when you are preparing a tagged release.
Ask clarifying questions if the target versioning scheme is unclear.
```
--------------------------------
### Quickstart: Auto Record/Replay
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/http-recorder/README.md
Use the cassetteLayer to automatically record traffic on the first run and replay on subsequent runs. In CI, it forces replay and fails loudly if cassettes are missing.
```typescript
import { Effect } from "effect"
import { HttpClient, HttpClientRequest } from "effect/unstable/http"
import { HttpRecorder } from "@opencode-ai/http-recorder"
const program = Effect.gen(function* () {
const http = yield* HttpClient.HttpClient
const response = yield* http.execute(HttpClientRequest.get("https://api.example.com/users/1"))
return yield* response.json
})
// Records if the cassette is missing, replays if it exists.
// In CI (CI=true) always replays — fails loudly on missing fixtures.
Effect.runPromise(program.pipe(Effect.provide(HttpRecorder.cassetteLayer("users/get-one"))))
```
--------------------------------
### One-command Uninstall AM
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/README.md
Removes AM installation using the install script with the --uninstall flag.
```bash
curl -fsSL https://raw.githubusercontent.com/n0facearia/n0face-opencode-fork/main/install.sh | bash -s -- --uninstall
```
--------------------------------
### Server Configuration Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/config.mdx
Example opencode.json snippet for configuring server settings. This includes port, hostname, mDNS discovery, and CORS origins for the 'opencode serve' and 'opencode web' commands.
```json
{
"$schema": "https://opencode.ai/config.json",
"server": {
"port": 4096,
"hostname": "0.0.0.0",
"mdns": true,
"mdnsDomain": "myproject.local",
"cors": ["http://localhost:5173"]
}
}
```
--------------------------------
### Run Development Server
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/app/README.md
Starts the application in development mode, accessible at http://localhost:3000.
```bash
npm run dev # or npm start
```
--------------------------------
### Example API Event Payload
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/specs/v2/api.html
An example payload for a message part delta event.
```JSON
{
"id": "evt_01",
"type": "message.part.delta",
"time": 1760000000000,
"context": {
"directory": "/repo/app",
"workspaceID": "ws_123"
},
"payload": {
"sessionID": "ses_123",
"messageID": "msg_456",
"partID": "part_789",
"field": "text",
"delta": "hello"
}
}
```
--------------------------------
### OpenAPI Configuration Examples
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/essentials/settings.mdx
Configure OpenAPI file paths for API documentation. Supports single or multiple URLs/paths.
```json
"openapi": "https://example.com/openapi.json"
```
```json
"openapi": "/openapi.json"
```
```json
"openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"]
```
--------------------------------
### Install opencode-helicone-session Plugin
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/providers.mdx
Install the Helicone session tracking plugin globally using npm.
```bash
npm install -g opencode-helicone-session
```
--------------------------------
### Initialize New Project
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/specs/project.md
Initializes a new project within OpenCode.
```HTTP
POST /project/init -> Project
```
--------------------------------
### Run OpenCode from WSL
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/windows-wsl.mdx
Navigate to your project directory within the WSL filesystem (e.g., /mnt/c/Users/YourName/project) and execute the 'opencode' command to start using it.
```bash
cd /mnt/c/Users/YourName/project
opencode
```
--------------------------------
### Install OpenCode with Chocolatey on Windows
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Install OpenCode on Windows using the Chocolatey package manager.
```bash
choco install opencode
```
--------------------------------
### Build and Package the Application
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/desktop/README.md
Build the application's JavaScript assets and then package them into a distributable application. The final application will be located in the 'dist/' directory.
```bash
bun run build && bun run package
```
--------------------------------
### Start OpenCode TUI for Specific Directory
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/tui.mdx
Start the OpenCode TUI for a specific working directory.
```bash
opencode /path/to/project
```
--------------------------------
### Create Opencode Instance
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/sdk.mdx
Create an instance of opencode, which starts both a server and a client. This is useful for local development or when you need a self-contained opencode environment.
```javascript
import { createOpencode } from "@opencode-ai/sdk"
const { client } = await createOpencode()
```
--------------------------------
### Create a New SolidStart Project
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/console/app/README.md
Use `npm init solid@latest` to create a new SolidStart project. You can initialize it in the current directory or specify a new directory name.
```bash
# create a new project in the current directory
npm init solid@latest
# create a new project in my-app
npm init solid@latest my-app
```
--------------------------------
### Start OpenCode TUI with port flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and specifies the port to listen on.
```bash
opencode --port
```
--------------------------------
### Start OpenCode TUI with agent flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and specifies an agent to use.
```bash
opencode --agent ""
```
--------------------------------
### Start OpenCode TUI with continue flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and continues the last session.
```bash
opencode --continue
```
--------------------------------
### Agent Configuration Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/specs/v2/config.md
An example of a detailed agent configuration, including model, variant, options, description, system prompt, mode, color, steps, and disabled status. Use this structure for defining custom agents.
```json
{
"agents": {
"reviewer": {
"model": "openrouter/openai/gpt-5",
"variant": "high",
"options": {
"headers": { "x-agent": "reviewer" },
"body": {},
"aisdk": { "provider": {}, "request": { "reasoningEffort": "high" } },
},
"description": "Review changes for correctness",
"system": "Find regressions and missing tests.",
"mode": "subagent",
"color": "warning",
"steps": 12,
"disabled": false,
}
}
}
```
--------------------------------
### YAML Frontmatter Example
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/docs/ai-tools/windsurf.mdx
Example of YAML frontmatter for MDX files, including title and description.
```yaml
---
title: "Clear, specific title"
description: "Concise description for SEO and navigation"
---
```
--------------------------------
### Start OpenCode TUI with prompt flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and specifies a custom prompt to use.
```bash
opencode --prompt ""
```
--------------------------------
### Navigate to Project Directory
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/index.mdx
Change your current directory to the root of the project you want to work on.
```bash
cd /path/to/project
```
--------------------------------
### Start Server in Background
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/src/session/prompt/gemini.txt
Demonstrates initiating a server process in the background using a bash tool call.
```text
user: start the server implemented in server.js
model: [tool_call: bash for 'node server.js &' because it must run in the background]
```
--------------------------------
### Programmatic ACP Server Start
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/opencode/src/acp/README.md
Start the ACP server programmatically by importing and calling the ACPServer.start() method.
```typescript
import { ACPServer } from "./acp/server"
await ACPServer.start()
```
--------------------------------
### Start OpenCode TUI with mDNS enabled
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI with mDNS discovery enabled for network services.
```bash
opencode --mdns
```
--------------------------------
### Start OpenCode Server in WSL for External Connections
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/windows-wsl.mdx
Start the OpenCode server in WSL, binding it to all network interfaces (0.0.0.0) on a specific port. This allows the desktop app to connect to the server running in WSL.
```bash
opencode serve --hostname 0.0.0.0 --port 4096
```
--------------------------------
### Start OpenCode TUI with session flag
Source: https://github.com/n0facearia/n0face-opencode-fork/blob/main/packages/web/src/content/docs/cli.mdx
Starts the OpenCode TUI and continues a specific session identified by its ID.
```bash
opencode --session
```