Skip to content

Commit fcfab08

Browse files
Update documentation and configuration for production deployment
- Fix documentation drift across README, AGENTS.md, and CONTRIBUTING.md - Update Docker configuration with process timing and OAuth env vars - Simplify shared env config by removing unused Redis and OpenCode API URL - Add skills documentation to navigation - Improve .env.example with clearer AUTH_SECRET instructions
1 parent 1e8b302 commit fcfab08

12 files changed

Lines changed: 131 additions & 46 deletions

File tree

‎.env.example‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ DEBUG=false
5959
# ============================================
6060
# Authentication (Better Auth)
6161
# ============================================
62-
# AUTH_SECRET is required for production deployments
63-
# Generate with: openssl rand -base64 32
64-
# AUTH_SECRET=your-secure-random-secret-here
62+
# AUTH_SECRET is required - generate with: openssl rand -base64 32
63+
AUTH_SECRET=CHANGE_ME_GENERATE_WITH_openssl_rand_base64_32
6564

6665
# Trusted origins for authentication (comma-separated)
6766
# Add your server's external URL when accessing remotely
@@ -120,6 +119,7 @@ PASSKEY_ORIGIN=http://localhost:5003
120119
# These are optional - frontend uses defaults if not set
121120
# ============================================
122121
# VITE_API_URL=http://localhost:5003
122+
# VITE_SERVER_PORT=5003
123123
# VITE_OPENCODE_PORT=5551
124124
# VITE_MAX_FILE_SIZE_MB=50
125125
# VITE_MAX_UPLOAD_SIZE_MB=50

‎.github/copilot-instructions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Technology Stack
44

55
- **Monorepo**: pnpm workspace with backend, frontend, and shared packages
6-
- **Backend**: Bun runtime + Hono framework + Better SQLite3
6+
- **Backend**: Bun runtime + Hono framework + Bun SQLite (bun:sqlite)
77
- **Frontend**: React 19 + Vite 7 + Radix UI + Tailwind CSS 4
88
- **Validation**: Zod schemas throughout
99
- **State**: React Query + Zustand

‎AGENTS.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## Commands
44

55
- `pnpm dev` - Start both backend (5003) and frontend (5173)
6-
- `pnpm dev:backend` - Backend only: `bun --watch backend/src/index.ts`
7-
- `pnpm dev:frontend` - Frontend only: `cd frontend && vite`
6+
- `pnpm dev:backend` - Backend only: `bun --watch-path backend/src --watch backend/src/index.ts`
7+
- `pnpm dev:frontend` - Frontend only: `pnpm --filter frontend dev`
88
- `pnpm build` - Build both backend and frontend
9-
- `pnpm test` - Run backend tests: `cd backend && bun test`
10-
- `cd backend && bun test <filename>` - Run single test file
9+
- `pnpm test` - Run backend tests: `pnpm --filter backend test` (vitest)
10+
- `cd backend && vitest <filename>` - Run single test file
1111
- `cd backend && vitest --ui` - Test UI with coverage
1212
- `cd backend && vitest --coverage` - Coverage report (80% threshold)
1313
- `pnpm lint` - Lint both backend and frontend
@@ -23,7 +23,7 @@
2323

2424
### Backend (Bun + Hono)
2525

26-
- Hono framework with Zod validation, Better SQLite3 database
26+
- Hono framework with Zod validation, Bun SQLite (bun:sqlite) database
2727
- Error handling with try/catch and structured logging
2828
- Follow existing route/service/utility structure
2929
- Use async/await consistently, avoid .then() chains

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Thanks for your interest in contributing! This guide covers our workflow and how
77
1. Fork the repository
88
2. Clone your fork locally
99

