@cogitator-ai/cli 0.5.19 → 0.6.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 +105 -44
- package/dist/commands/add.d.ts +11 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +79 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/assistant.d.ts.map +1 -1
- package/dist/commands/assistant.js +14 -12
- package/dist/commands/assistant.js.map +1 -1
- package/dist/commands/build.d.ts +16 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +53 -48
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +17 -13
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/deploy.d.ts +59 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +181 -99
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +14 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +84 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +52 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/eval.d.ts +12 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/eval.js +90 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/init.d.ts +10 -33
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +89 -321
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +9 -6
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/mcp.d.ts +18 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +155 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +43 -15
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/run.d.ts +17 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +75 -28
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +23 -23
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/status.d.ts +21 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +64 -39
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +26 -24
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/wizard.d.ts.map +1 -1
- package/dist/commands/wizard.js +5 -0
- package/dist/commands/wizard.js.map +1 -1
- package/dist/index.js +9 -42
- package/dist/index.js.map +1 -1
- package/dist/program.d.ts +4 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +61 -0
- package/dist/program.js.map +1 -0
- package/dist/utils/add.d.ts +81 -0
- package/dist/utils/add.d.ts.map +1 -0
- package/dist/utils/add.js +151 -0
- package/dist/utils/add.js.map +1 -0
- package/dist/utils/cli.d.ts +49 -0
- package/dist/utils/cli.d.ts.map +1 -0
- package/dist/utils/cli.js +106 -0
- package/dist/utils/cli.js.map +1 -0
- package/dist/utils/docs.d.ts +39 -0
- package/dist/utils/docs.d.ts.map +1 -0
- package/dist/utils/docs.js +198 -0
- package/dist/utils/docs.js.map +1 -0
- package/dist/utils/doctor.d.ts +41 -0
- package/dist/utils/doctor.d.ts.map +1 -0
- package/dist/utils/doctor.js +378 -0
- package/dist/utils/doctor.js.map +1 -0
- package/dist/utils/evals.d.ts +50 -0
- package/dist/utils/evals.d.ts.map +1 -0
- package/dist/utils/evals.js +78 -0
- package/dist/utils/evals.js.map +1 -0
- package/dist/utils/ollama.d.ts +5 -0
- package/dist/utils/ollama.d.ts.map +1 -1
- package/dist/utils/ollama.js +13 -5
- package/dist/utils/ollama.js.map +1 -1
- package/dist/utils/provider-models.d.ts +8 -2
- package/dist/utils/provider-models.d.ts.map +1 -1
- package/dist/utils/provider-models.js +32 -52
- package/dist/utils/provider-models.js.map +1 -1
- package/dist/utils/registry-worker.d.ts +2 -0
- package/dist/utils/registry-worker.d.ts.map +1 -0
- package/dist/utils/registry-worker.js +35 -0
- package/dist/utils/registry-worker.js.map +1 -0
- package/dist/utils/registry.d.ts +19 -0
- package/dist/utils/registry.d.ts.map +1 -0
- package/dist/utils/registry.js +58 -0
- package/dist/utils/registry.js.map +1 -0
- package/package.json +16 -10
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @cogitator-ai/cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for the Cogitator AI agent runtime. Scaffold
|
|
3
|
+
Command-line interface for the Cogitator AI agent runtime. Scaffold projects and grow them with `cogitator add`, debug them in Cogitator Studio, give coding agents the docs over MCP, check that a project can run, score it with evals, run assistants in the foreground or as a background service, chat with agents from the terminal, manage Ollama models and Docker services, and deploy.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -26,9 +26,10 @@ cogitator wizard # answers → cogitator.yml + .env
|
|
|
26
26
|
cogitator up # run it
|
|
27
27
|
|
|
28
28
|
# B) Code-first project
|
|
29
|
-
cogitator init my-assistant
|
|
29
|
+
npx create-cogitator-app my-assistant # or: cogitator init my-assistant for a messaging bot
|
|
30
30
|
cd my-assistant
|
|
31
|
-
pnpm dev
|
|
31
|
+
pnpm dev
|
|
32
|
+
cogitator dev # Cogitator Studio: chat, traces, approvals, workflows, forks
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
Quick one-off chat with any model:
|
|
@@ -41,56 +42,111 @@ cogitator run -m ollama/llama3.1:8b "What is the capital of France?"
|
|
|
41
42
|
|
|
42
43
|
## Commands
|
|
43
44
|
|
|
44
|
-
| Command
|
|
45
|
-
|
|
|
46
|
-
| `cogitator init [name]`
|
|
47
|
-
| `cogitator
|
|
48
|
-
| `cogitator
|
|
49
|
-
| `cogitator
|
|
50
|
-
| `cogitator
|
|
51
|
-
| `cogitator
|
|
52
|
-
| `cogitator
|
|
53
|
-
| `cogitator
|
|
54
|
-
| `cogitator
|
|
55
|
-
| `cogitator
|
|
56
|
-
| `cogitator
|
|
57
|
-
| `cogitator
|
|
58
|
-
| `cogitator
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
| Command | Description |
|
|
46
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
47
|
+
| `cogitator init [name]` | Scaffold a messaging assistant project (the `channels` preset of create-cogitator-app) |
|
|
48
|
+
| `cogitator add [features]` | Add rag, mcp, workflows, evals, memory, deploy and the other generated features to a project |
|
|
49
|
+
| `cogitator dev` | Open Cogitator Studio for the project |
|
|
50
|
+
| `cogitator mcp` | Serve the Cogitator docs and the project to coding agents over MCP (stdio) |
|
|
51
|
+
| `cogitator doctor` | Check that a project can run: Node, packages, config, keys, models and services |
|
|
52
|
+
| `cogitator eval [files]` | Run the eval suites and fail when an assertion fails |
|
|
53
|
+
| `cogitator wizard` | Interactive setup that writes `cogitator.yml` + `.env` |
|
|
54
|
+
| `cogitator up` | Run the assistant from `cogitator.yml`, or start Docker services |
|
|
55
|
+
| `cogitator down` | Stop Docker Compose services |
|
|
56
|
+
| `cogitator assistant` | Run a gateway module (`src/gateway.ts`) with a live dashboard |
|
|
57
|
+
| `cogitator run [msg]` | Chat with an agent (one-shot or interactive REPL) |
|
|
58
|
+
| `cogitator build` | Bundle a gateway into a self-starting `dist/cogitator.mjs` |
|
|
59
|
+
| `cogitator daemon <cmd>` | Run in the background / install as a launchd or systemd service |
|
|
60
|
+
| `cogitator skill <cmd>` | Create, validate, install and remove skills |
|
|
61
|
+
| `cogitator models` | List or pull Ollama models |
|
|
62
|
+
| `cogitator status` | Show Docker Compose and Ollama status (alias: `ps`) |
|
|
63
|
+
| `cogitator logs` | View Docker Compose service logs |
|
|
64
|
+
| `cogitator deploy` | Deploy with Docker or Fly.io (see [`@cogitator-ai/deploy`](https://www.npmjs.com/package/@cogitator-ai/deploy)) |
|
|
65
|
+
|
|
66
|
+
Every command ends with examples in its `--help`.
|
|
67
|
+
|
|
68
|
+
### Output and exit codes
|
|
69
|
+
|
|
70
|
+
Every command exits with `0` when it did what was asked, `1` when it could not (a failed check, deploy or install, a missing service) and `2` when the command line is wrong (an unknown option, command or value, with the closest valid name). Failures print the message and what to do about it on stderr; `COGITATOR_DEBUG=1` adds the stack trace. With `--json` (`add`, `doctor`, `eval`, `models`, `status`, `deploy`) the result goes to stdout as JSON, and a failure as `{ "ok": false, "error": { "message", "exitCode", "hints" } }`.
|
|
61
71
|
|
|
62
72
|
---
|
|
63
73
|
|
|
64
74
|
### cogitator init
|
|
65
75
|
|
|
66
|
-
Creates a
|
|
76
|
+
Creates a messaging assistant project: the `channels` preset of [create-cogitator-app](https://www.npmjs.com/package/create-cogitator-app), generated by the same engine, with the provider, model, channels and memory you choose.
|
|
67
77
|
|
|
68
78
|
```bash
|
|
69
79
|
cogitator init my-assistant # prompts for provider, model, channels, memory
|
|
70
|
-
cogitator init my-assistant --no-install
|
|
80
|
+
cogitator init my-assistant --no-install --no-git --no-telemetry
|
|
71
81
|
```
|
|
72
82
|
|
|
73
|
-
The prompts cover the LLM provider (Anthropic, OpenAI, Google or Ollama) and model, channels (Telegram, Discord, Slack, WebChat) with their tokens, and the memory adapter. The project
|
|
83
|
+
The prompts cover the LLM provider (Anthropic, OpenAI, Google or Ollama) and model, channels (Telegram, Discord, Slack, WebChat) with their tokens, and the memory adapter (SQLite, in-memory or Postgres). Tokens and keys go to `.env` (mode 600). The project is the same as `npx create-cogitator-app my-assistant --preset channels`: the registry in `src/cogitator.ts`, tests on a mocked model, `cogitator.yml`, `AGENTS.md`, Cogitator Studio and the rest. The assistant is `src/gateway.ts`, the `gateway` export that `cogitator assistant`, `cogitator build` and `cogitator daemon` run, and `src/index.ts` starts it for `dev` and `start`.
|
|
74
84
|
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### cogitator add
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cogitator add rag # answers grounded in docs/
|
|
91
|
+
cogitator add workflows evals # two features at once
|
|
92
|
+
cogitator add --memory postgres # switch the memory adapter
|
|
93
|
+
cogitator add --deploy docker --dry-run # every diff, nothing written
|
|
94
|
+
cogitator add --agent claude # MCP config and skill for Claude Code
|
|
75
95
|
```
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
|
|
97
|
+
Grows a project created by create-cogitator-app or `cogitator init` with the same feature modules that generated it: the project and its extended spec are both planned, and what the addition changes between them is merged into the files on disk. Files still as generated (by the hashes in `.cogitator/scaffold.json`) take the change; `package.json`, `cogitator.yml`, `docker-compose.yml` and `pnpm-workspace.yaml` merge key by key, keeping your values and comments; the managed block of `AGENTS.md` is rewritten and the rest kept; `.gitignore` gains missing lines; an edited README is left with a note. Any other file you edited that the addition changes is a conflict: nothing is written, and the change is printed as a diff. Adding what the project has is a no-op. New dependencies are installed (`--no-install` skips it), the written files formatted, and the new spec and command recorded in `package.json`.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### cogitator dev
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cogitator dev # http://localhost:4321, opens the browser
|
|
105
|
+
cogitator dev --port 4400 --no-open
|
|
106
|
+
cogitator dev --host 0.0.0.0 # reachable from your network, with a token in the URL
|
|
85
107
|
```
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
Opens [Cogitator Studio](https://www.npmjs.com/package/@cogitator-ai/studio) for the project in the current directory: chat with every agent of `src/cogitator.ts` (streamed answers, reasoning, tool calls, stop, threads), approve tool calls that need it, read the waterfall trace of each run with nested agents, tokens and cost per model call, run workflows with live node statuses and rerun them from a node, and fork a run from any step with a changed input or tool result. The project runs in a child process that reloads when you save (`--no-watch` turns it off). History lives in `.cogitator/studio/`.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### cogitator mcp
|
|
114
|
+
|
|
115
|
+
A stdio MCP server for Claude Code, Cursor and Codex, configured by `create-cogitator-app --agent` or `cogitator add --agent`:
|
|
116
|
+
|
|
117
|
+
| Tool | What it does |
|
|
118
|
+
| ----------------- | ------------------------------------------------------------------------------------------ |
|
|
119
|
+
| `search_docs` | Searches the docs bundled with the installed `@cogitator-ai/core`, best passages first |
|
|
120
|
+
| `read_doc` | Reads a page, or one section with `path#section` |
|
|
121
|
+
| `inspect_project` | The agents (model, instructions, tool schemas), workflows and swarms of `src/cogitator.ts` |
|
|
122
|
+
| `check_project` | Runs `cogitator doctor`, offline unless asked |
|
|
123
|
+
|
|
124
|
+
The registry loads in a child process, so the agent always sees the current code and the project's own output never reaches the MCP stream. The server finds the project from a subdirectory, or takes `--project <dir>`.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### cogitator doctor
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
cogitator doctor # Node, packages, cogitator.yml, keys, services, models
|
|
132
|
+
cogitator doctor --offline # no provider or service probes
|
|
133
|
+
cogitator doctor --json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Checks the Node version against `engines`, the installed `@cogitator-ai/*` packages, `cogitator.yml`, the variables `src/env.ts` requires, the provider key (with a cheap call), Redis, Postgres and the other services the config uses, and the Ollama models. Each problem comes with the fix; it exits `1` when one fails.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### cogitator eval
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
cogitator eval # every evals/*.eval.ts
|
|
144
|
+
cogitator eval evals/answers.eval.ts --max-cases 5
|
|
145
|
+
cogitator eval --json --report eval-report.json # for CI
|
|
146
|
+
cogitator eval --skip-without-key # exit 0 on forks without the key
|
|
147
|
+
```
|
|
92
148
|
|
|
93
|
-
|
|
149
|
+
Runs eval suites (files exporting an `EvalSuite` from `@cogitator-ai/evals` as default) and exits `1` when an assertion fails or every case errored.
|
|
94
150
|
|
|
95
151
|
---
|
|
96
152
|
|
|
@@ -173,9 +229,9 @@ cogitator run # interactive
|
|
|
173
229
|
| `-s, --stream` | `true` | Stream response tokens |
|
|
174
230
|
| `--no-stream` | - | Disable streaming |
|
|
175
231
|
|
|
176
|
-
**Config resolution:** `-c` → `COGITATOR_CONFIG` → `cogitator.yml`, `cogitator.yaml`,
|
|
232
|
+
**Config resolution:** `-c` → `COGITATOR_CONFIG` → `cogitator.yml`, `cogitator.yaml`, `.cogitator.yml`, `.cogitator.yaml`, `cogitator.json`. The `.env` next to the file (or in the working directory without one) is loaded first, without overriding variables already set. The file is loaded with [`@cogitator-ai/config`](https://www.npmjs.com/package/@cogitator-ai/config), so `${ENV}` references and `COGITATOR_*` / provider environment variables apply even without a file. An assistant config from `cogitator wizard` is not a runtime config: `run` takes its `llm.provider` and `llm.model` as the model and everything else from the environment (`cogitator up` runs the assistant itself).
|
|
177
233
|
|
|
178
|
-
**Model resolution:** `-m` → `COGITATOR_MODEL` → `llm.defaultModel` from the config → first installed Ollama model (preferring qwen3:8b, qwen3.5:9b, llama3.1:8b, llama3:8b, gemma3:4b, gemma2:9b, mistral:7b). Ollama is reached at `llm.providers.ollama.baseUrl`, `OLLAMA_URL` or `OLLAMA_HOST`.
|
|
234
|
+
**Model resolution:** `-m` → `COGITATOR_MODEL` → `llm.defaultModel` from the config → the model of an assistant config → first installed Ollama model (preferring qwen3:8b, qwen3.5:9b, llama3.1:8b, llama3:8b, gemma3:4b, gemma2:9b, mistral:7b). Ollama is reached at `llm.providers.ollama.baseUrl`, `OLLAMA_URL` or `OLLAMA_HOST`.
|
|
179
235
|
|
|
180
236
|
Interactive commands: `/model [name]`, `/clear`, `/help`, `exit` / `quit` (Ctrl+D also exits).
|
|
181
237
|
|
|
@@ -201,7 +257,7 @@ node dist/cogitator.mjs
|
|
|
201
257
|
| `--minify` | `false` |
|
|
202
258
|
| `-q, --quiet` | `false` |
|
|
203
259
|
|
|
204
|
-
|
|
260
|
+
Only the project's own code is bundled: every package stays an import resolved from `node_modules` at runtime, since packages ship native addons (`better-sqlite3`, the `ssh2` behind the Docker sandbox) and optional drivers loaded on demand. Run the bundle where the project's dependencies are installed.
|
|
205
261
|
|
|
206
262
|
---
|
|
207
263
|
|
|
@@ -244,9 +300,10 @@ Local skills live in `./skills`, global ones in `~/.cogitator/skills`. Skill nam
|
|
|
244
300
|
cogitator models # list installed models
|
|
245
301
|
cogitator models --pull qwen2.5:0.5b # pull with progress
|
|
246
302
|
cogitator models --url http://gpu-box:11434
|
|
303
|
+
cogitator models --json # name, size and date of each model
|
|
247
304
|
```
|
|
248
305
|
|
|
249
|
-
The Ollama URL defaults to `OLLAMA_URL`, then `OLLAMA_HOST
|
|
306
|
+
The Ollama URL defaults to `OLLAMA_BASE_URL`, then `OLLAMA_URL`, then `OLLAMA_HOST` (read like Ollama reads it: port 11434 when none is given, `0.0.0.0` as `localhost`), then `http://localhost:11434`, `OLLAMA_API_KEY` is sent as a bearer token. Pull errors reported by Ollama (e.g. unknown model) fail the command.
|
|
250
307
|
|
|
251
308
|
---
|
|
252
309
|
|
|
@@ -254,6 +311,7 @@ The Ollama URL defaults to `OLLAMA_URL`, then `OLLAMA_HOST`, then `http://localh
|
|
|
254
311
|
|
|
255
312
|
```bash
|
|
256
313
|
cogitator status # compose services (state, health) + Ollama reachability
|
|
314
|
+
cogitator status --json
|
|
257
315
|
cogitator logs ollama -f -t -n 50
|
|
258
316
|
cogitator logs -n all
|
|
259
317
|
```
|
|
@@ -273,6 +331,7 @@ cogitator logs -n all
|
|
|
273
331
|
|
|
274
332
|
```bash
|
|
275
333
|
cogitator deploy --dry-run # analyze + preflight only
|
|
334
|
+
cogitator deploy --dry-run --json # the plan for scripts and CI: secrets, services, warnings, checks
|
|
276
335
|
cogitator deploy # docker: build image, start compose stack
|
|
277
336
|
cogitator deploy --target fly --region ord
|
|
278
337
|
cogitator deploy --registry ghcr.io/acme # build + push (use --no-push to skip)
|
|
@@ -283,13 +342,14 @@ cogitator deploy destroy
|
|
|
283
342
|
| Option | Description |
|
|
284
343
|
| ----------------------- | ---------------------------------------- |
|
|
285
344
|
| `-t, --target <target>` | `docker` (default) or `fly` |
|
|
286
|
-
| `-c, --config <path>` | Config file
|
|
345
|
+
| `-c, --config <path>` | Config file to deploy from |
|
|
287
346
|
| `--registry <url>` | Container registry to push to |
|
|
288
347
|
| `--no-push` | Skip pushing even when a registry is set |
|
|
289
348
|
| `--dry-run` | Show the plan without executing |
|
|
290
349
|
| `--region <region>` | Deploy region (Fly.io) |
|
|
350
|
+
| `--json` | The plan, result or status as JSON |
|
|
291
351
|
|
|
292
|
-
The plan lists detected services, required secrets (read from the environment or the project's `.env`), warnings and preflight checks. See [`@cogitator-ai/deploy`](https://www.npmjs.com/package/@cogitator-ai/deploy) and the [deploy guide](https://cogitator.app/docs/deployment/deploy-package) for details.
|
|
352
|
+
The model, memory and `deploy:` section all come from one config file: the `-c` file, else the first of `cogitator.yml`, `cogitator.yaml`, `.cogitator.yml`, `.cogitator.yaml`. The plan lists the kind (server or worker), detected services (marked as not provisioned on Fly, where `REDIS_URL` / `DATABASE_URL` are required instead), volumes, required secrets (read from the environment or the project's `.env`), warnings and preflight checks. On Docker the deploy only succeeds when the app container keeps running after it starts, otherwise its last log lines are shown. See [`@cogitator-ai/deploy`](https://www.npmjs.com/package/@cogitator-ai/deploy) and the [deploy guide](https://cogitator.app/docs/deployment/deploy-package) for details.
|
|
293
353
|
|
|
294
354
|
---
|
|
295
355
|
|
|
@@ -303,6 +363,7 @@ The plan lists detected services, required secrets (read from the environment or
|
|
|
303
363
|
| `OLLAMA_API_KEY` | `run`, `models`, `wizard` | Ollama Cloud / authenticated Ollama |
|
|
304
364
|
| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY` | `run`, `init`, `wizard` | Provider keys |
|
|
305
365
|
| `COGITATOR_DEBUG` | all | Print stack traces |
|
|
366
|
+
| `COGITATOR_TELEMETRY_DISABLED`, `DO_NOT_TRACK` | `init` | Send no anonymous usage event |
|
|
306
367
|
|
|
307
368
|
See [`@cogitator-ai/config`](https://www.npmjs.com/package/@cogitator-ai/config) and the [configuration guide](https://cogitator.app/docs/getting-started/configuration) for every `COGITATOR_*` variable.
|
|
308
369
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { type AddFlags } from '../utils/add.js';
|
|
3
|
+
export interface AddCommandFlags extends AddFlags {
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
install?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Adds features to the project in `directory` and resolves with the exit code. */
|
|
9
|
+
export declare function runAdd(directory: string, features: readonly string[], flags: AddCommandFlags): Promise<number>;
|
|
10
|
+
export declare const addCommand: Command;
|
|
11
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,iBAAiB,CAAC;AAIzB,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,mFAAmF;AACnF,wBAAsB,MAAM,CAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAMD,eAAO,MAAM,UAAU,SA6BnB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { addToProject, changesDependencies, FEATURES, installCommand, planAdd, silentLogger, } from 'create-cogitator-app';
|
|
4
|
+
import { addChangesFrom, addPlanJson, formatAddPlan, formatConflicts, } from '../utils/add.js';
|
|
5
|
+
import { examplesHelp } from '../utils/cli.js';
|
|
6
|
+
import { log } from '../utils/logger.js';
|
|
7
|
+
const consoleLogger = {
|
|
8
|
+
start: (message) => log.step(message),
|
|
9
|
+
done: (message) => log.success(message),
|
|
10
|
+
fail: (message) => log.error(message),
|
|
11
|
+
warn: (message) => log.warn(message),
|
|
12
|
+
};
|
|
13
|
+
/** Adds features to the project in `directory` and resolves with the exit code. */
|
|
14
|
+
export async function runAdd(directory, features, flags) {
|
|
15
|
+
const changes = addChangesFrom(features, flags);
|
|
16
|
+
const plan = planAdd(directory, changes);
|
|
17
|
+
const refused = plan.conflicts.length > 0;
|
|
18
|
+
if (flags.dryRun || refused || plan.upToDate) {
|
|
19
|
+
if (flags.json)
|
|
20
|
+
console.log(JSON.stringify(addPlanJson(plan), null, 2));
|
|
21
|
+
else
|
|
22
|
+
console.log(refused ? formatConflicts(plan) : formatAddPlan(plan, { diffs: true }));
|
|
23
|
+
return refused ? 1 : 0;
|
|
24
|
+
}
|
|
25
|
+
const result = await addToProject(directory, changes, {
|
|
26
|
+
install: flags.install !== false,
|
|
27
|
+
log: flags.json ? silentLogger : consoleLogger,
|
|
28
|
+
});
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
console.log(JSON.stringify(addPlanJson(result.plan, result), null, 2));
|
|
31
|
+
return result.install.status === 'failed' ? 1 : 0;
|
|
32
|
+
}
|
|
33
|
+
console.log(`\n${formatAddPlan(result.plan, { diffs: false })}\n`);
|
|
34
|
+
const steps = [];
|
|
35
|
+
if (changesDependencies(result.plan) && result.install.status !== 'done') {
|
|
36
|
+
steps.push(installCommand(result.plan.to.packageManager));
|
|
37
|
+
}
|
|
38
|
+
for (const variable of result.plan.env.filter((entry) => entry.required)) {
|
|
39
|
+
steps.push(`set ${variable.name} in .env ${chalk.dim(`(${variable.description})`)}`);
|
|
40
|
+
}
|
|
41
|
+
if (result.plan.services.length > 0) {
|
|
42
|
+
steps.push(`docker compose up -d ${result.plan.services.join(' ')}`);
|
|
43
|
+
}
|
|
44
|
+
if (steps.length > 0)
|
|
45
|
+
console.log([chalk.bold('Next'), ...steps.map((step) => ` ${step}`)].join('\n'));
|
|
46
|
+
log.success(`Added ${result.plan.summary.join(', ')}`);
|
|
47
|
+
return result.install.status === 'failed' ? 1 : 0;
|
|
48
|
+
}
|
|
49
|
+
function collect(value, previous = []) {
|
|
50
|
+
return [...previous, value];
|
|
51
|
+
}
|
|
52
|
+
export const addCommand = new Command('add')
|
|
53
|
+
.description('Add features to a project created by create-cogitator-app or cogitator init')
|
|
54
|
+
.argument('[features...]', `features to add: ${FEATURES.join(', ')}`)
|
|
55
|
+
.option('--memory <kind>', 'switch the memory adapter: memory, sqlite, postgres, redis, mongodb')
|
|
56
|
+
.option('--vector-store <store>', 'switch the RAG vector store: memory, postgres, qdrant')
|
|
57
|
+
.option('--deploy <target>', 'add deployment: docker or fly')
|
|
58
|
+
.option('--channel <name>', 'add a messaging channel to a bot (repeatable)', collect)
|
|
59
|
+
.option('--agent <name>', 'add coding agent setup: claude, cursor, codex (repeatable)', collect)
|
|
60
|
+
.option('--dry-run', 'show what would change, with diffs, without writing anything')
|
|
61
|
+
.option('--json', 'print the plan or the result as JSON')
|
|
62
|
+
.option('--no-install', 'do not install when the dependencies change')
|
|
63
|
+
.addHelpText('after', [
|
|
64
|
+
examplesHelp([
|
|
65
|
+
['cogitator add rag', 'answers grounded in docs/'],
|
|
66
|
+
['cogitator add workflows evals', 'two features at once'],
|
|
67
|
+
['cogitator add --memory postgres', 'switch memory to Postgres'],
|
|
68
|
+
['cogitator add --deploy docker --dry-run', 'see every diff first'],
|
|
69
|
+
]),
|
|
70
|
+
'',
|
|
71
|
+
'Files you edited are merged where they can be (package.json, cogitator.yml,',
|
|
72
|
+
'docker-compose.yml, the managed block of AGENTS.md, .gitignore). When the',
|
|
73
|
+
'addition needs to change a file you edited in another way, nothing is written',
|
|
74
|
+
'and the change is printed as a diff. Adding what the project has is a no-op.',
|
|
75
|
+
].join('\n'))
|
|
76
|
+
.action(async (features, flags) => {
|
|
77
|
+
process.exitCode = await runAdd(process.cwd(), features, flags);
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,OAAO,EACP,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAQzC,MAAM,aAAa,GAAmB;IACpC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IACrC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;IACvC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC;IACrC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;CACrC,CAAC;AAEF,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,S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kB,EAAE,KAAsB,EAAE,EAAE;IAC3D,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../src/commands/assistant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../src/commands/assistant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,MAAM,WAAW,WAAW;IAC1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAYlE;AAED,eAAO,MAAM,gBAAgB,SAgFzB,CAAC;AA0HL,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQ/C"}
|
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
5
|
import { log, printBanner } from '../utils/logger.js';
|
|
6
|
+
import { CommandError, exitWithFailure, examplesHelp } from '../utils/cli.js';
|
|
6
7
|
import { importUserModule } from '../utils/module-loader.js';
|
|
7
8
|
import { loadDotenvInto } from '../utils/env.js';
|
|
8
9
|
export function isGatewayLike(value) {
|
|
@@ -24,15 +25,19 @@ export const assistantCommand = new Command('assistant')
|
|
|
24
25
|
.description('Start AI assistant with live dashboard')
|
|
25
26
|
.option('-c, --config <path>', 'Path to gateway config file', 'src/gateway.ts')
|
|
26
27
|
.option('-q, --quiet', 'Minimal output (no banner, live status or hotkeys)')
|
|
28
|
+
.addHelpText('after', examplesHelp([
|
|
29
|
+
['cogitator assistant', 'start src/gateway.ts with the live dashboard'],
|
|
30
|
+
['cogitator assistant -c src/bot.ts -q', 'another config, plain output'],
|
|
31
|
+
]))
|
|
27
32
|
.action(async (options) => {
|
|
28
33
|
const quiet = options.quiet ?? false;
|
|
29
34
|
if (!quiet)
|
|
30
35
|
printBanner();
|
|
31
36
|
const configPath = resolve(process.cwd(), options.config);
|
|
32
37
|
if (!existsSync(configPath)) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
throw new CommandError(`Config not found: ${configPath}`, {
|
|
39
|
+
hints: ['Run "cogitator init" to create a project first'],
|
|
40
|
+
});
|
|
36
41
|
}
|
|
37
42
|
log.info(`Loading config from ${chalk.dim(options.config)}`);
|
|
38
43
|
loadDotenvInto(resolve(process.cwd(), '.env'), process.env);
|
|
@@ -42,21 +47,19 @@ export const assistantCommand = new Command('assistant')
|
|
|
42
47
|
gatewayExport = mod.gateway;
|
|
43
48
|
}
|
|
44
49
|
catch (err) {
|
|
45
|
-
|
|
46
|
-
process.exit(1);
|
|
50
|
+
throw new CommandError(`Failed to load config: ${err instanceof Error ? err.message : String(err)}`);
|
|
47
51
|
}
|
|
48
52
|
if (!isGatewayLike(gatewayExport)) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
throw new CommandError('Config file must export a "gateway" instance', {
|
|
54
|
+
hints: ['Example: export const gateway = new Gateway({ ... })'],
|
|
55
|
+
});
|
|
52
56
|
}
|
|
53
57
|
const gateway = gatewayExport;
|
|
54
58
|
try {
|
|
55
59
|
await gateway.start();
|
|
56
60
|
}
|
|
57
61
|
catch (err) {
|
|
58
|
-
|
|
59
|
-
process.exit(1);
|
|
62
|
+
throw new CommandError(`Failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
60
63
|
}
|
|
61
64
|
printDashboard(gateway, quiet);
|
|
62
65
|
let stopping = false;
|
|
@@ -75,8 +78,7 @@ export const assistantCommand = new Command('assistant')
|
|
|
75
78
|
process.exit(0);
|
|
76
79
|
}
|
|
77
80
|
catch (err) {
|
|
78
|
-
|
|
79
|
-
process.exit(1);
|
|
81
|
+
exitWithFailure(new CommandError(`Shutdown failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
80
82
|
}
|
|
81
83
|
};
|
|
82
84
|
process.on('SIGINT', () => void shutdown());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.js","sourceRoot":"","sources":["../../src/commands/assistant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAcjD,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC3E,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,K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;IACrC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAE7B,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC;IACrC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC;IACrC,OAAO,GAAG,CAAC,GAAG,CAAC;AACjB,CAAC"}
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
export declare const BUNDLE_EXTERNALS: string[];
|
|
3
2
|
export declare function createGatewayEntry(configPath: string): string;
|
|
3
|
+
export interface GatewayBuildOptions {
|
|
4
|
+
configPath: string;
|
|
5
|
+
outfile: string;
|
|
6
|
+
target: string;
|
|
7
|
+
sourcemap: boolean;
|
|
8
|
+
minify?: boolean;
|
|
9
|
+
quiet?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* esbuild options for a gateway bundle. The project's own code is bundled,
|
|
13
|
+
* while every package stays an import resolved from node_modules at runtime:
|
|
14
|
+
* packages ship native addons (better-sqlite3, the ssh2 behind the Docker
|
|
15
|
+
* sandbox) and optional drivers loaded on demand, which a bundle cannot
|
|
16
|
+
* carry, so the bundle runs next to the project's node_modules.
|
|
17
|
+
*/
|
|
18
|
+
export declare function gatewayBuildOptions(options: GatewayBuildOptions): Record<string, unknown>;
|
|
4
19
|
export declare const buildCommand: Command;
|
|
5
20
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiCpC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA4B7D;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2BzF;AAQD,eAAO,MAAM,YAAY,SAqFtB,CAAC"}
|