clawdi 0.12.10-beta.8 → 0.13.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 CHANGED
@@ -1,420 +1,34 @@
1
- <h1 align="center">Clawdi</h1>
1
+ # Clawdi CLI
2
2
 
3
- <p align="center">
4
- <strong>The best home for all your AI agents Projects, sessions, memory, skills, cron jobs, and app connections.</strong>
5
- </p>
3
+ This package publishes the `clawdi` command-line interface. The CLI registers
4
+ local AI agents, syncs sessions and skills, manages memory and vault workflows,
5
+ installs the MCP server, and controls the background sync daemon.
6
6
 
7
- <p align="center">
8
- <a href="https://www.npmjs.com/package/clawdi"><img src="https://img.shields.io/npm/v/clawdi?style=for-the-badge&logo=npm&color=cb3837" alt="npm version"></a>
9
- <a href="https://github.com/Clawdi-AI/clawdi/actions/workflows/cli-publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/Clawdi-AI/clawdi/cli-publish.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=white&label=CI" alt="CI status"></a>
10
- <a href="https://github.com/Clawdi-AI/clawdi/stargazers"><img src="https://img.shields.io/github/stars/Clawdi-AI/clawdi?style=for-the-badge&logo=github" alt="GitHub stars"></a>
11
- <a href="https://github.com/Clawdi-AI/clawdi/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="MIT License"></a>
12
- </p>
13
-
14
- <p align="center">
15
- <a href="https://clawdi.ai">Website</a> ·
16
- <a href="https://github.com/Clawdi-AI/clawdi">GitHub</a> ·
17
- <a href="https://deepwiki.com/Clawdi-AI/clawdi">Docs</a> ·
18
- <a href="https://www.npmjs.com/package/clawdi">npm</a> ·
19
- <a href="https://github.com/Clawdi-AI/clawdi/blob/main/docs/architecture.md">Architecture</a> ·
20
- <a href="#quickstart">Quickstart</a> ·
21
- <a href="#cli-reference">CLI Reference</a> ·
22
- <a href="#troubleshooting">Troubleshooting</a>
23
- </p>
24
-
25
- <p align="center">
26
- <img src="https://raw.githubusercontent.com/Clawdi-AI/clawdi/main/docs/images/dashboard-preview.png" alt="Clawdi dashboard" width="900">
27
- </p>
28
-
29
- > Think of Clawdi as iCloud for AI agents — install once on any device, and your Claude Code, Codex, Hermes, and OpenClaw agents share the same memory, secrets, skills, sessions, and app connections. Switch frameworks or machines; nothing gets lost.
30
-
31
- The fastest way to try it is hosted Clawdi Cloud. The whole stack is also here: MIT-licensed CLI, FastAPI backend, Next.js dashboard, database schema, migrations, and docs. Use the hosted service, self-host it, fork it, or build your own agent sync layer from the pieces.
7
+ For product usage and the full command reference, read the
8
+ [top-level README](../../README.md#quickstart). For contributor workflows, read
9
+ [`docs/cli-development.md`](../../docs/cli-development.md). For a full local
10
+ backend + dashboard + CLI stack, use the canonical runbook in
11
+ [`AGENTS.md`](../../AGENTS.md#local-end-to-end).
32
12
 
33
13
  ## Quickstart
34
14
 
35
15
  ```bash
36
16
  npm i -g clawdi
37
-
38
17
  clawdi auth login
39
18
  clawdi setup
40
19
  clawdi doctor
41
20
  ```
42
21
 
43
- That gets you:
44
-
45
- - Browser-based login to Clawdi Cloud
46
- - Agent auto-detection for Claude Code, Codex, Hermes, and OpenClaw
47
- - MCP registration so your agent can call Clawdi tools
48
- - The bundled `clawdi` skill installed into each detected agent
49
- - Background sync daemons installed and started for every registered agent
50
- - A health check that verifies auth, agent paths, vault access, and MCP config
51
-
52
- By default the CLI talks to hosted Clawdi Cloud. Want to run your own backend? See [Own the Stack](#own-the-stack).
53
-
54
- Requires Node ≥ 22.5 (the CLI uses the built-in `node:sqlite` module).
55
-
56
- You can also try without installing:
57
-
58
- ```bash
59
- npx clawdi --help
60
- ```
61
-
62
- Headless environment? Use the manual flow:
63
-
64
- ```bash
65
- clawdi auth login --manual
66
- ```
67
-
68
- ## Why Clawdi
69
-
70
- AI agents are still treated like isolated apps. Claude Code has one set of sessions and instructions. Codex has another. Secrets sit in shell profiles and `.env` files. Useful memories get trapped in whichever agent happened to learn them. App integrations get rebuilt from scratch every time you switch tools.
71
-
72
- Clawdi is the shared layer underneath:
73
-
74
- - **Cross-agent memory** — Store durable preferences, decisions, facts, and project context once. Search them from any connected agent.
75
- - **Portable skills** — Upload or install agent instructions once, then sync them into every registered agent.
76
- - **Project sharing** — Share read-only Project access from the dashboard or CLI, accept it from a share page or CLI inbox, and explicitly attach accepted Projects to Agents when they should be used at runtime.
77
- - **Session sync** — Push local session history to the dashboard for review and recall.
78
- - **Vault secrets** — Store secrets server-side, commit only `clawdi://` references, and resolve them at runtime.
79
- - **AI Providers** — Define model providers once, keep keys in env/Vault/auth profiles, and apply verified Codex, Hermes, or OpenClaw agent config without proxying BYOK model traffic.
80
- - **App connections** — Hook agents into Notion, Gmail, Drive, Calendar, Linear, GitHub, and more from the dashboard. Tools show up inside every connected agent automatically over MCP.
81
- - **MCP tools** — Memory, vault, and connector tools served through the Model Context Protocol so any MCP-aware agent can use them.
82
-
83
- In practice — teach one agent something:
84
-
85
- ```text
86
- remember that this repo uses Bun for TypeScript and PDM for backend scripts
87
- ```
88
-
89
- Later, in a different agent or a fresh session, ask "what package manager should I use here?" — it can call Clawdi memory search and answer from your actual context instead of guessing.
90
-
91
- Run a fullstack dev command with vault references without putting plaintext secrets on disk:
92
-
93
- ```bash
94
- clawdi vault set OPENAI_API_KEY --prompt
95
- printf '%s\n' "$OPENAI_API_KEY" | clawdi vault set api-service/env/OPENAI_API_KEY --stdin
96
- clawdi vault import --vault api-service --section stripe --project personal --yes .env.stripe
97
- echo "OPENAI_API_KEY=clawdi://project/<project-id>/vault/default/field/OPENAI_API_KEY" > .env.clawdi
98
- clawdi run --dry-run --env-file .env.clawdi -- npm run dev
99
- clawdi run --env-file .env.clawdi -- npm run dev
100
- clawdi read clawdi://project/<project-id>/vault/default/field/OPENAI_API_KEY
101
- clawdi inject --dry-run --in .env.clawdi --out .env.local
102
- clawdi inject --force --in .env.clawdi --out .env.local
103
- ```
104
-
105
- Vaults are account-level key bundles. Projects attach to a Vault to use the same shared key set. `clawdi vault set`, `clawdi vault import`, `clawdi vault rm`, and `clawdi vault list` print the concrete Project target or exact references that include the Project ID. `vault set` supports `--prompt` for secure one-off entry, `--stdin` for scripts, and `--value` when shell history exposure is acceptable; empty stdin is rejected unless `--allow-empty` is passed intentionally. `vault import` supports `--vault`, `--section`, `--project`, and warns about skipped invalid dotenv identifiers. Use `clawdi vault attach <vault> --project <project>` to make an existing Vault available in another Project, and `clawdi vault detach <vault> --project <project>` to remove one Project's access without deleting keys. `vault rm` deletes a key from the shared Vault; when a Vault is attached to multiple Projects, it requires `--global`. Prefer service-specific vault slugs such as `api-service` over broad environment slugs such as `prod`. Project-relative references such as `clawdi://default/OPENAI_API_KEY` still work for portable templates, but exact references are the default copy/read UX.
106
-
107
- Agents should prefer `clawdi run --env-file .env.clawdi -- <command>` when they can launch the tool themselves. Use `clawdi inject` only for tools that must read a physical `.env.local`; generated files are written owner-only and should stay gitignored.
108
-
109
- Use `--dry-run` on `clawdi read`, `clawdi inject`, `clawdi run`, and `clawdi vault resolve` to verify provenance without requesting plaintext values. `clawdi doctor` checks vault metadata only; it does not resolve stored secrets.
110
-
111
- Sync a local CLI credential profile to another machine. For Codex model-provider
112
- auth, prefer the AI Provider commands in the next section; the lower-level
113
- `agent credentials` commands remain available for compatibility and for
114
- non-provider CLI credentials such as Claude Code and GitHub CLI.
115
-
116
- ```bash
117
- clawdi agent credentials import claude-code
118
- clawdi agent credentials import gh
119
- clawdi agent credentials materialize claude-code
120
- clawdi agent credentials materialize gh
121
- ```
122
-
123
- Credential profile sync is separate from `clawdi run`: it stores and restores a supported tool's local auth file, while `run` injects explicit `clawdi://` references into one child process. Profiles default to your stable Personal Project so `import` on one machine and `materialize` on another resolve the same namespace. They are personal backup/restore artifacts: shared Project viewers and env-bound Agent keys cannot materialize them. macOS Keychain imports are guarded behind `--source keychain` and require explicit `--keychain-service` plus `--keychain-account`; Clawdi does not guess or silently scrape credential-store items, and Keychain reads cannot use `--yes`.
124
-
125
- Manage model providers without turning Clawdi into a model proxy:
126
-
127
- ```bash
128
- clawdi ai-provider add openai-main \
129
- --type openai \
130
- --default-model gpt-5.2 \
131
- --auth env:OPENAI_API_KEY \
132
- --capability chat \
133
- --capability responses \
134
- --capability tools
135
-
136
- clawdi ai-provider validate openai-main
137
- clawdi ai-provider test openai-main # config + auth availability
138
- clawdi ai-provider test openai-main --live # optional direct provider probe
139
- ```
140
-
141
- AI Provider metadata lives in `~/.clawdi/ai-providers/catalog.json`; API keys do not. Use `env:...` refs, `clawdi://...` Vault refs, `none` for local unauthenticated endpoints, or a verified auth profile such as `agent:codex/default`. BYOK model requests still go directly from the agent runtime to OpenAI, Anthropic, OpenRouter, Gemini, Mistral, or your compatible endpoint.
142
-
143
- Apply provider config explicitly, with a dry run first:
144
-
145
- ```bash
146
- clawdi ai-provider apply openai-main --dry-run
147
- clawdi ai-provider apply openai-main
148
- codex --profile clawdi-ai-provider
149
-
150
- clawdi ai-provider apply openai-main --target hermes --dry-run
151
- clawdi ai-provider apply openai-main --target openclaw --dry-run
152
- ```
153
-
154
- Codex OAuth is managed through the AI Provider surface:
155
-
156
- ```bash
157
- clawdi ai-provider add openai-codex \
158
- --type openai \
159
- --default-model gpt-5-codex \
160
- --auth agent:codex/default
161
- clawdi ai-provider connect openai-codex --tool codex
162
- clawdi ai-provider apply openai-codex
163
- ```
164
-
165
- `apply openai-codex` writes compatible target config and materializes the Codex
166
- OAuth profile into each selected target's native auth store. For the default
167
- target set, that means `$CODEX_HOME/auth.json`, `$HERMES_HOME/auth.json`, and
168
- OpenClaw's `agents/<agentId>/agent/auth-profiles.json`. Those projections do
169
- not write API key refs for OAuth-backed providers.
170
-
171
- Use `clawdi ai-provider connect ... --callback manual` in headless environments. Export/import is metadata-only by default; `--include-secrets` requires passphrase-encrypted secret export.
172
-
173
- Current vault storage is server-managed encryption. Clawdi avoids plaintext secrets in repo files and local templates, but the backend can decrypt stored vault values and credential profiles today. Do not treat this release as zero-knowledge.
174
-
175
- Install a shared skill into every registered agent at once:
176
-
177
- ```bash
178
- clawdi skill install anthropics/skills/artifacts-builder
179
- ```
180
-
181
- ## Roadmap
182
-
183
- Today Clawdi gives individuals and read-only Project collaborators a shared layer across their agents. Two bigger bets come next.
184
-
185
- The first is autonomy. Agents should work without you at the keyboard.
186
-
187
- - Cron jobs for recurring agent runs.
188
- - Remote control for agents on any of your machines.
189
- - Automatic memory built from session history.
190
-
191
- The second is deepening multi-player workflows beyond read-only Project sharing.
192
-
193
- - Richer team roles and broader access controls.
194
- - Shared memory, skills, and connections.
195
- - An agent-to-agent channel for handoff and ask-for-help.
196
- - Task tracking that every connected agent can use.
197
-
198
- We'll also keep adding adapters. Cursor, OpenCode, Amp, Pi, and others. The same memory, skills, and connections follow you everywhere.
199
-
200
- Want any of this sooner? [Open an issue](https://github.com/Clawdi-AI/clawdi/issues). What's loud is what we build first.
201
-
202
- ## Hosted or Self-Hosted
203
-
204
- Clawdi has two intended paths.
205
-
206
- ### Use Clawdi Cloud
207
-
208
- Best for trying it in minutes.
209
-
210
- ```bash
211
- npm i -g clawdi
212
- clawdi auth login
213
- clawdi setup
214
- ```
215
-
216
- The published CLI defaults to the hosted API. You get the least setup friction and can focus on wiring agents, memories, skills, and vault secrets.
217
-
218
- ### Own the Stack
219
-
220
- Best when you want to inspect, modify, self-host, or build on Clawdi.
221
-
222
- ```bash
223
- git clone https://github.com/Clawdi-AI/clawdi.git
224
- cd clawdi
225
- bun install
226
- docker compose up -d postgres
227
- ```
228
-
229
- Then run the backend and dashboard locally:
230
-
231
- ```bash
232
- cd backend
233
- cp .env.example .env
234
- pdm install
235
- pdm migrate
236
- pdm dev
237
- ```
238
-
239
- ```bash
240
- cd ../apps/web
241
- cp .env.example .env.local
242
- bun run dev
243
- ```
244
-
245
- Point your CLI at your local backend:
246
-
247
- ```bash
248
- clawdi config set apiUrl http://localhost:8000
249
- ```
250
-
251
- Local self-hosting currently expects:
252
-
253
- - Node.js 22.5+ and Bun 1.3+
254
- - Python 3.12 with PDM
255
- - PostgreSQL 16 with `pg_trgm` and `pgvector`
256
- - Clerk keys for dashboard auth
257
- - Two generated encryption keys for vault data and MCP bridge JWTs
258
-
259
- See [`backend/.env.example`](https://github.com/Clawdi-AI/clawdi/blob/main/backend/.env.example) and [`apps/web/.env.example`](https://github.com/Clawdi-AI/clawdi/blob/main/apps/web/.env.example) for the exact environment variables.
260
-
261
- ## What Is In This Repo
262
-
263
- ```text
264
- apps/web/ Next.js 16 dashboard with Clerk auth, shadcn/ui, Tailwind v4
265
- packages/cli/ Published `clawdi` CLI, agent adapters, and MCP server
266
- packages/shared/ Shared API types, schemas, and constants
267
- backend/ FastAPI backend, SQLAlchemy models, Alembic migrations
268
- docs/ Architecture notes, scenarios, and development guides
269
- ```
270
-
271
- The system is deliberately boring where it should be:
272
-
273
- - FastAPI API server
274
- - PostgreSQL for structured data and memory search
275
- - File storage for session and skill bodies
276
- - Local CLI state under `~/.clawdi`
277
- - MCP stdio server spawned by each agent
278
- - No Redis, Celery, or hidden worker fleet required for the core local stack
279
-
280
- For the deeper map, read [`docs/architecture.md`](https://github.com/Clawdi-AI/clawdi/blob/main/docs/architecture.md).
281
-
282
- ## Supported Agents
283
-
284
- | Agent | Sessions | Skills | MCP setup |
285
- | --- | --- | --- | --- |
286
- | Claude Code | Yes | Yes | Automatic |
287
- | Codex | Yes | Yes | Automatic |
288
- | Hermes | Yes | Yes | Automatic |
289
- | OpenClaw | Yes | Yes | Manual MCP hint where required |
290
-
291
- Each agent has a dedicated adapter in [`packages/cli/src/adapters`](https://github.com/Clawdi-AI/clawdi/tree/main/packages/cli/src/adapters). Adding another agent means implementing the same adapter shape: detect it, read sessions, read/write skills, and define how commands run with injected env.
292
-
293
- ## CLI Reference
294
-
295
- | Command | What it does |
296
- | --- | --- |
297
- | `clawdi auth login` / `logout` | Authenticate this machine |
298
- | `clawdi auth status [--json]` | Show credential source without printing secrets |
299
- | `clawdi status [--json]` | Show auth and sync state |
300
- | `clawdi config list/get/set/unset/paths` | Read/write CLI configuration and inspect local/runtime paths |
301
- | `clawdi setup [--agent <type>] [--no-daemon]` | Register local agents, install MCP, install the bundled skill, and install/start the singleton daemon by default |
302
- | `clawdi teardown [--agent <type>]` | Remove Clawdi's local agent wiring |
303
- | `clawdi daemon run/install/status/logs/doctor/restart/uninstall/ping/rotate-token` | Run, inspect, and control the singleton background sync daemon (`serve` remains a legacy alias) |
304
- | `clawdi push` | Upload sessions and skills |
305
- | `clawdi pull` | Download cloud skills into registered agents |
306
- | `clawdi session list/extract` | Inspect local agent sessions |
307
- | `clawdi memory list/search/add/rm` | Manage cross-agent long-term memory |
308
- | `clawdi skill list/add/install/rm/init` | Manage portable skills |
309
- | `clawdi project create/list/show/share/share-links/invite/invites/members/leave/unshare` | Manage Projects and read-only sharing |
310
- | `clawdi inbox [accept/decline/forget]` | Accept invitations and share links |
311
- | `clawdi agent projects list/attach/detach/move` | View the fixed Agent Project and manage attached Projects |
312
- | `clawdi agent credentials import/materialize` | Compatibility backup/restore for local CLI credential profiles; use `ai-provider import-auth/connect/materialize-auth` for Codex provider auth |
313
- | `clawdi ai-provider list/add/edit/remove/validate/test/connect/import-auth/materialize-auth/apply/status/export/import` | Manage reusable AI Providers, provider auth, and verified agent config application |
314
- | `clawdi project folder link/status/unlink` | Link a local folder to a Project for vault reference selection |
315
- | `clawdi vault set/list/import/attach/detach/rm` | Manage encrypted secrets, Project access, and copy exact references |
316
- | `clawdi read <clawdi://...>` | Explicitly print one vault reference value |
317
- | `clawdi inject --in <file> --out <file>` | Render `clawdi://` references into templates |
318
- | `clawdi run --env-file <file> -- <cmd>` | Run a command with explicit vault references resolved |
319
- | `clawdi doctor` | Diagnose auth, agent paths, vault, and MCP config |
320
- | `clawdi update` | Install the latest CLI version (`--check` only reports) |
321
- | `clawdi mcp` | Start the MCP stdio server used by agents |
322
-
323
- Auto-update is enabled by default for all newer releases, including majors. Human CLI invocations update the global CLI in the background; installed daemons check on their own cadence, install silently, then let launchd/systemd restart them onto the new code. Disable both with `CLAWDI_NO_AUTO_UPDATE=1` or `clawdi config set autoUpdate false`.
324
-
325
- Every command supports `--help`.
326
-
327
- ### Advanced Runtime Operators
328
-
329
- These commands are for controlled hosted or self-hosted runtime envelopes. They
330
- are not part of normal laptop onboarding.
331
-
332
- | Command | What it does |
333
- | --- | --- |
334
- | `clawdi capabilities [--json]` | Show CLI feature surface, runtime mode, and hosted policy restrictions |
335
- | `clawdi runtime init --non-interactive [--json]` | Run one cloud-init-style hosted runtime convergence pass |
336
- | `clawdi runtime status [--json]` | Read the last runtime boot result from service-state files |
337
- | `clawdi runtime doctor [--json]` | Diagnose hosted policy, service state, HOME, tmpfs runtime state, and last boot status |
338
-
339
- Hosted runtime mode is detected from host policy or runtime credentials. In
340
- hosted mode, `/etc/clawdi/host-policy.json` can deny local-user commands such
341
- as `setup`, `teardown`, `update`, `config set`, and `auth login`, while keeping
342
- agent-facing commands such as `mcp`, `daemon run`, `read`, `inject`, and `run`
343
- available. Local self-update is skipped in hosted mode; hosted CLI updates are
344
- expected to be system-managed through the standard npm package installation.
345
- The target hosted shape is a read-only `/usr/local/bin/clawdi` launcher shim
346
- that installs/execs the npm-managed entrypoint at `/var/lib/clawdi/bin/clawdi`
347
- from the root-owned prefix `/var/lib/clawdi/npm`. The ordinary runtime user can
348
- execute the CLI but cannot modify the managed install or config.
349
-
350
- For the hosted runtime design, profile matrix, and runtime image contract, see
351
- [`docs/hosted-runtime.md`](https://github.com/Clawdi-AI/clawdi/blob/main/docs/hosted-runtime.md).
352
-
353
- App connections are configured in the [Clawdi Cloud dashboard](https://clawdi.ai) and surface inside agents automatically over MCP — there is no CLI command to manage them.
354
-
355
22
  ## Development
356
23
 
357
- Install dependencies:
24
+ From the repository root:
358
25
 
359
26
  ```bash
360
27
  bun install
361
- ```
362
-
363
- Run the web app and workspace dev tasks:
364
-
365
- ```bash
366
- bun run dev
367
- ```
368
-
369
- Run the backend:
370
-
371
- ```bash
372
- cd backend
373
- pdm dev
374
- ```
375
-
376
- Run checks:
377
-
378
- ```bash
379
- bun run check
380
- bun run typecheck
381
-
382
- cd backend
383
- pdm lint
384
- pdm test
385
- ```
386
-
387
- Run the CLI from source:
388
-
389
- ```bash
390
28
  bun run packages/cli/src/index.ts --help
29
+ bun run --cwd packages/cli typecheck
30
+ bun run --cwd packages/cli test
31
+ bun run --cwd packages/cli build
391
32
  ```
392
33
 
393
- Build and link the CLI locally:
394
-
395
- ```bash
396
- cd packages/cli
397
- bun run build
398
- bun link
399
- clawdi --version
400
- ```
401
-
402
- ## Troubleshooting
403
-
404
- Run the diagnostic first:
405
-
406
- ```bash
407
- clawdi doctor
408
- ```
409
-
410
- Common issues:
411
-
412
- - **`clawdi auth login` fails** - Re-run login, or use `clawdi auth login --manual` in headless environments.
413
- - **No supported agent detected** - Install a supported agent or pass `--agent claude_code`, `--agent codex`, `--agent hermes`, or `--agent openclaw`.
414
- - **Memory search is empty** - Add a memory first with `clawdi memory add "..."`, then verify with `clawdi memory search "..."`.
415
- - **Local backend cannot start because `vector` is missing** - Install `pgvector` for your PostgreSQL 16 instance, or use the included Docker Compose database.
416
- - **Agent MCP tools look stale** - Run `clawdi setup --agent <type>` again, then `clawdi daemon restart`.
417
-
418
- ## License
419
-
420
- MIT. See [`LICENSE`](https://github.com/Clawdi-AI/clawdi/blob/main/LICENSE).
34
+ The package manager is Bun; do not use `pdm` for CLI dependencies or tests.