10-
See the [README](README.md#option-2-local-development-contributors) for detailed setup instructions.
10+
See the [Development Setup Guide](docs/development/setup.md) for detailed setup instructions.
1111

1212
## Project Board Workflow
1313

@@ -58,7 +58,7 @@ Each item is tagged with a theme to help you find work in your area of interest:
5858
### Backend (Bun + Hono)
5959

6060
- Hono framework with Zod validation
61-
- Better SQLite3 for database
61+
- Bun SQLite (bun:sqlite) for database
6262
- Proper error handling with try/catch
6363
- Use async/await consistently
6464

@@ -73,7 +73,7 @@ Each item is tagged with a theme to help you find work in your area of interest:
7373

7474
```bash
7575
pnpm test # Run all backend tests
76-
cd backend && bun test <filename> # Run single test file
76+
cd backend && vitest <filename> # Run single test file
7777
```
7878

7979
### Linting

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
git clone https://github.com/chriswritescode-dev/opencode-manager.git
3333
cd opencode-manager
3434
cp .env.example .env
35+
echo "AUTH_SECRET=$(openssl rand -base64 32)" >> .env
3536
docker-compose up -d
3637
# Open http://localhost:5003
3738
```

‎docs/configuration/docker.md‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,40 @@ services:
3737
dockerfile: Dockerfile
3838
container_name: opencode-manager
3939
ports:
40-
- "5003:5003" # OpenCode Manager
41-
- "5100:5100" # Dev server 1
42-
- "5101:5101" # Dev server 2
43-
- "5102:5102" # Dev server 3
44-
- "5103:5103" # Dev server 4
40+
- "5003:5003"
41+
- "5100:5100"
42+
- "5101:5101"
43+
- "5102:5102"
44+
- "5103:5103"
4545
environment:
4646
- NODE_ENV=${NODE_ENV:-production}
4747
- HOST=0.0.0.0
4848
- PORT=5003
4949
- OPENCODE_SERVER_PORT=5551
5050
- DATABASE_PATH=/app/data/opencode.db
5151
- WORKSPACE_PATH=/workspace
52+
- PROCESS_START_WAIT_MS=2000
53+
- PROCESS_VERIFY_WAIT_MS=1000
54+
- HEALTH_CHECK_INTERVAL_MS=5000
55+
- HEALTH_CHECK_TIMEOUT_MS=30000
56+
- MAX_FILE_SIZE_MB=50
57+
- MAX_UPLOAD_SIZE_MB=50
58+
- DEBUG=false
5259
- AUTH_SECRET=${AUTH_SECRET}
5360
- AUTH_TRUSTED_ORIGINS=${AUTH_TRUSTED_ORIGINS:-http://localhost:5003}
5461
- ADMIN_EMAIL=${ADMIN_EMAIL:-}
5562
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
56-
# OAuth providers (optional)
63+
- ADMIN_PASSWORD_RESET=${ADMIN_PASSWORD_RESET:-false}
5764
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:-}
5865
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-}
59-
# Passkeys (optional)
66+
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID:-}
67+
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET:-}
68+
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID:-}
69+
- DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET:-}
70+
- AUTH_SECURE_COOKIES=${AUTH_SECURE_COOKIES:-false}
6071
- PASSKEY_RP_ID=${PASSKEY_RP_ID:-localhost}
6172
- PASSKEY_RP_NAME=${PASSKEY_RP_NAME:-OpenCode Manager}
6273
- PASSKEY_ORIGIN=${PASSKEY_ORIGIN:-http://localhost:5003}
63-
# Push notifications (optional)
6474
- VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY:-}
6575
- VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY:-}
6676
- VAPID_SUBJECT=${VAPID_SUBJECT:-}
@@ -112,8 +122,8 @@ VAPID_SUBJECT=mailto:you@example.com
112122

113123
The container entrypoint (`scripts/docker-entrypoint.sh`) automatically:
114124

115-
1. **Installs Bun** if not present
116-
2. **Installs OpenCode** if not present
125+
1. **Verifies Bun** is installed (installed at build time, fallback install if missing)
126+
2. **Verifies OpenCode** is installed (installed at build time, fallback install if missing)
117127
3. **Upgrades OpenCode** if below minimum version (1.0.137)
118128
4. **Validates AUTH_SECRET** is set (required for startup)
119129
5. **Validates memory plugin** installation

‎docs/development/setup.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Guide for setting up a local development environment.
66

77
- [pnpm](https://pnpm.io/installation) - Package manager (required for workspaces)
88
- [Bun](https://bun.sh) - Backend runtime
9-
- [OpenCode TUI](https://opencode.ai) - `npm install -g @opencode/tui`
9+
- [OpenCode TUI](https://opencode.ai) - `curl -fsSL https://opencode.ai/install | bash`
1010

1111
## Installation
1212

‎docs/features/memory.md‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ The plugin is composed of several subsystems that work together:
167167

168168
### Storage Layer
169169

170-
The plugin uses a single SQLite database in WAL mode with four tables:
170+
The plugin uses a single SQLite database in WAL mode with three tables:
171171

172172
| Table | Purpose |
173173
|-------|---------|
@@ -304,7 +304,7 @@ When deduplication triggers, the existing memory's ID is returned instead of cre
304304

305305
## Tools
306306

307-
The plugin registers seventeen tools that the AI agent can call:
307+
The plugin registers twelve tools that the AI agent can call:
308308

309309
### memory-read
310310

@@ -416,16 +416,6 @@ Retrieve a value by key for the current project.
416416

417417
Returns the stored value (formatted as JSON if applicable) or a message indicating the key was not found.
418418

419-
### memory-kv-delete
420-
421-
Delete a key-value pair for the current project.
422-
423-
| Parameter | Type | Required | Description |
424-
|-----------|------|----------|-------------|
425-
| `key` | string | Yes | The key to delete |
426-
427-
Returns confirmation that the key was deleted.
428-
429419
### memory-kv-list
430420

431421
List all active key-value pairs for the current project.

‎docs/features/skills.md‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Skills
2+
3+
Skills are reusable instruction sets that provide domain-specific workflows and guidance to OpenCode AI agents. They are stored as `SKILL.md` files and can be scoped globally or per-project.
4+
5+
## Scopes
6+
7+
| Scope | Location | Description |
8+
|-------|----------|-------------|
9+
| **Global** | `<workspace>/.config/opencode/skills/<name>/SKILL.md` | Available across all repositories |
10+
| **Project** | `<repo>/.opencode/skills/<name>/SKILL.md` | Scoped to a specific repository |
11+
12+
## Skill File Format
13+
14+
Each skill is a `SKILL.md` file with YAML frontmatter and a markdown body:
15+
16+
```markdown
17+
---
18+
name: my-skill
19+
description: Short description of what this skill does
20+
license: MIT
21+
compatibility: opencode >= 1.0
22+
metadata:
23+
author: your-name
24+
version: 1.0.0
25+
---
26+
Your skill instructions go here. This is the content that gets
27+
injected into the AI agent's context when the skill is loaded.
28+
```
29+
30+
### Frontmatter Fields
31+
32+
| Field | Required | Description |
33+
|-------|----------|-------------|
34+
| `name` | Yes | Lowercase alphanumeric with hyphens (e.g., `my-skill`). Max 64 characters. |
35+
| `description` | Yes | What the skill does. Max 1024 characters. |
36+
| `license` | No | License identifier (e.g., `MIT`) |
37+
| `compatibility` | No | Version compatibility note |
38+
| `metadata` | No | Key-value pairs for additional context |
39+
40+
### Naming Rules
41+
42+
Skill names must match the pattern `^[a-z0-9]+(-[a-z0-9]+)*$`:
43+
44+
- Lowercase letters and numbers only
45+
- Hyphens allowed between words
46+
- No spaces, underscores, or uppercase letters
47+
- Examples: `test-skill`, `code-review`, `deploy-helper`
48+
49+
## Managing Skills
50+
51+
Skills are managed through the Settings UI under the Skills section, or via the API.
52+
53+
### API Endpoints
54+
55+
All endpoints are under `/api/settings/skills`.
56+
57+
| Method | Path | Description |
58+
|--------|------|-------------|
59+
| `GET` | `/skills` | List all skills (optional `?repoId=` filter) |
60+
| `GET` | `/skills/:name` | Get a specific skill (requires `scope` query param, optional `repoId`) |
61+
| `POST` | `/skills` | Create a new skill |
62+
| `PUT` | `/skills/:name` | Update an existing skill (requires `scope` query param, optional `repoId`) |
63+
| `DELETE` | `/skills/:name` | Delete a skill (requires `scope` query param, optional `repoId`) |
64+
65+
### Create Request
66+
67+
```json
68+
{
69+
"name": "my-skill",
70+
"description": "Runs type check and lint",
71+
"body": "Instructions for the AI agent...",
72+
"scope": "global",
73+
"license": "MIT",
74+
"compatibility": "opencode >= 1.0",
75+
"metadata": { "author": "your-name" },
76+
"repoId": 1
77+
}
78+
```
79+
80+
`repoId` is required when `scope` is `"project"`.
81+
82+
### Update Request
83+
84+
All fields are optional. Set a field to `null` to clear it.
85+
86+
```json
87+
{
88+
"description": "Updated description",
89+
"body": "Updated instructions",
90+
"license": null
91+
}
92+
```

‎docs/index.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Mobile-first web interface for [OpenCode](https://opencode.ai) AI agents. Manage
1010
```bash
1111
git clone https://github.com/chriswritescode-dev/opencode-manager.git
1212
cd opencode-manager
13+
cp .env.example .env
14+
echo "AUTH_SECRET=$(openssl rand -base64 32)" >> .env
1315
docker-compose up -d
1416
```
1517

0 commit comments

Comments
 (0)