counselors 0.1.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/README.md +206 -0
- package/assets/amp-deep-settings.json +17 -0
- package/assets/amp-readonly-settings.json +16 -0
- package/dist/cli.js +2585 -0
- package/dist/cli.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# counselors
|
|
2
|
+
|
|
3
|
+
Fan out prompts to multiple AI coding agents in parallel.
|
|
4
|
+
|
|
5
|
+
`counselors` dispatches the same prompt to Claude, Codex, Gemini, Amp, or custom tools simultaneously, collects their responses, and writes everything to a structured output directory.
|
|
6
|
+
|
|
7
|
+
## Agentic Quick Start
|
|
8
|
+
|
|
9
|
+
Already inside an AI coding agent? Paste this prompt:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Install counselors globally with `npm install -g counselors`, then run `counselors agent` and follow the instructions it prints.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That's it. Your agent will install the CLI, configure available tools, and set up the `/counselors` slash command.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g counselors
|
|
21
|
+
|
|
22
|
+
# Discover installed AI CLIs and create a config
|
|
23
|
+
counselors init
|
|
24
|
+
|
|
25
|
+
# Send a prompt to all configured tools
|
|
26
|
+
counselors run "Explain the authentication flow in this codebase"
|
|
27
|
+
|
|
28
|
+
# Send to specific tools only
|
|
29
|
+
counselors run -t claude,codex "Review this error handling"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Supported Tools
|
|
33
|
+
|
|
34
|
+
| Tool | Adapter | Read-Only | Install |
|
|
35
|
+
|------|---------|-----------|---------|
|
|
36
|
+
| Claude Code | `claude` | enforced | [docs](https://docs.anthropic.com/en/docs/claude-code) |
|
|
37
|
+
| OpenAI Codex | `codex` | enforced | [github](https://github.com/openai/codex) |
|
|
38
|
+
| Gemini CLI | `gemini` | bestEffort | [github](https://github.com/google-gemini/gemini-cli) |
|
|
39
|
+
| Amp CLI | `amp` | enforced | [ampcode.com](https://ampcode.com) |
|
|
40
|
+
| Custom | user-defined | configurable | — |
|
|
41
|
+
|
|
42
|
+
## Commands
|
|
43
|
+
|
|
44
|
+
### `run [prompt]`
|
|
45
|
+
|
|
46
|
+
Dispatch a prompt to configured tools in parallel.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
counselors run "Your prompt here"
|
|
50
|
+
counselors run -f prompt.md # Use a prompt file
|
|
51
|
+
echo "prompt" | counselors run # Read from stdin
|
|
52
|
+
counselors run --dry-run "Show plan" # Preview without executing
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Flag | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `-f, --file <path>` | Use a prompt file (no wrapping) |
|
|
58
|
+
| `-t, --tools <list>` | Comma-separated tool IDs |
|
|
59
|
+
| `--context <paths>` | Gather context from paths (comma-separated, or `.` for git diff) |
|
|
60
|
+
| `--read-only <level>` | `strict`, `best-effort`, `off` (defaults to config `readOnly`) |
|
|
61
|
+
| `--dry-run` | Show what would run without executing |
|
|
62
|
+
| `--json` | Output manifest as JSON |
|
|
63
|
+
| `-o, --output-dir <dir>` | Base output directory |
|
|
64
|
+
|
|
65
|
+
### `init`
|
|
66
|
+
|
|
67
|
+
Interactive setup wizard. Discovers installed AI CLIs, lets you pick tools and models, runs validation tests.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
counselors init # Interactive
|
|
71
|
+
counselors init --auto # Non-interactive: discover tools, use defaults, output JSON
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `doctor`
|
|
75
|
+
|
|
76
|
+
Check configuration health — verifies config file, tool binaries, versions, and read-only capabilities.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
counselors doctor
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `tools`
|
|
83
|
+
|
|
84
|
+
Manage configured tools.
|
|
85
|
+
|
|
86
|
+
| Command | Description |
|
|
87
|
+
|---------|-------------|
|
|
88
|
+
| `tools discover` | Find installed AI CLIs on your system |
|
|
89
|
+
| `tools add [tool]` | Add a built-in or custom tool |
|
|
90
|
+
| `tools remove [tool]` | Remove tool(s) — interactive if no argument |
|
|
91
|
+
| `tools rename <old> <new>` | Rename a tool ID |
|
|
92
|
+
| `tools list` / `ls` | List configured tools (`-v` for full config) |
|
|
93
|
+
| `tools test [tools...]` | Test tools with a quick "reply OK" prompt |
|
|
94
|
+
|
|
95
|
+
### `agent`
|
|
96
|
+
|
|
97
|
+
Print setup and skill installation instructions.
|
|
98
|
+
|
|
99
|
+
### `skill`
|
|
100
|
+
|
|
101
|
+
Print a `/counselors` slash-command template for use inside Claude Code or other agents.
|
|
102
|
+
|
|
103
|
+
## Configuration
|
|
104
|
+
|
|
105
|
+
### Global Config
|
|
106
|
+
|
|
107
|
+
`~/.config/counselors/config.json` (respects `XDG_CONFIG_HOME`)
|
|
108
|
+
|
|
109
|
+
```jsonc
|
|
110
|
+
{
|
|
111
|
+
"version": 1,
|
|
112
|
+
"defaults": {
|
|
113
|
+
"timeout": 540,
|
|
114
|
+
"outputDir": "./agents/counselors",
|
|
115
|
+
"readOnly": "bestEffort",
|
|
116
|
+
"maxContextKb": 50,
|
|
117
|
+
"maxParallel": 4
|
|
118
|
+
},
|
|
119
|
+
"tools": {
|
|
120
|
+
"claude": {
|
|
121
|
+
"binary": "/usr/local/bin/claude",
|
|
122
|
+
"adapter": "claude",
|
|
123
|
+
"readOnly": { "level": "enforced" },
|
|
124
|
+
"extraFlags": ["--model", "opus"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Project Config
|
|
131
|
+
|
|
132
|
+
Place a `.counselors.json` in your project root to override `defaults` per-project. Project configs cannot add or modify `tools` (security boundary).
|
|
133
|
+
|
|
134
|
+
```jsonc
|
|
135
|
+
{
|
|
136
|
+
"defaults": {
|
|
137
|
+
"outputDir": "./ai-output",
|
|
138
|
+
"readOnly": "enforced"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Read-Only Modes
|
|
144
|
+
|
|
145
|
+
| Level | Behavior |
|
|
146
|
+
|-------|----------|
|
|
147
|
+
| `enforced` | Tool is sandboxed to read-only operations |
|
|
148
|
+
| `bestEffort` | Tool is asked to avoid writes but may not guarantee it |
|
|
149
|
+
| `none` | Tool has full read/write access |
|
|
150
|
+
|
|
151
|
+
The `--read-only` flag on `run` controls the policy: `strict` only dispatches to tools with `enforced` support, `best-effort` uses whatever each tool supports, `off` disables read-only flags entirely. When omitted, falls back to the `readOnly` setting in your config defaults (which defaults to `bestEffort`).
|
|
152
|
+
|
|
153
|
+
## Output Structure
|
|
154
|
+
|
|
155
|
+
Each run creates a timestamped directory:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
./agents/counselors/{slug}/
|
|
159
|
+
prompt.md # The dispatched prompt
|
|
160
|
+
run.json # Manifest with status, timing, costs
|
|
161
|
+
summary.md # Synthesized summary
|
|
162
|
+
{tool-id}.md # Each tool's response
|
|
163
|
+
{tool-id}.stderr # Each tool's stderr
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Skill / Slash Command
|
|
167
|
+
|
|
168
|
+
Install `/counselors` as a skill in Claude Code or other agents:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Print the skill template
|
|
172
|
+
counselors skill
|
|
173
|
+
|
|
174
|
+
# Print full agent setup instructions
|
|
175
|
+
counselors agent
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The skill template provides a multi-phase workflow: gather context, select agents, assemble prompt, dispatch via `counselors run`, read results, and synthesize a combined answer.
|
|
179
|
+
|
|
180
|
+
## Security
|
|
181
|
+
|
|
182
|
+
- **Environment allowlisting**: Child processes only receive allowlisted environment variables (PATH, HOME, API keys, proxy settings, etc.) — no full `process.env` leak.
|
|
183
|
+
- **Atomic config writes**: Config files are written atomically via temp+rename with `0o600` permissions.
|
|
184
|
+
- **Tool name validation**: Tool IDs are validated against `[a-zA-Z0-9._-]` to prevent path traversal.
|
|
185
|
+
- **No shell execution**: All child processes use `execFile`/`spawn` without `shell: true`.
|
|
186
|
+
- **Project config isolation**: `.counselors.json` can only override `defaults`, never inject `tools`.
|
|
187
|
+
|
|
188
|
+
## Development
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
npm install
|
|
192
|
+
npm run build # tsup → dist/cli.js
|
|
193
|
+
npm run test # vitest (unit + integration)
|
|
194
|
+
npm run typecheck # tsc --noEmit
|
|
195
|
+
npm run lint # biome check
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Requires Node 20+. TypeScript with ESM, built with tsup, tested with vitest, linted with biome.
|
|
199
|
+
|
|
200
|
+
## Known Issues
|
|
201
|
+
|
|
202
|
+
- **Amp `deep` model uses Bash to read files.** The `deep` model (GPT-5.2 Codex) reads files via `Bash` rather than the `Read` tool. Because `Bash` is a write-capable tool, we cannot guarantee that deep mode will not modify files. A mandatory read-only instruction is injected into the prompt, but this is a best-effort safeguard. For safety-critical tasks, prefer `amp-smart`.
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
MIT
|