@margay/ccl-core 1.3.5-rc.6
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/INTENT-GATEWAY-GUIDE.md +82 -0
- package/QUICKSTART.md +188 -0
- package/README.md +286 -0
- package/dist/cli.js +735032 -0
- package/dist/sdk/index.d.ts +13 -0
- package/dist/sdk/index.js +12 -0
- package/dist/sdk/mcpServer.d.ts +52 -0
- package/dist/sdk/mcpServer.js +134 -0
- package/dist/sdk/query.d.ts +91 -0
- package/dist/sdk/query.js +697 -0
- package/dist/sdk/queryHandle.d.ts +41 -0
- package/dist/sdk/queryHandle.js +414 -0
- package/dist/sdk/store.d.ts +16 -0
- package/dist/sdk/store.js +73 -0
- package/dist/sdk/transport.d.ts +20 -0
- package/dist/sdk/transport.js +100 -0
- package/dist/sdk/types.d.ts +423 -0
- package/dist/sdk/types.js +16 -0
- package/dist/vendor/ripgrep/VERSION +8 -0
- package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/package.json +149 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Legacy Intent Gateway Guide
|
|
2
|
+
|
|
3
|
+
This page is retained only as a historical migration note. It is **not** the
|
|
4
|
+
current CCL gateway setup guide.
|
|
5
|
+
|
|
6
|
+
Current setup lives in:
|
|
7
|
+
|
|
8
|
+
- [README.md](./README.md)
|
|
9
|
+
- [QUICKSTART.md](./QUICKSTART.md)
|
|
10
|
+
- [docs/gateway-quickstart.md](./docs/gateway-quickstart.md)
|
|
11
|
+
|
|
12
|
+
## Current Status
|
|
13
|
+
|
|
14
|
+
CCL `1.3.1` uses the Margay gateway connection managed by the `/gateway`
|
|
15
|
+
commands:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/gateway register <GATEWAY_URL> <INVITE_CODE> [username] [email] [phone]
|
|
19
|
+
/gateway login <GATEWAY_URL> <GATEWAY_TOKEN>
|
|
20
|
+
/gateway doctor
|
|
21
|
+
/gateway status
|
|
22
|
+
/gateway logout
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The current public docs must not publish real gateway IP addresses, production
|
|
26
|
+
tokens, shared test tokens, or administrator credentials. Use placeholders such
|
|
27
|
+
as `<GATEWAY_URL>` and `<GATEWAY_TOKEN>` in all examples.
|
|
28
|
+
|
|
29
|
+
## What Changed
|
|
30
|
+
|
|
31
|
+
Older internal guides described a dedicated intent-classification gateway path
|
|
32
|
+
and direct VPS port usage. Those instructions are no longer the official setup
|
|
33
|
+
path for CCL users.
|
|
34
|
+
|
|
35
|
+
Current user-facing setup should instead rely on:
|
|
36
|
+
|
|
37
|
+
1. `/gateway register` for first-time invite-based registration.
|
|
38
|
+
2. `/gateway login` for existing gateway credentials or endpoint switching.
|
|
39
|
+
3. `/gateway doctor` for reachability and configuration diagnosis.
|
|
40
|
+
4. `/model`, `/endpoint`, `/priority`, and `/effort` for runtime model control.
|
|
41
|
+
|
|
42
|
+
## Migration Guidance
|
|
43
|
+
|
|
44
|
+
If you find an old runbook telling users to:
|
|
45
|
+
|
|
46
|
+
- export a concrete gateway IP address,
|
|
47
|
+
- paste a shared key into shell rc files,
|
|
48
|
+
- call a legacy intent-classification endpoint directly,
|
|
49
|
+
- use admin credentials in local examples,
|
|
50
|
+
- or set `ANTHROPIC_BASE_URL` as the gateway path for all traffic,
|
|
51
|
+
|
|
52
|
+
treat that runbook as stale. Replace it with the current `/gateway` command
|
|
53
|
+
flow and safe placeholders.
|
|
54
|
+
|
|
55
|
+
## Verification Checklist
|
|
56
|
+
|
|
57
|
+
For a current gateway setup:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
/gateway doctor
|
|
61
|
+
/gateway status
|
|
62
|
+
/model
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
For source checkout validation:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node dist/cli.js --version
|
|
69
|
+
node dist/cli.js --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Expected version output:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
1.3.1 (CCL)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Documentation Policy
|
|
79
|
+
|
|
80
|
+
This file intentionally avoids concrete production addresses, concrete tokens,
|
|
81
|
+
and legacy endpoint strings. It exists to prevent users and guide agents from
|
|
82
|
+
following obsolete setup instructions.
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# CCL Quick Start
|
|
2
|
+
|
|
3
|
+
This guide gets a new user from install to first useful session with CCL
|
|
4
|
+
`1.3.1`. For the full feature map, see [README.md](./README.md) and
|
|
5
|
+
[docs/index.md](./docs/index.md).
|
|
6
|
+
|
|
7
|
+
## 1. Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @margay/ccl-core
|
|
11
|
+
ccl --version
|
|
12
|
+
# 1.3.1 (CCL)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
From a source checkout:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
node dist/cli.js --version
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 2. Choose Authentication
|
|
24
|
+
|
|
25
|
+
Use one of these paths.
|
|
26
|
+
|
|
27
|
+
### Margay Gateway
|
|
28
|
+
|
|
29
|
+
Use this path for gateway-routed models such as DeepSeek, Kimi, GLM, or any
|
|
30
|
+
model exposed by your Margay gateway.
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
ccl
|
|
34
|
+
/gateway register <GATEWAY_URL> <INVITE_CODE> [username] [email] [phone]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you already have a token:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
ccl
|
|
41
|
+
/gateway login <GATEWAY_URL> <GATEWAY_TOKEN>
|
|
42
|
+
/gateway doctor
|
|
43
|
+
/gateway status
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`/gateway login` and `/gateway register` write `~/.ccl/gateway.json`, update the
|
|
47
|
+
current CCL process, and maintain a managed shell rc block. If your current
|
|
48
|
+
terminal already exported old `CCL_GATEWAY_URL` or `CCL_GATEWAY_KEY` values,
|
|
49
|
+
open a new terminal, reload the rc file, or unset those variables before
|
|
50
|
+
starting a new CCL process.
|
|
51
|
+
|
|
52
|
+
### Claude OAuth
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
ccl
|
|
56
|
+
/login
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The first interactive launch can also guide you through OAuth login.
|
|
60
|
+
|
|
61
|
+
### Anthropic API Key
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
export ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY>
|
|
65
|
+
ccl --model sonnet
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Do not paste real keys into docs, shell history examples, bug reports, or shared
|
|
69
|
+
screenshots.
|
|
70
|
+
|
|
71
|
+
## 3. Run CCL
|
|
72
|
+
|
|
73
|
+
Interactive:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
ccl
|
|
77
|
+
ccl --model deepseek-v4-pro
|
|
78
|
+
ccl --cwd /path/to/project
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
One-shot:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
ccl -p "explain this error" < error.log
|
|
85
|
+
ccl -p "summarize the current repository" --max-turns 20
|
|
86
|
+
ccl -p "return JSON" --output-format json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Streaming automation:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ccl -p "run a compact audit" --output-format stream-json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 4. Useful First Slash Commands
|
|
96
|
+
|
|
97
|
+
Run slash commands inside the interactive TUI.
|
|
98
|
+
|
|
99
|
+
| Command | Purpose |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `/help` | Show commands available in this build |
|
|
102
|
+
| `/doctor` | Diagnose local installation and settings |
|
|
103
|
+
| `/gateway doctor` | Diagnose gateway config and reachability |
|
|
104
|
+
| `/model` | View or switch the active model |
|
|
105
|
+
| `/priority quality` | Prefer stronger models where routing supports it |
|
|
106
|
+
| `/priority cost` | Prefer lower-cost models where routing supports it |
|
|
107
|
+
| `/effort high` | Increase reasoning effort for the current session |
|
|
108
|
+
| `/add-dir <path>` | Add another directory to tool scope |
|
|
109
|
+
| `/permissions` | Manage tool permission rules |
|
|
110
|
+
| `/compact` | Compress conversation context |
|
|
111
|
+
| `/resume` | Resume an earlier conversation |
|
|
112
|
+
| `/workflows` | List, create, inspect, or tail workflows |
|
|
113
|
+
| `/mcp` | Manage MCP servers |
|
|
114
|
+
| `/skills` | List available skills |
|
|
115
|
+
| `/status` | Show current session state |
|
|
116
|
+
| `/exit` | Exit the TUI |
|
|
117
|
+
|
|
118
|
+
## 5. Common CLI Options
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
ccl --help
|
|
122
|
+
ccl -p "task" --model sonnet --effort high
|
|
123
|
+
ccl -p "task" --allowedTools "Bash(git:*) Edit"
|
|
124
|
+
ccl -p "task" --disallowedTools "Bash(rm:*)"
|
|
125
|
+
ccl --bare -p "minimal startup task"
|
|
126
|
+
ccl --resume <SESSION_ID>
|
|
127
|
+
ccl --continue
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Important safety options:
|
|
131
|
+
|
|
132
|
+
| Option | Use |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `--allowedTools` | Limit automation to known-safe tools |
|
|
135
|
+
| `--disallowedTools` | Block dangerous tools or patterns |
|
|
136
|
+
| `--permission-mode plan` | Ask the model to plan before edits |
|
|
137
|
+
| `--dangerously-skip-permissions` | Only for isolated sandboxes |
|
|
138
|
+
|
|
139
|
+
## 6. Workflows
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
ccl workflow validate <name-or-path>
|
|
143
|
+
ccl workflow run <name-or-path> --json
|
|
144
|
+
ccl workflow run <name-or-path> --dry-run
|
|
145
|
+
ccl workflow generate "produce a release audit workflow"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Inside CCL:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
/workflows
|
|
152
|
+
/workflows new <goal>
|
|
153
|
+
/workflows --tail [runId]
|
|
154
|
+
/workflows --inspect [runId]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## 7. SDK Quick Start
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { query, resumeWithDecision } from '@margay/ccl-core/sdk'
|
|
161
|
+
|
|
162
|
+
for await (const event of query('audit this workspace', {
|
|
163
|
+
cwd: '/srv/workspace',
|
|
164
|
+
model: 'deepseek-v4-pro',
|
|
165
|
+
maxTurns: 30,
|
|
166
|
+
canUseTool: async (toolName) =>
|
|
167
|
+
toolName === 'Bash' ? { behavior: 'pending' } : { behavior: 'allow' },
|
|
168
|
+
})) {
|
|
169
|
+
if (event.type === 'suspended') {
|
|
170
|
+
// Persist approval UI state, then later call resumeWithDecision(...)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Read [sdk/README.md](./sdk/README.md) and [sdk/API.md](./sdk/API.md) before
|
|
176
|
+
embedding CCL in a host process.
|
|
177
|
+
|
|
178
|
+
## 8. Troubleshooting
|
|
179
|
+
|
|
180
|
+
| Symptom | Fix |
|
|
181
|
+
|---|---|
|
|
182
|
+
| Gateway login worked but a new shell uses the old gateway | Check exported `CCL_GATEWAY_URL` and `CCL_GATEWAY_KEY`, then reload shell rc or unset old variables |
|
|
183
|
+
| No credentials found | Use `/login`, `/gateway login`, or set `ANTHROPIC_API_KEY` |
|
|
184
|
+
| Model unavailable | Use `/model` to inspect configured options or check the gateway model list |
|
|
185
|
+
| Automation loops too long | Set `--max-turns`, `--max-budget-usd`, or `CCL_PRINT_MAX_TURNS` |
|
|
186
|
+
| Tool calls need policy control | Use CLI allow/deny options or the SDK `canUseTool` callback |
|
|
187
|
+
|
|
188
|
+
For the full authoritative docs set, start at [docs/index.md](./docs/index.md).
|
package/README.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# CCL
|
|
2
|
+
|
|
3
|
+
CCL is the `@margay/ccl-core` command-line agent runtime. It starts an
|
|
4
|
+
interactive coding assistant by default, supports non-interactive scripting with
|
|
5
|
+
`--print`, and can run either direct Claude channels or Margay gateway routed
|
|
6
|
+
models from the same CLI surface.
|
|
7
|
+
|
|
8
|
+
Current package version: **1.3.1**.
|
|
9
|
+
|
|
10
|
+
This file is the public package entry point. The full authoritative
|
|
11
|
+
documentation index is [docs/index.md](./docs/index.md), and the fast path for
|
|
12
|
+
new users is [QUICKSTART.md](./QUICKSTART.md).
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- Node.js 20 or newer.
|
|
17
|
+
- At least one authentication path:
|
|
18
|
+
- Margay gateway token for gateway-routed models.
|
|
19
|
+
- Claude OAuth for subscription-backed Claude use.
|
|
20
|
+
- Anthropic API key for direct API-key Claude use.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @margay/ccl-core
|
|
26
|
+
ccl --version
|
|
27
|
+
# 1.3.1 (CCL)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
From a source checkout:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install
|
|
34
|
+
npm run build
|
|
35
|
+
node dist/cli.js --version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Start A Session
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
ccl
|
|
42
|
+
ccl "review the current git diff"
|
|
43
|
+
ccl --model deepseek-v4-pro
|
|
44
|
+
ccl --cwd /path/to/project
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use `--print` for scripts and pipelines:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ccl -p "explain this stack trace" < error.log
|
|
51
|
+
ccl -p "return JSON only" --output-format json
|
|
52
|
+
ccl -p "stream events" --output-format stream-json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Authentication
|
|
56
|
+
|
|
57
|
+
CCL can use multiple channels. Environment variables override saved gateway
|
|
58
|
+
configuration.
|
|
59
|
+
|
|
60
|
+
| Channel | Use For | Setup |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| Margay gateway | DeepSeek, Kimi, GLM, gateway-managed Claude or OpenAI-compatible models | In CCL, run `/gateway register <url> <invite>` or `/gateway login <url> <token>` |
|
|
63
|
+
| Claude OAuth | Claude subscription sessions | Run `ccl` and follow the login prompt, or use `/login` |
|
|
64
|
+
| Anthropic API key | Direct Anthropic API use | Set `ANTHROPIC_API_KEY=<key>` or pass `--api-key <key>` |
|
|
65
|
+
|
|
66
|
+
Gateway configuration is saved to `~/.ccl/gateway.json` and synchronized into a
|
|
67
|
+
managed shell rc block by `/gateway login` and `/gateway register`. If a parent
|
|
68
|
+
terminal already exported `CCL_GATEWAY_URL` or `CCL_GATEWAY_KEY`, that terminal's
|
|
69
|
+
environment still wins for newly launched child processes. Use `/gateway doctor`
|
|
70
|
+
to detect mismatches, then open a new terminal, reload the shell rc file, or
|
|
71
|
+
unset the old variables.
|
|
72
|
+
|
|
73
|
+
## Gateway Commands
|
|
74
|
+
|
|
75
|
+
Run these inside an interactive CCL session:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
/gateway register <url> <invite_code> [username] [email] [phone]
|
|
79
|
+
/gateway login <url> <token>
|
|
80
|
+
/gateway status
|
|
81
|
+
/gateway doctor
|
|
82
|
+
/gateway logout
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`/gateway login` validates the gateway before writing local state. The current
|
|
86
|
+
health check uses the gateway auth/status endpoints implemented by the active
|
|
87
|
+
gateway; do not use legacy intent-classifier guides as setup instructions.
|
|
88
|
+
|
|
89
|
+
More detail: [docs/gateway-quickstart.md](./docs/gateway-quickstart.md).
|
|
90
|
+
|
|
91
|
+
## CLI Surface
|
|
92
|
+
|
|
93
|
+
`ccl --help` is the exact runtime source for command-line behavior. The current
|
|
94
|
+
top-level commands are:
|
|
95
|
+
|
|
96
|
+
| Command | Purpose |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `agents` | List configured agents |
|
|
99
|
+
| `auth` | Manage authentication |
|
|
100
|
+
| `doctor` | Check installation and updater health |
|
|
101
|
+
| `install` | Install a CCL native build |
|
|
102
|
+
| `mcp` | Configure and manage MCP servers |
|
|
103
|
+
| `plugin`, `plugins` | Manage CCL plugins |
|
|
104
|
+
| `setup-token` | Set up a long-lived authentication token |
|
|
105
|
+
| `update`, `upgrade` | Check for updates and install if available |
|
|
106
|
+
| `workflow` | Run and manage workflows |
|
|
107
|
+
|
|
108
|
+
Common global options:
|
|
109
|
+
|
|
110
|
+
| Option | Purpose |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `-p`, `--print` | Non-interactive mode for scripts and pipes |
|
|
113
|
+
| `--output-format text|json|stream-json` | Select non-interactive output format |
|
|
114
|
+
| `--input-format text|stream-json` | Select non-interactive input format |
|
|
115
|
+
| `--model <model>` | Pick a model alias or full model name |
|
|
116
|
+
| `--effort low|medium|high|max` | Set reasoning effort |
|
|
117
|
+
| `--fallback-model <model>` | Fallback model for `--print` overload handling |
|
|
118
|
+
| `--max-turns <n>` | Limit agentic turns in `--print`; `0` means unlimited |
|
|
119
|
+
| `--max-budget-usd <amount>` | Stop before a non-interactive run exceeds a budget |
|
|
120
|
+
| `--cwd <path>` | Change working directory and add it to tool scope |
|
|
121
|
+
| `--add-dir <path...>` | Add extra directories to tool scope |
|
|
122
|
+
| `--allowedTools <tools...>` | Allow specific tools or tool patterns |
|
|
123
|
+
| `--disallowedTools <tools...>` | Deny specific tools or tool patterns |
|
|
124
|
+
| `--permission-mode <mode>` | Use `default`, `acceptEdits`, `dontAsk`, `plan`, or `bypassPermissions` |
|
|
125
|
+
| `--dangerously-skip-permissions` | Bypass permission checks; only use in isolated sandboxes |
|
|
126
|
+
| `--bare` | Minimal startup without hooks, LSP, plugin sync, keychain reads, or auto memory |
|
|
127
|
+
| `--mcp-config <file-or-json...>` | Load MCP servers from JSON files or JSON strings |
|
|
128
|
+
| `--plugin-dir <path>` | Load plugins from explicit directories |
|
|
129
|
+
| `-c`, `--continue` | Continue the latest conversation for the current directory |
|
|
130
|
+
| `-r`, `--resume [id]` | Resume a conversation by session id or picker |
|
|
131
|
+
| `--fork-session` | Resume into a new session id |
|
|
132
|
+
| `--session-id <uuid>` | Force a specific session id |
|
|
133
|
+
| `--worktree [name]` | Create a git worktree for the session |
|
|
134
|
+
| `--tmux` | Create a tmux session for a worktree |
|
|
135
|
+
| `--debug [filter]`, `--debug-file <path>` | Enable debug logging |
|
|
136
|
+
|
|
137
|
+
## Interactive Slash Commands
|
|
138
|
+
|
|
139
|
+
Slash commands are available inside the interactive TUI. Some commands may be
|
|
140
|
+
hidden by feature gates or environment constraints, but the current source tree
|
|
141
|
+
defines these public command families:
|
|
142
|
+
|
|
143
|
+
| Area | Commands |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Help and session state | `/help`, `/status`, `/version`, `/doctor`, `/context`, `/cost`, `/usage`, `/stats`, `/extra-usage`, `/rate-limit-options` |
|
|
146
|
+
| Authentication and gateway | `/login`, `/logout`, `/gateway`, `/endpoint`, `/priority`, `/model`, `/effort`, `/advisor` |
|
|
147
|
+
| Conversation control | `/resume`, `/continue`, `/sessions`, `/compact`, `/rewind`, `/checkpoint`, `/clear`, `/reset`, `/new`, `/rename`, `/tag`, `/exit`, `/quit` |
|
|
148
|
+
| Workspaces and files | `/add-dir`, `/files`, `/diff`, `/copy`, `/export`, `/branch`, `/fork`, `/tasks`, `/bashes` |
|
|
149
|
+
| Planning and goals | `/plan`, `/goal`, `/loop`, `/brief` |
|
|
150
|
+
| Automation and workflows | `/workflows`, `/mcp`, `/skills`, `/plugin`, `/plugins`, `/reload-plugins`, `/hooks` |
|
|
151
|
+
| Agents and collaboration | `/agents`, `/buddy`, `/peers`, `/remote-control`, `/rc`, `/session`, `/remote`, `/remote-env` |
|
|
152
|
+
| Review and GitHub | `/review`, `/ultrareview`, `/security-review`, `/pr-comments`, `/commit`, `/commit-push-pr` |
|
|
153
|
+
| UI and integrations | `/theme`, `/color`, `/vim`, `/keybindings`, `/ide`, `/chrome`, `/desktop`, `/app`, `/mobile`, `/ios`, `/android`, `/terminal-setup`, `/web-setup` |
|
|
154
|
+
| Settings and privacy | `/config`, `/settings`, `/permissions`, `/allowed-tools`, `/privacy-settings`, `/memory`, `/sandbox` |
|
|
155
|
+
| Diagnostics and optional utilities | `/heapdump`, `/voice`, `/feedback`, `/bug`, `/release-notes`, `/install-slack-app`, `/install-github-app`, `/stickers`, `/insights`, `/think-back`, `/thinkback-play`, `/btw`, `/fast`, `/passes`, `/init`, `/init-verifiers` |
|
|
156
|
+
|
|
157
|
+
Use `/help` in the TUI for command availability in the current build.
|
|
158
|
+
|
|
159
|
+
## Models And Routing
|
|
160
|
+
|
|
161
|
+
CCL accepts model aliases such as `sonnet` or `opus` and gateway model names such
|
|
162
|
+
as `deepseek-v4-pro` or `kimi-for-coding`. The actual available gateway models
|
|
163
|
+
are determined by the connected gateway.
|
|
164
|
+
|
|
165
|
+
Useful controls:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
/model [model]
|
|
169
|
+
/endpoint
|
|
170
|
+
/priority [quality|cost]
|
|
171
|
+
/effort [low|medium|high|max]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
For one-off runs:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
ccl -p "summarize this diff" --model sonnet
|
|
178
|
+
ccl -p "generate a migration plan" --model deepseek-v4-pro --effort high
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Workflows
|
|
182
|
+
|
|
183
|
+
The `workflow` command and `/workflows` slash command run multi-step task
|
|
184
|
+
automation.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
ccl workflow run <name-or-path>
|
|
188
|
+
ccl workflow run <name-or-path> --params '{"out":"report.md"}' --json
|
|
189
|
+
ccl workflow run <name-or-path> --dry-run
|
|
190
|
+
ccl workflow validate <name-or-path>
|
|
191
|
+
ccl workflow generate "create a regression audit workflow"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Inside the TUI:
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
/workflows
|
|
198
|
+
/workflows new <goal>
|
|
199
|
+
/workflows --tail [runId]
|
|
200
|
+
/workflows --inspect [runId]
|
|
201
|
+
/workflows --json [runId]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## SDK
|
|
205
|
+
|
|
206
|
+
The package exports an embeddable SDK at `@margay/ccl-core/sdk`. It runs the CLI
|
|
207
|
+
as a managed subprocess and exposes stream events, permission interception,
|
|
208
|
+
session resume, pending approval, and usage accumulation.
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import { query, resumeWithDecision } from '@margay/ccl-core/sdk'
|
|
212
|
+
|
|
213
|
+
for await (const event of query('inspect the workspace', {
|
|
214
|
+
cwd: '/srv/workspace',
|
|
215
|
+
model: 'deepseek-v4-pro',
|
|
216
|
+
maxTurns: 30,
|
|
217
|
+
canUseTool: async (toolName) =>
|
|
218
|
+
toolName === 'Bash' ? { behavior: 'pending' } : { behavior: 'allow' },
|
|
219
|
+
})) {
|
|
220
|
+
if (event.type === 'suspended') {
|
|
221
|
+
// render approval UI, then later call resumeWithDecision(...)
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
SDK references:
|
|
227
|
+
|
|
228
|
+
- [sdk/README.md](./sdk/README.md)
|
|
229
|
+
- [sdk/API.md](./sdk/API.md)
|
|
230
|
+
|
|
231
|
+
## Configuration And Environment
|
|
232
|
+
|
|
233
|
+
| Variable | Purpose |
|
|
234
|
+
|---|---|
|
|
235
|
+
| `CCL_GATEWAY_URL`, `CCL_GATEWAY_KEY` | Margay gateway URL and token |
|
|
236
|
+
| `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` | Direct Anthropic API-key channel |
|
|
237
|
+
| `CCL_MODEL` | Default model |
|
|
238
|
+
| `CCL_ROUTING_PRIORITY` | Default routing preference, usually `cost` or `quality` |
|
|
239
|
+
| `CCL_PRINT_MAX_TURNS` | Default `--max-turns` for `--print` |
|
|
240
|
+
| `CCL_LOG` | SDK or provider logging level |
|
|
241
|
+
| `CCL_SDK_CLI_PATH` | CLI path used by the SDK |
|
|
242
|
+
| `CCL_SDK_STORE_DIR` | SDK file store directory |
|
|
243
|
+
|
|
244
|
+
Config locations:
|
|
245
|
+
|
|
246
|
+
| Path | Purpose |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `~/.ccl/gateway.json` | Saved gateway connection |
|
|
249
|
+
| `~/.ccl/endpoints.json` | Optional endpoint definitions |
|
|
250
|
+
| `~/.ccl/workflows/` | User workflow specs |
|
|
251
|
+
| `~/.ccl/debug/` | Debug log files |
|
|
252
|
+
| `~/.ccl/sdk-store/` | Default SDK store |
|
|
253
|
+
|
|
254
|
+
## Safety Notes
|
|
255
|
+
|
|
256
|
+
- Do not publish real gateway URLs, personal tokens, API keys, or shared team
|
|
257
|
+
keys in documentation.
|
|
258
|
+
- Use placeholders such as `<GATEWAY_URL>`, `<GATEWAY_TOKEN>`, and
|
|
259
|
+
`<ANTHROPIC_API_KEY>`.
|
|
260
|
+
- Only use `--dangerously-skip-permissions` or `--permission-mode
|
|
261
|
+
bypassPermissions` inside isolated sandboxes.
|
|
262
|
+
- Treat old files under `docs/` that are not linked from [docs/index.md](./docs/index.md)
|
|
263
|
+
as historical reports, not current setup instructions.
|
|
264
|
+
|
|
265
|
+
## Troubleshooting
|
|
266
|
+
|
|
267
|
+
| Symptom | Check |
|
|
268
|
+
|---|---|
|
|
269
|
+
| `ccl` cannot authenticate | Run `/doctor`, `/gateway doctor`, or `/login` |
|
|
270
|
+
| Gateway status differs between shells | Check exported `CCL_GATEWAY_URL` and `CCL_GATEWAY_KEY` versus `~/.ccl/gateway.json` |
|
|
271
|
+
| A model name fails | Run `/model` or query the gateway's model list |
|
|
272
|
+
| `--print` runs too long | Set `--max-turns`, `--max-budget-usd`, or `CCL_PRINT_MAX_TURNS` |
|
|
273
|
+
| Tool permission prompts block automation | Use `--allowedTools`, `--disallowedTools`, `--permission-mode`, or the SDK `canUseTool` callback |
|
|
274
|
+
| MCP servers behave unexpectedly | Run `ccl doctor` from a trusted directory and inspect `--mcp-config` inputs |
|
|
275
|
+
|
|
276
|
+
## Source Of Truth
|
|
277
|
+
|
|
278
|
+
The current authoritative documentation set is:
|
|
279
|
+
|
|
280
|
+
- [README.md](./README.md): package entry point and feature map.
|
|
281
|
+
- [QUICKSTART.md](./QUICKSTART.md): shortest working setup.
|
|
282
|
+
- [docs/index.md](./docs/index.md): official documentation information architecture.
|
|
283
|
+
- [docs/gateway-quickstart.md](./docs/gateway-quickstart.md): current gateway setup.
|
|
284
|
+
- [sdk/README.md](./sdk/README.md) and [sdk/API.md](./sdk/API.md): SDK contract.
|
|
285
|
+
- [docs/official-docs-coverage-matrix.json](./docs/official-docs-coverage-matrix.json):
|
|
286
|
+
inventory and classification matrix for current and historical docs.
|