@team-ai/teamai-cli 0.30.4 → 0.40.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-ai/teamai-cli",
3
- "version": "0.30.4",
3
+ "version": "0.40.0",
4
4
  "description": "TeamAI — Make Every Team AI Native (skill sync + shared knowledge base, powered by Git)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -147,7 +147,9 @@ scripts, and with it `teamai doctor` advises), beside any `core.hooksPath` manag
147
147
  worktree is created by `git worktree add` or an app that runs checkout hooks, it creates the project roots
148
148
  of `enabledAgents` (else the ones the main checkout has) and pulls into it before
149
149
  the command returns, from the team clone as last fetched when that was within
150
- 24 h; a full pull then runs in the background. A branch switch does nothing.
150
+ 24 h; a full pull then runs in the background. A worktree an agent tool creates without git hooks
151
+ (Claude Code's `EnterWorktree`, Codex CLI) is prepared the same way, in the background, on the first
152
+ session start or tool use there. A branch switch does nothing.
151
153
  After `git pull` (merge or a completed rebase) it fetches the team repo (5 s cap, then the background pull) and
152
154
  delivers; in single-repo mode it delivers what `git pull` brought, offline. It prints nothing and always
153
155
  exits 0; a failure inside it is recorded, and `teamai doctor` names it (`Last git
@@ -22,7 +22,7 @@ Generated: do not edit by hand. Regenerate with
22
22
  - `--http <url>` — Git-free HTTP team repo (read-only consumer; only needs an API key)
23
23
  - `--provider <name>` — Git provider for the team repo on this machine: tgit, github, cnb, gitlab, gitcode, or git. Skips auto-detection. `git` uses your existing Git auth and needs no platform token, but opens no PR/MR.
24
24
  - `--self` — Single-repo mode: the current git repo is the team repo (equivalent to `teamai init .`). Knowledge lives on main under .teamai/; reports go to the teamai-reports orphan branch.
25
- - `--token <key>` — API key for HTTP team repo / status reporting (stored 0600, never committed). Also reads TEAMAI_API_TOKEN.
25
+ - `--token <key>` — API key for HTTP team repo / status reporting (stored 0600, never committed). Also reads TEAMAI_API_TOKEN. With --http and a single --agent, an agent access token (sk-) is kept for that agent only, next to the other agents' tokens (--force keeps them too); while that agent's current token still works it is kept and the new one is not used.
26
26
  - `--scope <scope>` — Install scope: workspace (default, <cwd>/.teamai + <cwd>/.claude) or user (~/.teamai + ~/.claude); project is the older name for workspace
27
27
  - `--inherit-user-scope` — In workspace scope, also sync safe user-scope resources, load its env variables (not its secrets) in the workspace, and search its knowledge
28
28
  - `--no-inherit-user-scope` — Disable user-scope inheritance for this workspace
@@ -40,6 +40,7 @@ Generated: do not edit by hand. Regenerate with
40
40
  - `--project <id>` — Target a project: each new resource goes to that project's namespace for its own type — skills, knowledge for rules, agents, learnings, docs, env, hooks, mcp, models, and more (from manifest/projects.yaml)
41
41
  - `--shared` — Place new resources at the shared root for all roles; cannot combine with --role or --project
42
42
  - `--branch <name>` — Push to this destination branch instead of a generated teamai/push branch
43
+ - `--carried <path@blob>` — Override the stop for a push that would overwrite or delete a placed agent file a teammate changed. Use it only after carrying that change into your root copy, with the value the stop printed; a later team edit stops the push again. Repeatable
43
44
 
44
45
  ## pull
45
46
 
@@ -102,7 +103,7 @@ Generated: do not edit by hand. Regenerate with
102
103
 
103
104
  ## doctor
104
105
 
105
- - `teamai doctor` — Diagnose configuration issues
106
+ - `teamai doctor` — Diagnose configuration issues, and print the run mode (attended or unattended) and what set it: TEAMAI_MODE, CI, or the default
106
107
  - `--json` — Output the report as JSON (suitable for CI)
107
108
  - `--fix` — Remove lock files left behind by dead processes
108
109
 
@@ -175,6 +176,7 @@ Generated: do not edit by hand. Regenerate with
175
176
  - `teamai source remove <name>` — Remove a source and clean up its skills
176
177
  - `teamai source add-http <endpoint>` — Add an HTTP source (report/sync/ack) alongside a git main repo
177
178
  - `--token <key>` — API token for the HTTP endpoint (stored 0600, never committed)
179
+ - `--agent <name>` — The AI tool this token is for (e.g. codebuddy, claude); hooks are injected into that tool only. An agent access token (sk-) works for one agent only, so each agent keeps its own; while that agent's current token still works it is kept and the new one is not used.
178
180
  - `--force` — Overwrite an existing HTTP source config
179
181
  - `teamai source remove-http` — Remove the HTTP source and clean up its resources
180
182
  - `teamai source list` — List all configured sources
@@ -281,7 +283,7 @@ Generated: do not edit by hand. Regenerate with
281
283
  - `--pass <n>` — With --run: the pass to judge; default the step's latest succeeded pass
282
284
  - `--session <id>` — Judge this finished session of an agent tool on this machine, whatever sampling says, with --scorer. Prints the session's first prompt and directory first, then the label; the session and the judge's reasoning are never published.
283
285
  - `--source <platform>` — With --session: the tool that holds it, as session migrate --source names it (claude-code, codex, opencode, …); needed unless the agent session variable names that session, or the captures its session-start hook wrote here name one platform for it
284
- - `--scorer <name>` — With --run: a scorer the run pinned or one teamai pull cached. With --session, or alone inside a session: a scorer teamai pull cached. Repeatable.
286
+ - `--scorer <name>` — With --run: a scorer the run pinned or one teamai pull cached. With --session, or alone inside a session: a scorer teamai pull cached, or a scorer file to try before pushing it: a path with / or ending in .md. A file's label is never stored, so it takes no --push; the output adds the labels stored for its scorer (stored) and its verdict on the session's first prompt alone (control). Repeatable.
285
287
  - `--queue` — With --run: leave the work to any driver's score --next instead of judging it here
286
288
  - `--batch` — With --run or --session: the scorers share one judge call when they resolve to the same tool and model
287
289
  - `--push` — Publish every pending label of this machine to scores/<member>/<YYYY-MM>.jsonl on teamai-reports, alone or after --session. Labels only: never the session, the prompt or the judge's reasoning. With usage reporting off, or when the push fails, they stay pending for the next --push.
@@ -407,9 +409,9 @@ Generated: do not edit by hand. Regenerate with
407
409
 
408
410
  ## bind-project
409
411
 
410
- - `teamai bind-project` — Bind the current workspace to a ClawPro project for HTTP local-agent sync
412
+ - `teamai bind-project` — Enroll the current workspace in HTTP local-agent sync and bind it to a ClawPro project. A workspace where this never ran is left alone
411
413
  - `--project-id <id>` — Project ID from /projects/mine
412
- - `--skip` — Mark current workspace as skipped (never prompt again)
414
+ - `--skip` — Enroll the current workspace without a project (never prompt again)
413
415
 
414
416
  ## contribute
415
417
 
@@ -439,7 +441,7 @@ Generated: do not edit by hand. Regenerate with
439
441
  - `--confidence-writeback` — Update frontmatter confidence scores
440
442
  - `--update-quality` — Find stale docs/rules/skills and suggest updates
441
443
  - `--dry-run` — Show what would be done without making changes
442
- - `teamai recall promote [learningId]` — Promote a high-confidence learning to formal knowledge (docs/skills/rules)
444
+ - `teamai recall promote [learningId]` — Publish a high-confidence learning as new knowledge on a review branch, then mark it promoted
443
445
  - `--category <cat>` — Target category: skills | rules | docs; skills use <learningId>/SKILL.md
444
446
  - `--dry-run` — Show what would be done without making changes
445
447
 
@@ -160,11 +160,11 @@ Existing hook contents and permissions stay unchanged; read/write errors propaga
160
160
  from `init` and `hooks inject`, and Git-started pulls record them. An unreadable
161
161
  project config prevents sync and keeps its reason in `~/.teamai/debug.log`.
162
162
 
163
- Hosts that skip checkout hooks need `teamai pull` in the new checkout before the AI
164
- tool starts. For Codex CLI 0.160.0, use `git worktree add`, run `teamai pull` there, then
165
- launch `codex exec -C <worktree>`. Its native `codex exec --worktree` path creates
166
- the checkout without `post-checkout`, so SessionStart sync arrives after startup
167
- discovery.
163
+ Hosts that skip checkout hooks (Claude Code's `EnterWorktree`, Codex CLI's worktrees) get
164
+ the same delivery from teamai's own session start and tool hooks, in the background, the first
165
+ time they run in a checkout with no delivery record. What the tool reads at startup is read
166
+ before that delivery lands: for Codex CLI 0.160.0, use `git worktree add`, run `teamai pull` there, then
167
+ launch `codex exec -C <worktree>`.
168
168
 
169
169
  ## "KEY is not set. Run `teamai env set KEY`"
170
170
 
@@ -269,7 +269,7 @@ broken machine):
269
269
  | Codex | Installed and trusted | Codex runs only trusted hooks; teamai trusts the ones it writes through `codex app-server`, and `teamai doctor` names any Codex will not run |
270
270
  | Cursor | Installed | Also runs `~/.claude/settings.json`. That copy exits only when `~/.cursor/hooks.json` or the project `.cursor/hooks.json` contains `--tool cursor` |
271
271
  | Copilot CLI | Installed | Built-ins use `$COPILOT_HOME/hooks/teamai.json` (default `~/.copilot/hooks/teamai.json`); self mode keeps them in the project. Claude built-ins exit for a valid, enabled version-1 file, global or project, with a `--tool copilot` command; self mode checks only the project directory. A Claude team hook exits only when a valid, enabled project version-1 file delivers the same command to Copilot for the same event and matcher. `COPILOT_CLI` alone does not skip |
272
- | CodeBuddy / WorkBuddy | Installed | Claude-format hooks in their own `settings.json` |
272
+ | CodeBuddy / WorkBuddy | Installed | Claude-format hooks in their own `settings.json`; none on a WorkBuddy with only `.workbuddy-ai/` (see WorkBuddy below) |
273
273
 
274
274
  Practical rule: if you set up with `--agent claude`, expect **only** Claude to show
275
275
  hooks installed. A tool you are not using, or one that is not a supported hook
@@ -335,9 +335,13 @@ hook entry; if unsure of the exact config, run `teamai doctor` and `teamai hooks
335
335
  to see what should be present, then have them replicate it. Until then, they can
336
336
  sync with a manual `teamai pull`.
337
337
 
338
+ Skip this on WorkBuddy 5.7+ with only `~/.workbuddy-ai/`. teamai does not know yet
339
+ where 5.7 reads hooks, so it writes none, and `teamai doctor` names them under
340
+ `workbuddy receives ...`. Do not hand-register a hook there; sync with `teamai pull`.
341
+
338
342
  ### Muse Code
339
343
 
340
- Hooks go in the `hooks` block of `~/.config/muse/settings.json`, which Muse runs in every workspace; a project's `.muse/hooks.json` runs only once the workspace is trusted. Muse starts each hook with an emptied environment, so a variable set only on the command that launched `muse` (such as `TEAMAI_HOOKS_DISABLED=1 muse`) does not reach the hook. The hook command runs `bash -lc`, so export it in `~/.bash_profile` or `~/.profile` instead.
344
+ Hooks go in the `hooks` block of `~/.config/muse/settings.json` (`$XDG_CONFIG_HOME/muse/settings.json` when that is set), which Muse runs in every workspace; a project's `.muse/hooks.json` runs only once the workspace is trusted. Muse starts each hook with an emptied environment, so a variable set only on the command that launched `muse` (such as `TEAMAI_HOOKS_DISABLED=1 muse`) does not reach the hook. The hook command runs `bash -lc`, so export it in `~/.bash_profile` or `~/.profile` instead.
341
345
 
342
346
  ### Tools without a writable hook surface
343
347
 
@@ -444,7 +448,7 @@ Session archive writers (`session push`, `migrate --push`, and `session pull`) w
444
448
 
445
449
  ## OpenCode hooks cannot start the CLI
446
450
 
447
- If OpenCode hooks stopped after moving or reinstalling Node or TeamAI, run `teamai hooks inject` or `teamai pull` and restart OpenCode. The plugin records the installed Node and CLI paths so it also works without `teamai` on the service PATH. Doctor accepts those live paths when another installation of the same build inspects the plugin; missing saved paths or a changed handler still fail the check.
451
+ If OpenCode hooks stopped after moving or reinstalling Node or TeamAI, run `teamai hooks inject` or `teamai pull` and restart OpenCode. The plugin records the installed Node and CLI paths so it also works without `teamai` on the service PATH. Doctor accepts those live paths when another installation with the same handler inspects the plugin; invalid saved launcher files or a changed handler still fail the check.
448
452
 
449
453
  ## ZCode registered hooks but missing project rules
450
454
 
@@ -457,3 +461,17 @@ Pi reads `AGENTS.override.md` before `AGENTS.md` in the same directory. In user
457
461
  ## A file blocks skill delivery
458
462
 
459
463
  When a file occupies a tool skills directory, doctor fails the directory check even if delivery skipped that tool. Move the file aside and run `teamai pull`. Uninstall keeps the blocking file and cleans the other managed resources.
464
+
465
+ ## Kiro default-agent synchronization
466
+
467
+ Kiro CLI V3 uses the generated user hook `~/.kiro/hooks/teamai.json`, independently of custom agents. Missing or edited hooks appear in doctor; reinject after moving aside a same-named personal file. User uninstall removes the managed file, project uninstall keeps it, and personal hook files remain. Upgrade Kiro 2.x to V3 for this lifecycle integration.
468
+
469
+ ## Placed agent edits and format changes behind the default branch
470
+
471
+ An edit of the root copy overwrites the agent this machine placed, and a `.md`/`.yaml` conversion may retire it after its merge is proven. If the team changed the placed file since this machine's last merged push, the push stops and prints a `teamai push --carried <path>@<blob>` command: update the checkout, carry its changes into the root copy, then run it. The option accepts only that version, so a plain retry or a later team change stops again. If the team deleted it, the remaining root copy is not a new agent to publish. Older records without a delivered blob catch a team change only while the checkout is behind it, until the first edit pushed through them merges and records its blob. Until then, compare with the team file before editing or converting.
472
+
473
+ A recreated namespace source can be edited directly; the retired flattened copy is kept as a backup. Retired tool copies do not become new agents when the root copy is removed. The retirement warning names the former source so the member can restore it before pushing edits.
474
+
475
+ ## Hermes hooks after moving Node or TeamAI
476
+
477
+ The generated status script and instructions plugin capture the installed Node executable and TeamAI entry. After moving or reinstalling either, run `teamai pull` or `teamai hooks inject`, then restart Hermes.
@@ -107,6 +107,9 @@ cannot use Git. If the admin provides an HTTP endpoint + API key instead, use:
107
107
  teamai init --http https://your-team-host/api --token <api-key>
108
108
  ```
109
109
 
110
+ An agent access token (`sk-`) works for one agent only: pass that agent with
111
+ `--agent <tool>` (see `teamai init --help`).
112
+
110
113
  This is a read-only consumer mode — `push` / `contribute` are not available, but
111
114
  skills and rules still sync.
112
115
 
@@ -35,6 +35,8 @@ teamai mcp remove --dry-run # preview removal without changing tool configs or m
35
35
  teamai mcp remove # remove teamai-managed MCP servers
36
36
  ```
37
37
 
38
+ `mcp inject` and `mcp remove` return exit code 1 if a tool config cannot be read or parsed, including in a dry run. Other tools may still change. Fix the config named in the warning and rerun the command; the unreadable config and its ownership records are kept for that retry.
39
+
38
40
  MCP definitions travel with the team repo like skills/rules — edit, then the
39
41
  members pick them up on sync.
40
42
 
@@ -88,6 +90,8 @@ ZCode servers use `mcp.servers` in `~/.zcode/cli/config.json` or the project's `
88
90
 
89
91
  WorkBuddy uses the first existing user file in `~/.workbuddy/.mcp.json`, `~/.workbuddy/mcp.json`, and `~/.codebuddy.json`. `CODEBUDDY_CONFIG_DIR` moves the last file. A project uses `.mcp.json`, or `mcp.json` when only that exists. With `sharing.gitExclude` on, its servers use `projects[<project path>].mcpServers` in `.codebuddy.json`. These paths follow the CodeBuddy 2.168.0 engine; WorkBuddy's launcher binding is not certified. Pull removes only unchanged teamai entries from the former `.workbuddy/mcp.json` project file.
90
92
 
93
+ When `.workbuddy-ai/` exists in the home or project (WorkBuddy 5.7+), the default skills path moves to `.workbuddy-ai/skills`. Every other surface still waits for `.workbuddy/`, so a member with only `.workbuddy-ai/` gets no rules, team instructions, agents, MCP servers or hooks, and `teamai doctor` fails `workbuddy receives ...` with the ones held.
94
+
91
95
  When a tool's home or configured MCP path moves, pull leaves old copies in place and names them once. Remove them after no tool reads them. Doctor reports unread mappings, moved files, and project MCP that is read only from a session started at the project root. Internal builds with an unknown MCP channel get a note instead of a guessed config.
92
96
 
93
97
  ### Pi MCP delivery
@@ -103,7 +103,7 @@ Before the K1 deep read, use TeamAI to extract evidence-backed import/call struc
103
103
  teamai import --dir <repo_abs_path> --skip-enrich
104
104
  ```
105
105
 
106
- - Output: `teamwiki/evidence/code/<slug>/` pages and `teamwiki/evidence/code/<slug>/.indices/graph-index.json` (structural edges), merged into `teamwiki/.indices/graph-index.json`. `<slug>` is the repository name; reuse it for `teamai codebase --deep-enrich --project <slug>`.
106
+ - Output: `teamwiki/evidence/code/<slug>/` pages and `teamwiki/evidence/code/<slug>/.indices/graph-index.json` (structural edges), merged into `teamwiki/.indices/graph-index.json`. `<slug>` is the `project:` the import prints (`<provider>__<owner>__<repo>` when the repo has an `origin`, else the repository name); reuse it for `teamai codebase --deep-enrich --project <slug>`.
107
107
  - The source repository itself is left untouched.
108
108
  - When K1/K2/K3 write `edges[]` in `_manifest.json`: **prefer citing** the `code-ast` edges from the import + their `evidenceRefs` (`path:line`); label Agent inferences `INFERRED`/`AMBIGUOUS`.
109
109
  - After Phase K3, skip any extra graph compile / merge step that is not a `teamai` command. TeamAI does not ship a separate team-wiki CLI. Continue with this skill using `teamai` and the files under this skill directory. No extra plugin is required.