amicus 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/LICENSE +21 -0
- package/README.md +477 -0
- package/bin/amicus.js +382 -0
- package/electron/assets/icon.png +0 -0
- package/electron/assets/icon.svg +5 -0
- package/electron/fold.js +163 -0
- package/electron/ipc-setup.js +176 -0
- package/electron/load-failsafe.js +85 -0
- package/electron/main.js +468 -0
- package/electron/preload-setup.js +38 -0
- package/electron/preload.js +33 -0
- package/electron/setup-ui-alias-script.js +218 -0
- package/electron/setup-ui-aliases.js +85 -0
- package/electron/setup-ui-keys-script.js +115 -0
- package/electron/setup-ui-keys.js +97 -0
- package/electron/setup-ui-model.js +138 -0
- package/electron/setup-ui-styles.js +327 -0
- package/electron/setup-ui.js +465 -0
- package/electron/summary.js +118 -0
- package/electron/toolbar.js +229 -0
- package/electron/window-position.js +35 -0
- package/package.json +98 -0
- package/scripts/postinstall.js +193 -0
- package/scripts/setup-hooks.js +42 -0
- package/skill/SKILL.md +976 -0
- package/skills/second-opinion/COUNCIL-DESIGN.md +227 -0
- package/skills/second-opinion/MODEL-NOTES.md +104 -0
- package/skills/second-opinion/SKILL.md +389 -0
- package/src/cli-handlers.js +188 -0
- package/src/cli.js +400 -0
- package/src/conflict.js +144 -0
- package/src/context-compression.js +102 -0
- package/src/context.js +199 -0
- package/src/drift.js +144 -0
- package/src/environment.js +157 -0
- package/src/headless.js +742 -0
- package/src/index.js +106 -0
- package/src/jsonl-parser.js +180 -0
- package/src/mcp-server.js +625 -0
- package/src/mcp-tools.js +407 -0
- package/src/opencode-client.js +615 -0
- package/src/prompt-builder.js +355 -0
- package/src/prompts/cowork-agent-prompt.js +118 -0
- package/src/session-manager.js +414 -0
- package/src/session.js +180 -0
- package/src/sidecar/context-builder.js +297 -0
- package/src/sidecar/continue.js +212 -0
- package/src/sidecar/crash-handler.js +56 -0
- package/src/sidecar/fanout-leg.js +107 -0
- package/src/sidecar/fanout-output.js +46 -0
- package/src/sidecar/fanout.js +236 -0
- package/src/sidecar/interactive.js +217 -0
- package/src/sidecar/models.js +135 -0
- package/src/sidecar/progress.js +218 -0
- package/src/sidecar/read.js +183 -0
- package/src/sidecar/resume.js +221 -0
- package/src/sidecar/session-utils.js +288 -0
- package/src/sidecar/setup-window.js +79 -0
- package/src/sidecar/setup.js +280 -0
- package/src/sidecar/start.js +251 -0
- package/src/utils/agent-mapping.js +138 -0
- package/src/utils/alias-audit.js +98 -0
- package/src/utils/alias-resolver.js +77 -0
- package/src/utils/api-key-store.js +259 -0
- package/src/utils/api-key-validation.js +97 -0
- package/src/utils/auth-json.js +109 -0
- package/src/utils/config.js +291 -0
- package/src/utils/curated-models.js +82 -0
- package/src/utils/env-compat.js +38 -0
- package/src/utils/env-loader.js +54 -0
- package/src/utils/idle-watchdog.js +225 -0
- package/src/utils/input-validators.js +127 -0
- package/src/utils/lifecycle.js +43 -0
- package/src/utils/logger.js +84 -0
- package/src/utils/mcp-discovery.js +194 -0
- package/src/utils/mcp-validators.js +78 -0
- package/src/utils/model-catalog.js +103 -0
- package/src/utils/model-fetcher.js +179 -0
- package/src/utils/model-validator.js +207 -0
- package/src/utils/path-setup.js +41 -0
- package/src/utils/port-pid.js +39 -0
- package/src/utils/prompt-source.js +53 -0
- package/src/utils/result-schema.js +261 -0
- package/src/utils/server-setup.js +93 -0
- package/src/utils/session-abort.js +53 -0
- package/src/utils/session-lock.js +95 -0
- package/src/utils/shared-server.js +216 -0
- package/src/utils/start-helpers.js +76 -0
- package/src/utils/thinking-validators.js +92 -0
- package/src/utils/update-notifier-loader.js +18 -0
- package/src/utils/updater.js +157 -0
- package/src/utils/validators.js +300 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Amicus are documented here. Format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow semver.
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-06-10
|
|
9
|
+
|
|
10
|
+
Everything since the fork from upstream `claude-sidecar` v0.5.2 — the Amicus launch line.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **LLM Council** (`skills/second-opinion/`): structured multi-model review — independent
|
|
14
|
+
reviews, anonymized peer cross-review with street-cred scoring, non-Claude chair verdict,
|
|
15
|
+
tiered accept/deny decisions. v3 runs natively on the fanout/JSON engine primitives.
|
|
16
|
+
- **`amicus fanout`**: run N models on one prompt in parallel over a single shared engine
|
|
17
|
+
server; stable JSON wave output (`schemaVersion: 1`), exit codes 0/2/1.
|
|
18
|
+
- **`amicus models`**: live OpenRouter model catalog (TTL cache, keyless fetch) with search,
|
|
19
|
+
refresh, and alias auditing (`--check` suggests replacements for stale aliases). Model
|
|
20
|
+
validation on `start`/`fanout`/`continue`/`resume` (`--no-validate-model` to skip).
|
|
21
|
+
- **`--prompt-file`** (start/fanout): briefings from a file — no shell quoting, no Windows
|
|
22
|
+
~32 KB argument cap. **`--json`** structured output for `start` and `read`.
|
|
23
|
+
- **`amicus abort --all`**; searchable live model picker in the setup wizard; catalog seeding on
|
|
24
|
+
first-run setup; GUI load failsafe (`AMICUS_GUI_LOAD_TIMEOUT_MS`).
|
|
25
|
+
- Council ships in the npm package and installs to `~/.claude/skills/second-opinion/`
|
|
26
|
+
(MODEL-NOTES is seeded once and never overwritten — it's user data).
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- **Rebranded** `claude-sidecar` → `amicus` (bins `amicus`/`am`; MCP tools `amicus_*`; config
|
|
30
|
+
`~/.config/amicus`; env `AMICUS_*`). Every legacy `sidecar*` form still works as a deprecated
|
|
31
|
+
shim — see `docs/SHIMS.md`.
|
|
32
|
+
- Headless reliability: activity-aware completion (quiet tool-call gaps no longer end runs
|
|
33
|
+
early), absolute `--timeout` enforcement, OpenCode idle-status as authoritative completion,
|
|
34
|
+
dead-server fast-exit.
|
|
35
|
+
- Windows is first-class: the full unit suite is green on Windows 11; session-path encoding,
|
|
36
|
+
path-separator, and native-binary PATH bugs fixed; process lifecycle (abort/teardown) works
|
|
37
|
+
cross-platform.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- Orphaned sessions and zombie servers on abort (cross-platform PID capture + graceful
|
|
41
|
+
teardown with force-exit net); broken `codex`/`grok` aliases (validation now catches stale
|
|
42
|
+
aliases); update checks (ESM updater loading); session-dir gitignore leak.
|
|
43
|
+
|
|
44
|
+
### Attribution
|
|
45
|
+
Amicus is an independent MIT fork of [Claude Sidecar](https://github.com/jrenaldi79/sidecar)
|
|
46
|
+
by John Renaldi. See `LICENSE` and `NOTICE`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 John Renaldi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Amicus
|
|
4
|
+
|
|
5
|
+
**A multi-model LLM Council for Claude — with a parallel AI window underneath.**
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
Hand Claude a document and say *council review this*: Amicus routes it through several models from different families, has them anonymously cross-review each other, and a non-Claude chair synthesizes a verdict you turn into accept/deny edits. Or skip the ceremony and **fork** a single conversation to Gemini, GPT, DeepSeek, or any other model — it works in parallel with full context, and you **fold** the result back when you're ready. Claude orchestrates throughout; you stay in your editor.
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/amicus)
|
|
12
|
+
[](./LICENSE)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](./CONTRIBUTING.md)
|
|
15
|
+
|
|
16
|
+
> **Supported clients:** Claude Code CLI and Claude Cowork are fully tested and supported. Claude Code web and Claude Desktop are experimental.
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Table of Contents
|
|
23
|
+
|
|
24
|
+
- [What is Amicus](#what-is-amicus)
|
|
25
|
+
- [Quick start](#quick-start)
|
|
26
|
+
- [The Council](#the-council)
|
|
27
|
+
- [The parallel window](#the-parallel-window)
|
|
28
|
+
- [Commands](#commands)
|
|
29
|
+
- [Models](#models)
|
|
30
|
+
- [MCP integration](#mcp-integration)
|
|
31
|
+
- [Configuration](#configuration)
|
|
32
|
+
- [JSON output](#json-output)
|
|
33
|
+
- [Windows](#windows)
|
|
34
|
+
- [Troubleshooting](#troubleshooting)
|
|
35
|
+
- [Documentation](#documentation)
|
|
36
|
+
- [Contributing](#contributing)
|
|
37
|
+
- [Built on OpenCode](#built-on-opencode)
|
|
38
|
+
- [Attribution & License](#attribution--license)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## What is Amicus
|
|
43
|
+
|
|
44
|
+
One install delivers four things that work together:
|
|
45
|
+
|
|
46
|
+
- **The `second-opinion` LLM Council skill.** Structured multi-model review: independent reviews → anonymized peer cross-review → a non-Claude chair verdict → tiered accept/deny decisions. This is the hero.
|
|
47
|
+
- **The `sidecar` chat skill.** Ad-hoc fork/work/fold — spin up one other model in a real window (or headless), work alongside it, fold the summary back.
|
|
48
|
+
- **The `amicus` CLI (with an `am` alias) and an MCP server.** The engine underneath both skills: launches sessions, shares context, runs parallel waves, and exposes the same surface to Claude as MCP tools.
|
|
49
|
+
- **A self-updating model catalog.** Aliases and validation resolve against a live catalog fetched from provider APIs (cached locally), so model names stay current without a hard-coded table.
|
|
50
|
+
|
|
51
|
+
Claude is the orchestrator. The council and chat skills run *on top of* the engine; you talk to Claude, and Claude drives Amicus.
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
**Install:**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install -g amicus
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The postinstall step auto-configures everything — no manual registration:
|
|
66
|
+
|
|
67
|
+
- Registers the **MCP server** in Claude Code and in Claude Desktop / Cowork, so the Amicus tools appear natively.
|
|
68
|
+
- Installs **both skills** into `~/.claude/skills/` — `second-opinion` (the council) and `sidecar` (the chat skill).
|
|
69
|
+
|
|
70
|
+
**Configure:**
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
amicus setup
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This opens a graphical wizard:
|
|
77
|
+
|
|
78
|
+
| Step | What it does |
|
|
79
|
+
|------|--------------|
|
|
80
|
+
| **1. API Keys** | Enter keys for OpenRouter, Google, OpenAI, Anthropic, and/or DeepSeek. Each is validated live against the provider's API. Written to `~/.config/amicus/.env` with `0600` permissions. |
|
|
81
|
+
| **2. Default Model** | Pick your go-to model from a searchable live picker (backed by the catalog). Used whenever you omit `--model`. |
|
|
82
|
+
| **3. Model Routing** | Decide which provider serves each model — e.g. route Gemini through a direct Google key and everything else through OpenRouter. |
|
|
83
|
+
| **4. Review** | Confirm the configuration before saving. |
|
|
84
|
+
|
|
85
|
+
> **Headless environments:** if Electron can't open a window, the wizard falls back to a readline-based setup in the terminal.
|
|
86
|
+
|
|
87
|
+
**Your first council** — no flags to learn. In Claude Code or Cowork, give Claude a document and say:
|
|
88
|
+
|
|
89
|
+
> *council review this*
|
|
90
|
+
|
|
91
|
+
Claude prepares the material, recommends a bench of models, discloses the run shape and cost, and orchestrates the rest. You make the accept/deny calls at the end. (The `second-opinion` skill installed in the previous step is what teaches Claude to recognize this — if nothing happens, confirm it landed in `~/.claude/skills/second-opinion/`.)
|
|
92
|
+
|
|
93
|
+
**Your first sidecar.** The sidecar is the lower-level path — you can invoke it by phrase through Claude too, but the CLI gives you the flags directly:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
amicus start --model gemini --prompt "Fact-check the auth approach Claude just proposed"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A window opens alongside your editor with Gemini ready, pre-loaded with your conversation. Work with it, then **Fold** the summary back.
|
|
100
|
+
|
|
101
|
+
### Install from GitHub
|
|
102
|
+
|
|
103
|
+
The npm package is the primary path. To install straight from the repo instead (the postinstall runs identically — same MCP registration, same two skills):
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm install -g github:BourbonDog/amicus
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Contributor setup
|
|
110
|
+
|
|
111
|
+
Cloning to develop Amicus? See **[CONTRIBUTING.md](./CONTRIBUTING.md)** for the dev setup, git-hook wiring, and test commands.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## The Council
|
|
116
|
+
|
|
117
|
+
**Why multi-model.** Any single model — including the one running your session — has consistent blind spots. Route the *same* material through models from *different* families and the disagreements surface: missed issues, overstated confidence, claims one model alone would have waved through. The council is the structured version of that idea.
|
|
118
|
+
|
|
119
|
+
**The flow, in five beats:**
|
|
120
|
+
|
|
121
|
+
1. **Independent reviews.** Each council model reviews the artifact on its own (one parallel wave), producing a structured findings list — claim, severity (`blocker | major | minor | nit`), location, rationale.
|
|
122
|
+
2. **Anonymized cross-review.** Claude relabels every review (Review A, B, C…) and sends the identical bundle to every model. Each model ranks the reviews and adjudicates every finding (`agree | dispute | neutral`) — *unknowingly judging its own*, so self-bias washes out. This yields a **street-cred** ranking and sorts findings into **Confirmed / Contested / Singleton** tiers.
|
|
123
|
+
3. **Chair verdict.** A designated **non-Claude** chair receives the de-anonymized picture — all reviews, rankings, and adjudications — and synthesizes an independent verdict. Claude presents it verbatim; Claude does not synthesize.
|
|
124
|
+
4. **Tiered decisions.** Confirmed findings get one bulk accept/deny; Contested and Singleton findings are decided one at a time (accept / deny / modify).
|
|
125
|
+
5. **Outputs applied.** Accepted findings are written into a reviewed copy of the source; the full run is captured in the run folder.
|
|
126
|
+
|
|
127
|
+
**What a run produces** (in `output/<stem>-council/`):
|
|
128
|
+
|
|
129
|
+
- `review-<model>.md` × N — each model's independent review.
|
|
130
|
+
- `crossreview-matrix.md` — the adjudication grid plus the de-anonymized street-cred table.
|
|
131
|
+
- `verdict.md` — the chair's synthesis.
|
|
132
|
+
- `report.md` — synthesis + the full decision log + a per-call run-stats table.
|
|
133
|
+
- For an **editable source**, the accepted edits land in `<stem>-reviewed.<ext>` next to the original.
|
|
134
|
+
|
|
135
|
+
**Claude in the council** (default off): you can add Claude's own fresh review to the bundle so the bench ranks and adjudicates it — Claude is *judged* but never votes or chairs, so the verdict stays independent.
|
|
136
|
+
|
|
137
|
+
**Cost is disclosed up front.** Before any model launches, you see the run shape — for example:
|
|
138
|
+
|
|
139
|
+
> This run uses 3 council models across 2 fanout waves + 1 chair call (~7 model runs).
|
|
140
|
+
|
|
141
|
+
Then the council waits for your confirmation.
|
|
142
|
+
|
|
143
|
+
The skill lives at **[`skills/second-opinion/SKILL.md`](./skills/second-opinion/SKILL.md)**; the design spec behind it is **[`skills/second-opinion/COUNCIL-DESIGN.md`](./skills/second-opinion/COUNCIL-DESIGN.md)**.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## The parallel window
|
|
148
|
+
|
|
149
|
+
When you don't need a full council — just one other model's take — fork a conversation. Amicus extracts your current Claude Code context, opens a session pre-loaded with it, you **work** alongside it, and you **fold** a structured summary back into Claude's context when you're done.
|
|
150
|
+
|
|
151
|
+
**Interactive (default):** a real window opens next to your editor. Switch models mid-conversation with the model switcher, then click the **FOLD** button (or press `Cmd+Shift+F`) to generate the summary. Customize the shortcut with `--fold-shortcut`.
|
|
152
|
+
|
|
153
|
+
**Headless (`--no-ui`):** the agent works autonomously and emits the fold summary when it finishes — ideal for bulk work like test generation or documentation. Pair with `--json` for a machine-readable run document.
|
|
154
|
+
|
|
155
|
+
**Context sharing.** Your conversation history is passed automatically. Tune it:
|
|
156
|
+
|
|
157
|
+
- `--context-turns <N>` — max conversation turns to include (default 50).
|
|
158
|
+
- `--context-since <duration>` — time window (e.g. `2h`); overrides turns.
|
|
159
|
+
- `--context-max-tokens <N>` — cap the context size (default 80000).
|
|
160
|
+
- `--no-context` — skip parent history entirely.
|
|
161
|
+
|
|
162
|
+
**MCP inheritance.** Amicus discovers the MCP servers your Claude Code session uses and passes them through, so the forked model has the same tools you do. Control it:
|
|
163
|
+
|
|
164
|
+
- `--no-mcp` — don't inherit any parent MCP servers.
|
|
165
|
+
- `--exclude-mcp <name>` — drop a specific server (repeatable).
|
|
166
|
+
- `--mcp <name=url|name=command>` — add one.
|
|
167
|
+
|
|
168
|
+
**Safety.** Amicus warns on **file conflicts** (a file changed externally while the session ran) and on **context drift** (the shared context may be stale relative to your current session), so a fold never silently overwrites newer work.
|
|
169
|
+
|
|
170
|
+
**Auto-update.** Amicus checks the npm registry at most once every 24 hours (cached background check). When an update exists, the CLI prints a notice and the Electron toolbar shows a one-click **Update** banner. Or run it yourself:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
amicus update
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+

|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Commands
|
|
181
|
+
|
|
182
|
+
| Command | What it does |
|
|
183
|
+
|---------|--------------|
|
|
184
|
+
| `amicus start` | Launch a new session (interactive or `--no-ui`). |
|
|
185
|
+
| `amicus fanout` | Run N models on the same prompt in parallel (headless). |
|
|
186
|
+
| `amicus list` | Show previous sessions. |
|
|
187
|
+
| `amicus resume` | Reopen a previous session with full history. |
|
|
188
|
+
| `amicus continue` | Start a new session building on a previous one. |
|
|
189
|
+
| `amicus read` | Output a session's summary / conversation / metadata. |
|
|
190
|
+
| `amicus models` | List, search, refresh the catalog, or audit aliases. |
|
|
191
|
+
| `amicus abort` | Abort a running session (or `--all`). |
|
|
192
|
+
| `amicus setup` | Configure default model, API keys, and aliases. |
|
|
193
|
+
| `amicus update` | Update to the latest version. |
|
|
194
|
+
| `amicus mcp` | Start the MCP server (stdio transport). |
|
|
195
|
+
|
|
196
|
+
The `am` alias is interchangeable with `amicus` everywhere.
|
|
197
|
+
|
|
198
|
+
### `amicus start` options
|
|
199
|
+
|
|
200
|
+
| Option | Description | Default |
|
|
201
|
+
|--------|-------------|---------|
|
|
202
|
+
| `--model <model>` | Alias, `provider/model`, or `openrouter/provider/model`. | config default |
|
|
203
|
+
| `--prompt <text>` | Task description. | *(required unless `--prompt-file`)* |
|
|
204
|
+
| `--prompt-file <path>` | Read the prompt from a UTF-8 file (XOR `--prompt`). | |
|
|
205
|
+
| `--agent <agent>` | OpenCode agent: `Chat`, `Build`, `Plan`. | `Chat` interactive / `Build` headless |
|
|
206
|
+
| `--no-ui` | Run headless (autonomous, no window). | off |
|
|
207
|
+
| `--json` | Emit the run result as stable JSON (requires `--no-ui`). | off |
|
|
208
|
+
| `--timeout <minutes>` | Headless timeout. | 15 |
|
|
209
|
+
| `--context-turns <N>` | Max conversation turns to include. | 50 |
|
|
210
|
+
| `--context-since <duration>` | Time filter (e.g. `2h`); overrides turns. | |
|
|
211
|
+
| `--context-max-tokens <N>` | Max context tokens. | 80000 |
|
|
212
|
+
| `--no-context` | Skip parent conversation history. | off |
|
|
213
|
+
| `--thinking <level>` | Reasoning effort: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`. | model default |
|
|
214
|
+
| `--summary-length <length>` | Fold summary verbosity: `brief`, `normal`, `verbose`. | `normal` |
|
|
215
|
+
| `--mcp <spec>` | Add an MCP server (`name=url` or `name=command`). | |
|
|
216
|
+
| `--mcp-config <path>` | Path to an `opencode.json` with MCP config. | |
|
|
217
|
+
| `--no-mcp` | Don't inherit MCP servers from the parent. | off |
|
|
218
|
+
| `--exclude-mcp <name>` | Exclude a specific inherited MCP server (repeatable). | |
|
|
219
|
+
| `--session-id <id\|current>` | Session to pull context from. | `current` |
|
|
220
|
+
| `--cwd <path>` | Project directory. | cwd |
|
|
221
|
+
| `--client <type>` | Client context: `code-local`, `code-web`, `cowork`. | `code-local` |
|
|
222
|
+
| `--position <pos>` | Window position: `right`, `left`, `center`. | `right` |
|
|
223
|
+
| `--fold-shortcut <key>` | Customize the fold keyboard shortcut. | `Cmd/Ctrl+Shift+F` |
|
|
224
|
+
| `--opencode-port <port>` | Port override for the OpenCode server. | |
|
|
225
|
+
| `--session-dir <path>` | Explicit session-data directory. | |
|
|
226
|
+
| `--setup` | Force-open configuration before launching. | |
|
|
227
|
+
| `--no-validate-model` | Skip model-catalog validation before launch. | validation on |
|
|
228
|
+
|
|
229
|
+
> Agents: **Chat** auto-approves reads and asks before writes/bash (interactive default); **Build** has full tool access (headless default); **Plan** is read-only analysis. `--agent Chat` is interactive-only and incompatible with `--no-ui`.
|
|
230
|
+
|
|
231
|
+
### `amicus fanout` — same prompt, many models
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
amicus fanout --models gemini,deepseek,gpt --prompt "Review this design" --json
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Fanout runs one **headless wave**: every leg gets the **same** prompt (this is the shared-prompt model the council's review stages are built on). When all legs are terminal it prints **one** JSON wave document on stdout.
|
|
238
|
+
|
|
239
|
+
- `--models <a,b,c>` — comma-separated aliases or `provider/model` IDs (required).
|
|
240
|
+
- `--prompt <text>` / `--prompt-file <path>` — the shared briefing. `--prompt-file` avoids the ~32 KB Windows argument cap and is mutually exclusive with `--prompt`.
|
|
241
|
+
- `--wave-id <id>` — set the wave ID explicitly (leg IDs become `<id>-1..N`).
|
|
242
|
+
- `--json` — emit the wave document.
|
|
243
|
+
- Shared per-leg knobs: `--agent`, `--thinking`, `--timeout`, `--summary-length`, `--no-context`, the `--context-*` flags, the `--mcp*` flags, `--no-validate-model`, `--cwd`.
|
|
244
|
+
- **Exit codes:** `0` all legs complete, `2` partial wave, `1` none complete / hard failure.
|
|
245
|
+
|
|
246
|
+
### Other commands
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
amicus list # current project
|
|
250
|
+
amicus list --status running # filter by status (running, complete)
|
|
251
|
+
amicus list --all # all projects
|
|
252
|
+
amicus list --json # machine-readable
|
|
253
|
+
|
|
254
|
+
amicus read <id> # summary (default)
|
|
255
|
+
amicus read <id> --conversation # full conversation
|
|
256
|
+
amicus read <id> --metadata # session metadata
|
|
257
|
+
amicus read <id> --json # stable JSON (run or wave document)
|
|
258
|
+
|
|
259
|
+
amicus resume <id> # reopen with full history
|
|
260
|
+
amicus continue <id> --prompt "..." # new session, previous one as read-only context
|
|
261
|
+
|
|
262
|
+
amicus abort <id> # stop one running session
|
|
263
|
+
amicus abort --all # stop all running sessions in this project
|
|
264
|
+
|
|
265
|
+
amicus setup --api-keys # open just the API-key window
|
|
266
|
+
amicus setup --add-alias fast=openrouter/google/gemini-2.5-flash # add/override one alias
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Models
|
|
272
|
+
|
|
273
|
+
Amicus does **not** ship a frozen table of model names. Aliases and validation resolve against a **live catalog** fetched from provider APIs and cached at `~/.config/amicus/model-catalog.json` (24-hour TTL; the fetch works without an API key).
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
amicus models # list the catalog
|
|
277
|
+
amicus models --search gemini # filter by substring over id and name
|
|
278
|
+
amicus models --refresh # force-refresh from provider APIs
|
|
279
|
+
amicus models --check # audit your aliases against the catalog
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
`amicus models --check` exits with the **number of stale aliases** (capped at 100) and prints same-vendor replacement suggestions for each, so it drops cleanly into CI.
|
|
283
|
+
|
|
284
|
+
**Validation on launch.** `start` and `fanout` validate the model against the catalog before launching. For an explicit `--model` on `continue`/`resume` this is **blocking** (a typo'd model fails fast with suggestions); for a model *inherited* from a prior session it's **advisory**. Skip it any time with `--no-validate-model`, or fix the catalog with `amicus models --refresh`.
|
|
285
|
+
|
|
286
|
+
**Aliases are a curated seed, not a fixed list.** `amicus setup` seeds a curated set of short aliases (e.g. `gemini`, `gpt`, `opus`, `deepseek`), and you add or override them with `amicus setup --add-alias name=provider/model`. To see exactly what resolves on *your* machine, run `amicus models` — that is the source of truth, not this README.
|
|
287
|
+
|
|
288
|
+
**Full-id passthrough.** You can always bypass aliases and name a model directly. The prefix decides which credentials are used:
|
|
289
|
+
|
|
290
|
+
| Format | Example | Credentials |
|
|
291
|
+
|--------|---------|-------------|
|
|
292
|
+
| `openrouter/provider/model` | `openrouter/google/gemini-2.5-flash` | `OPENROUTER_API_KEY` |
|
|
293
|
+
| `google/model` | `google/gemini-2.5-flash` | `GOOGLE_GENERATIVE_AI_API_KEY` |
|
|
294
|
+
| `openai/model` | `openai/gpt-5` | `OPENAI_API_KEY` |
|
|
295
|
+
| `anthropic/model` | `anthropic/claude-opus-4` (the `opus` alias resolves here by default) | `ANTHROPIC_API_KEY` |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## MCP integration
|
|
300
|
+
|
|
301
|
+
The MCP server is auto-registered on install (Claude Code and Claude Desktop / Cowork). It exposes ten tools:
|
|
302
|
+
|
|
303
|
+
| Tool | What it does |
|
|
304
|
+
|------|--------------|
|
|
305
|
+
| `amicus_start` | Spawn a session; returns a task ID immediately. |
|
|
306
|
+
| `amicus_status` | Poll a task (or a fanout wave) for completion. |
|
|
307
|
+
| `amicus_read` | Read results: summary, conversation, metadata, or JSON. |
|
|
308
|
+
| `amicus_list` | List past sessions. |
|
|
309
|
+
| `amicus_resume` | Reopen a session. |
|
|
310
|
+
| `amicus_continue` | New session building on a previous one. |
|
|
311
|
+
| `amicus_abort` | Stop a running session. |
|
|
312
|
+
| `amicus_setup` | Open the setup wizard. |
|
|
313
|
+
| `amicus_guide` | Return usage guidance (model choice, briefings, polling). |
|
|
314
|
+
| `amicus_fanout` | Launch a same-prompt wave; returns `{ waveId, taskIds[] }`. |
|
|
315
|
+
|
|
316
|
+
The async pattern is **start → status → read**: `amicus_start` (or `amicus_fanout`) returns immediately, you poll `amicus_status`, then `amicus_read` once it's done — so the calling agent never blocks.
|
|
317
|
+
|
|
318
|
+
To register manually (user scope):
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
claude mcp add-json amicus '{"command":"npx","args":["-y","amicus@latest","mcp"]}' --scope user
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
> Legacy `sidecar_*` tool names are still registered as aliases of each `amicus_*` tool for backward compatibility.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Configuration
|
|
329
|
+
|
|
330
|
+
`amicus setup` is the recommended way to configure Amicus — it writes API keys to `~/.config/amicus/.env` (`0600`) and persists your default model and aliases. The environment variables below are for overrides and tuning. Dev-only variables (mock/update testing) are documented in [docs/configuration.md](./docs/configuration.md).
|
|
331
|
+
|
|
332
|
+
**API keys**
|
|
333
|
+
|
|
334
|
+
| Variable | Purpose |
|
|
335
|
+
|----------|---------|
|
|
336
|
+
| `OPENROUTER_API_KEY` | OpenRouter (multi-provider access). |
|
|
337
|
+
| `GOOGLE_GENERATIVE_AI_API_KEY` | Direct Google access. |
|
|
338
|
+
| `OPENAI_API_KEY` | Direct OpenAI access. |
|
|
339
|
+
| `ANTHROPIC_API_KEY` | Direct Anthropic access. |
|
|
340
|
+
| `DEEPSEEK_API_KEY` | Direct DeepSeek access. |
|
|
341
|
+
|
|
342
|
+
**Behavior**
|
|
343
|
+
|
|
344
|
+
| Variable | Purpose | Default |
|
|
345
|
+
|----------|---------|---------|
|
|
346
|
+
| `LOG_LEVEL` | Log verbosity: `error`, `warn`, `info`, `debug`. | `error` |
|
|
347
|
+
| `AMICUS_CONFIG_DIR` | Override the config directory (keys, catalog, sessions). | `~/.config/amicus` |
|
|
348
|
+
| `AMICUS_FANOUT_MAX_LEGS` | Cap the number of legs in a single fanout wave; non-positive values fall back to 10. | `10` |
|
|
349
|
+
| `AMICUS_SHARED_SERVER` | When `1`, multiple MCP sessions share a single OpenCode Go process, eliminating cold-start latency. Set to `0` for per-process isolation or to diagnose a crash loop. | `1` |
|
|
350
|
+
|
|
351
|
+
**Headless poller tuning** (advanced — rarely needed)
|
|
352
|
+
|
|
353
|
+
| Variable | Purpose | Default |
|
|
354
|
+
|----------|---------|---------|
|
|
355
|
+
| `AMICUS_POLL_INTERVAL_MS` | Delay between poll cycles. | `2000` |
|
|
356
|
+
| `AMICUS_POLL_CALL_TIMEOUT_MS` | Per-poll call timeout. | `30000` |
|
|
357
|
+
| `AMICUS_STABLE_FINISHED_POLLS` | Stable polls required after a completion signal. | `2` |
|
|
358
|
+
| `AMICUS_STABLE_IDLE_POLLS` | Stable polls required with no completion signal (~60 s at 2 s). | `30` |
|
|
359
|
+
| `AMICUS_MAX_CONSECUTIVE_POLL_FAILURES` | Consecutive poll failures before bailing. | `15` |
|
|
360
|
+
|
|
361
|
+
**GUI & debug**
|
|
362
|
+
|
|
363
|
+
| Variable | Purpose | Default |
|
|
364
|
+
|----------|---------|---------|
|
|
365
|
+
| `AMICUS_GUI_LOAD_TIMEOUT_MS` | Max wait for the Electron UI to load before showing what's in flight. | `15000` |
|
|
366
|
+
| `AMICUS_DEBUG_PORT` | Chrome DevTools Protocol port for the Electron window. | `9222` |
|
|
367
|
+
|
|
368
|
+
> **Legacy names.** The pre-rebrand `SIDECAR_*` environment variables are still honored (with a one-time deprecation warning) and map to their `AMICUS_*` equivalents. See **[docs/SHIMS.md](./docs/SHIMS.md)** for the full mapping.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## JSON output
|
|
373
|
+
|
|
374
|
+
With `--json`, Amicus emits stable, versioned documents on stdout — built for scripting and agent consumption.
|
|
375
|
+
|
|
376
|
+
**Run document** (a single session — `start`, `read`, each fanout leg):
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"taskId": "...", "model": "...", "modelInput": "...", "agent": "...",
|
|
381
|
+
"status": "complete", "summary": "...", "error": null,
|
|
382
|
+
"createdAt": "...", "completedAt": "...", "durationMs": 0
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
`modelInput` is the alias you passed; `model` is the resolved id. `status` is one of `complete | error | timeout | aborted` (plus `crashed` / `idle-timeout`); `summary` carries the fold output.
|
|
387
|
+
|
|
388
|
+
**Wave document** (`fanout`, and `read <waveId> --json`):
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"schemaVersion": 1, "waveId": "...",
|
|
393
|
+
"status": "complete",
|
|
394
|
+
"counts": { "total": 0, "complete": 0, "error": 0, "timeout": 0, "aborted": 0 },
|
|
395
|
+
"legs": [ /* one run document per model, in --models order */ ]
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
`status` is `complete | partial | error | aborted`. A leg's `summary` is that model's full response.
|
|
400
|
+
|
|
401
|
+
**Exit codes** (for `--no-ui` / `fanout`): `0` success / all legs complete · `2` partial wave · `1` error, nothing completed, or hard failure · `130` interrupted (SIGINT) · `143` terminated (SIGTERM).
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Windows
|
|
406
|
+
|
|
407
|
+
Amicus is **first-class on Windows** — developed and tested on Windows 11, no WSL required.
|
|
408
|
+
|
|
409
|
+
Most Claude-adjacent tooling assumes macOS/Linux; Amicus doesn't.
|
|
410
|
+
|
|
411
|
+
- The full unit suite runs green on Windows 11.
|
|
412
|
+
- Native-binary PATH handling resolves the OpenCode binary correctly under Windows.
|
|
413
|
+
- Session-path encoding is handled natively (the Claude project-path encoding that trips up naive `~/.claude/projects` lookups is accounted for).
|
|
414
|
+
- For long briefings, `--prompt-file` sidesteps the ~32 KB Windows command-line argument cap.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Troubleshooting
|
|
419
|
+
|
|
420
|
+
| Symptom | Likely cause | Fix |
|
|
421
|
+
|---------|--------------|-----|
|
|
422
|
+
| "council review this" does nothing | The `second-opinion` skill isn't installed | Check `~/.claude/skills/second-opinion/SKILL.md` exists; re-run `npm install -g amicus` (postinstall installs both skills) |
|
|
423
|
+
| `401` / auth error | API key missing, or the model prefix doesn't match the key you have | Run `amicus setup`; make sure the prefix (`openrouter/…` vs `google/…` vs `openai/…` vs `anthropic/…`) matches the credentials you configured. |
|
|
424
|
+
| Session not found | No session matches the given ID | Run `amicus list`, or omit `--session-id` to use the most recent. |
|
|
425
|
+
| No conversation history found | Project-path encoding | Check `~/.claude/projects/`; `/` and `_` in the project path are encoded as `-` in the directory name. |
|
|
426
|
+
| Headless run never finishes | Task is bigger than the default timeout | Raise it: `--timeout 30`. |
|
|
427
|
+
| Wrong session picked up | Multiple active sessions resolve ambiguously | Pass `--session-id` explicitly. |
|
|
428
|
+
| Fold summary looks corrupted | Debug output leaking into stdout | Re-run with `LOG_LEVEL=debug` to see what's printing. |
|
|
429
|
+
| Model fails catalog validation | The model isn't in the cached catalog (renamed, or cache stale) | `amicus models --refresh`, or bypass with `--no-validate-model`. |
|
|
430
|
+
| `fanout` exits `2` | Partial wave — at least one leg failed | Read the wave document's `legs[]` and inspect each failed leg's `status` / `error`. |
|
|
431
|
+
|
|
432
|
+
**Debug logging:**
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
LOG_LEVEL=debug amicus start --model gemini --prompt "test" --no-ui
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Documentation
|
|
441
|
+
|
|
442
|
+
| Doc | Description |
|
|
443
|
+
|-----|-------------|
|
|
444
|
+
| [docs/usage.md](./docs/usage.md) | Command-by-command usage guide. |
|
|
445
|
+
| [docs/configuration.md](./docs/configuration.md) | Full configuration and environment reference. |
|
|
446
|
+
| [docs/architecture.md](./docs/architecture.md) | How the engine, Electron shell, and context sharing fit together. |
|
|
447
|
+
| [docs/opencode-integration.md](./docs/opencode-integration.md) | How Amicus drives the OpenCode runtime. |
|
|
448
|
+
| [docs/troubleshooting.md](./docs/troubleshooting.md) | Extended troubleshooting. |
|
|
449
|
+
| [docs/electron-testing.md](./docs/electron-testing.md) | Chrome DevTools Protocol patterns for UI testing. |
|
|
450
|
+
| [docs/testing.md](./docs/testing.md) | Test suite layout and how to run it. |
|
|
451
|
+
| [docs/publishing.md](./docs/publishing.md) | Release and publish process. |
|
|
452
|
+
| [docs/SHIMS.md](./docs/SHIMS.md) | Legacy `SIDECAR_*` → `AMICUS_*` compatibility shims. |
|
|
453
|
+
| [skills/second-opinion/SKILL.md](./skills/second-opinion/SKILL.md) | The LLM Council skill. |
|
|
454
|
+
| [skill/SKILL.md](./skill/SKILL.md) | The `sidecar` chat skill. |
|
|
455
|
+
| [evals/README.md](./evals/README.md) | End-to-end eval harness for LLM interactions. |
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## Contributing
|
|
460
|
+
|
|
461
|
+
Contributions are welcome. The dev setup, git-hook wiring, and test commands live in **[CONTRIBUTING.md](./CONTRIBUTING.md)**.
|
|
462
|
+
|
|
463
|
+
The autonomous Electron-UI testing approach (driving the real window over the Chrome DevTools Protocol) is documented in **[docs/electron-testing.md](./docs/electron-testing.md)**.
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Built on OpenCode
|
|
468
|
+
|
|
469
|
+
Amicus is a harness built on top of [**OpenCode**](https://opencode.ai), the open-source AI coding engine. OpenCode provides the conversation runtime, tool-execution framework, agent system, and web UI. Amicus adds context sharing from Claude Code, the Electron shell, the fold/summary workflow, session persistence, parallel fanout waves, the multi-model council, and multi-client support (CLI, MCP, Cowork). OpenCode handles the hard parts of LLM interaction so Amicus can focus on the council-and-parallel-window workflow.
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Attribution & License
|
|
474
|
+
|
|
475
|
+
Amicus is an independent fork of [**Claude Sidecar**](https://github.com/jrenaldi79/sidecar) by [John Renaldi](https://github.com/jrenaldi79), used under the MIT License. The original copyright (© 2025 John Renaldi) is preserved in full in [LICENSE](./LICENSE). The engine modifications, the multi-model council, and the skill bundling are © 2026 BourbonDog, also under the MIT License. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for the complete attribution.
|
|
476
|
+
|
|
477
|
+
**MIT.**
|