|
| 1 | +# Assistant Mode |
| 2 | + |
| 3 | +Assistant Mode gives OpenCode Manager a dedicated AI workspace — an isolated directory (`repos/assistant/`) where a built-in assistant agent can manage scheduled jobs, send push notifications, and read or update settings via a secure internal API. |
| 4 | + |
| 5 | +## What Is Assistant Mode? |
| 6 | + |
| 7 | +The assistant workspace is a special repository-like directory managed and maintained by OpenCode Manager. When initialized it contains: |
| 8 | + |
| 9 | +| File | Purpose | |
| 10 | +|------|---------| |
| 11 | +| `AGENTS.md` | Workspace description the agent reads on every session start | |
| 12 | +| `opencode.json` | OpenCode configuration scoped to the assistant agent | |
| 13 | +| `.opencode/internal-token` | Bearer token used to authenticate against the internal API | |
| 14 | +| `.opencode/agents/assistant.md` | Agent definition with system prompt and permissions | |
| 15 | +| `.opencode/skills/` | Auto-generated skills teaching the agent to use the internal API | |
| 16 | + |
| 17 | +## Skills Provided |
| 18 | + |
| 19 | +Four skills are provisioned automatically when assistant mode is initialized: |
| 20 | + |
| 21 | +| Skill | What it teaches | |
| 22 | +|-------|----------------| |
| 23 | +| `schedule-management` | Create, list, update, delete, and run scheduled jobs | |
| 24 | +| `notifications` | Send push notifications to registered user devices | |
| 25 | +| `manager-settings` | Read and patch user preferences | |
| 26 | +| `repo-management` | List all managed repositories | |
| 27 | + |
| 28 | +See [Assistant Internal API](assistant-internal-api.md) for the full API reference these skills expose. |
| 29 | + |
| 30 | +## Getting Started |
| 31 | + |
| 32 | +1. Click **Assistant** in the sidebar or mobile tab bar |
| 33 | +2. On first visit, OpenCode Manager initializes the workspace and creates a new session |
| 34 | +3. A welcome prompt is automatically sent to orient the agent |
| 35 | +4. Subsequent visits resume the most recent session |
| 36 | + |
| 37 | +No manual setup is required. The workspace directory and all managed files are created automatically. |
| 38 | + |
| 39 | +## Session Views |
| 40 | + |
| 41 | +The assistant page works in two modes: |
| 42 | + |
| 43 | +| Mode | URL | What you see | |
| 44 | +|------|-----|-------------| |
| 45 | +| Redirect | `/assistant` | Instantly redirects to the last session or creates one | |
| 46 | +| Session list | `/assistant?view=sessions` | Full session history with sidebar panels | |
| 47 | + |
| 48 | +The session list exposes the same management panels as regular repos — file browser, MCP servers, skills, source control, and permissions reset. |
| 49 | + |
| 50 | +## Workspace Initialization |
| 51 | + |
| 52 | +The workspace is initialized idempotently. Managed files are only rewritten when OpenCode Manager has updated their content. User customizations to managed files are preserved. |
| 53 | + |
| 54 | +### Warnings |
| 55 | + |
| 56 | +If a managed file was modified after initialization, the next session will receive an inline prompt explaining which files were preserved and what the expected content is. This surfaces configuration drift without silently overwriting your changes. |
| 57 | + |
| 58 | +### Re-initializing |
| 59 | + |
| 60 | +To re-apply all managed files to their latest defaults: |
| 61 | + |
| 62 | +1. Navigate to the session list (`?view=sessions`) |
| 63 | +2. Open the **Permissions** panel |
| 64 | +3. Use the reset action to re-initialize the workspace |
0 commit comments