@team-ai/teamai-cli 0.0.0-stage → 0.22.2

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +1416 -0
  2. package/LICENSE +13 -0
  3. package/README.ja.md +177 -0
  4. package/README.ko.md +177 -0
  5. package/README.md +176 -2
  6. package/README.th.md +177 -0
  7. package/README.zh-CN.md +183 -0
  8. package/agents/teamai-recall.md +406 -0
  9. package/dist/cli.js +136359 -0
  10. package/dist/index.js +9 -0
  11. package/package.json +100 -4
  12. package/skill-data/core/SKILL.md +250 -0
  13. package/skill-data/core/references/commands.md +471 -0
  14. package/skill-data/core/references/contribute-member.md +161 -0
  15. package/skill-data/core/references/troubleshooting.md +419 -0
  16. package/skill-data/setup/SKILL.md +80 -0
  17. package/skill-data/setup/references/join-member.md +189 -0
  18. package/skill-data/setup/references/manage-admin.md +354 -0
  19. package/skill-data/setup/references/provider-tgit.md +101 -0
  20. package/skill-data/setup/references/setup-admin.md +312 -0
  21. package/skill-data/setup/references/uninstall.md +180 -0
  22. package/skill-data/share/SKILL.md +70 -0
  23. package/skill-data/share/references/doc-template.md +44 -0
  24. package/skill-data/wiki/SKILL.md +317 -0
  25. package/skill-data/wiki/references/agents/graph-rag-agent.md +344 -0
  26. package/skill-data/wiki/references/agents/kb-doc-generator.md +325 -0
  27. package/skill-data/wiki/references/methodology/phase0-collection.md +54 -0
  28. package/skill-data/wiki/references/methodology/phase1-reverse-engineering.md +89 -0
  29. package/skill-data/wiki/references/methodology/phase2-document-types.md +341 -0
  30. package/skill-data/wiki/references/methodology/phase3-ai-enhancement.md +164 -0
  31. package/skill-data/wiki/references/methodology/phase4-quality.md +232 -0
  32. package/skill-data/wiki/references/overview.md +125 -0
  33. package/skill-data/wiki/references/phases/k1-reverse-engineering.md +118 -0
  34. package/skill-data/wiki/references/phases/k2-documents.md +68 -0
  35. package/skill-data/wiki/references/phases/k3-ai-native.md +121 -0
  36. package/skill-data/wiki/references/phases/k4-quality.md +190 -0
  37. package/skill-data/wiki/references/phases/phase0-init.md +113 -0
  38. package/skill-data/wiki/references/templates/project-overview.md +149 -0
  39. package/skill-data/wiki/scripts/scan_repo.py +224 -0
  40. package/skill-data/wiki/scripts/validate_kb.py +256 -0
  41. package/skills/teamai/SKILL.md +46 -0
@@ -0,0 +1,471 @@
1
+ # teamai command reference
2
+
3
+ Every public command the installed CLI accepts, rendered from its own command
4
+ table. Hidden commands are left out: they are hook plumbing the CLI runs itself,
5
+ never something to type. Flags marked `(hidden)` work but are absent from
6
+ `--help`, so treat this file — not `--help` — as the complete list of flags.
7
+
8
+ Generated: do not edit by hand. Regenerate with
9
+ `npx vitest run commands-reference -u` after changing a command or a flag.
10
+
11
+
12
+ ## Global options
13
+
14
+ - `-V, --version` — output the version number
15
+ - `--dry-run` — Preview mode, no changes made; a command with no preview exits 1 without running
16
+ - `-v, --verbose` — Verbose output
17
+
18
+ ## init
19
+
20
+ - `teamai init [repo]` — Initialize teamai (configure Git provider, clone repo, register member)
21
+ - `--repo <repo>` — Team repo (alias of the positional argument)
22
+ - `--http <url>` — Git-free HTTP team repo (read-only consumer; only needs an API key)
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
+ - `--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.
26
+ - `--scope <scope>` — Install scope: workspace (default, <cwd>/.teamai + <cwd>/.claude) or user (~/.teamai + ~/.claude); project is the older name for workspace
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
+ - `--no-inherit-user-scope` — Disable user-scope inheritance for this workspace
29
+ - `--role <id>` — Primary role ID (e.g. hai_dev) for non-interactive setup
30
+ - `--project <ids>` — Active logical project(s) from manifest/projects.yaml (comma-separated); scopes which project resources and learnings this directory syncs. Pass "all" to activate every project the manifest declares (a snapshot taken now)
31
+ - `--agent <name>` — AI tools to set up (e.g. claude, codex, cursor, codebuddy, workbuddy, dsh). Repeatable or comma-separated. In single-repo mode, selects which tool dirs to create; a custom agent defined only in teamai.yaml's toolPaths also gets its root created here (git-backed init only — an HTTP init has no local teamai.yaml to read custom paths from). Omit for an interactive picker. Additive on repeated runs.
32
+ - `--force` — Overwrite existing config without confirmation
33
+
34
+ ## push
35
+
36
+ - `teamai push` — Push local resources to team repo
37
+ - `--all` — Push all without confirmation
38
+ - `--skill <path>` — Push a specific skill by path (e.g., ~/.claude/skills/hai/my-skill or skills/hai_dev/my-skill)
39
+ - `--role <id>` — Namespace for new skills, rules and agents (skills/<id>/, rules/<id>/, agents/<id>/). Without --role or --project, the namespaces of your role and active projects decide
40
+ - `--project <id>` — Target a project: each new resource goes to that project's namespace for its own type — skills, knowledge for rules, agents (from manifest/projects.yaml)
41
+ - `--branch <name>` — Push to this destination branch instead of a generated teamai/push branch
42
+
43
+ ## pull
44
+
45
+ - `teamai pull` — Pull team resources and inject into local AI tools. Team docs land in sharing.docs.localDir: .teamai/docs/ in a workspace by default, a hidden directory, so search that path directly
46
+ - `--silent` — Silent mode (for hooks)
47
+ - `--force` — Force full sync even if repo is unchanged
48
+ - `--team-ref <ref>` — Pin this workspace to a branch, tag or commit of the team repo; the default branch unpins it
49
+
50
+ ## status
51
+
52
+ - `teamai status` — Show local vs team repo diff
53
+ - `--all` — List every project data partition under ~/.teamai/projects (flags stale/orphan ones)
54
+
55
+ ## list
56
+
57
+ - `teamai list [type]` — List resources (skills|rules|docs|env|agents|hooks|mcp). For skills, --source local/all also scans installed AI agent skill directories.
58
+ - `--source <src>` — Where to look for skills: repo | local | all
59
+ - `--agent <name>` — Filter local agents by id (only applies to skills)
60
+ - `--reveal` — Show env values in plaintext (default: masked)
61
+
62
+ ## skill
63
+
64
+ - `teamai skill` — List and inspect skills (default: repo + installed agents, then the CLI-served catalog)
65
+ - `teamai skill list` — List team and installed skills, then the built-in catalog the CLI serves
66
+ - `--json` — Output the CLI-served built-in skill catalog as JSON
67
+ - `teamai skill get [names...]` — Print built-in skill content served by the installed CLI
68
+ - `--full` — Append the skill's references/ and templates/ files
69
+ - `--all` — Print every skill the CLI serves
70
+ - `teamai skill path <name>` — Print the packaged directory of a built-in skill (for scripts and templates)
71
+ - `teamai skill show <name>` — Show skill metadata: source / contributors / installed agents / description
72
+ - `teamai skill exclude` — Manage per-user skill exclusion (skip sync without affecting team repo)
73
+ - `teamai skill exclude list` — List excluded skills
74
+ - `teamai skill exclude add <skills...>` — Add skill(s) to the exclude list
75
+ - `teamai skill exclude remove <skills...>` — Remove skill(s) from the exclude list
76
+
77
+ ## members
78
+
79
+ - `teamai members` — Manage team members
80
+ - `teamai members list` — List team members
81
+
82
+ ## remove
83
+
84
+ - `teamai remove <type> <names...>` — Remove resource(s) from team repo and all local AI tools (type: skills|rules|agents|mcp)
85
+ - `--force` — Skip confirmation prompt
86
+ - `--role <ns>` — mcp: remove the server from mcp/<ns>/mcp.yaml instead of the root mcp/mcp.yaml
87
+ - `--project <id>` — mcp: remove the server from the project's mcp namespace instead of the root mcp/mcp.yaml
88
+
89
+ ## packages
90
+
91
+ - `teamai packages [target]` — Install team npm packages and Claude plugins declared in teamai.yaml
92
+ - `-g, --global` — Install an npm target globally (for CLI tools)
93
+ - `--registry <url>` — Use a specific npm registry for this target
94
+ - `--npm` — Treat an ambiguous target as an npm package
95
+ - `--claude` — Treat the target as a Claude plugin
96
+ - `teamai packages install [target]` — Install team npm packages and Claude plugins declared in teamai.yaml
97
+ - `-g, --global` — Install an npm target globally (for CLI tools)
98
+ - `--registry <url>` — Use a specific npm registry for this target
99
+ - `--npm` — Treat an ambiguous target as an npm package
100
+ - `--claude` — Treat the target as a Claude plugin
101
+
102
+ ## doctor
103
+
104
+ - `teamai doctor` — Diagnose configuration issues
105
+ - `--json` — Output the report as JSON (suitable for CI)
106
+ - `--fix` — Remove lock files left behind by dead processes
107
+
108
+ ## roles
109
+
110
+ - `teamai roles` — Manage team roles and resource namespaces
111
+ - `teamai roles init` — Create a roles manifest for the team repo (admin)
112
+ - `teamai roles list` — List all defined roles and your current role
113
+ - `teamai roles set <primary>` — Set your primary role (updates local config)
114
+ - `--add <roles...>` — Additional roles to include
115
+ - `teamai roles add <id>` — Add a new role to the manifest (admin)
116
+ - `--namespaces <ns>` — Comma-separated resource namespaces (e.g. common,hai)
117
+ - `-d, --description <desc>` — Description for the role
118
+ - `teamai roles remove <id>` — Remove a role from the manifest (admin)
119
+ - `teamai roles update <id>` — Update a role in the manifest (admin)
120
+ - `--add-namespaces <ns>` — Comma-separated namespaces to add
121
+ - `--remove-namespaces <ns>` — Comma-separated namespaces to remove
122
+ - `-d, --description <desc>` — New description for the role
123
+
124
+ ## projects
125
+
126
+ - `teamai projects` — Manage multi-project resource distribution (orthogonal to roles)
127
+ - `teamai projects list` — List defined projects and the ones active in this directory
128
+ - `teamai projects set [ids...]` — Set the projects active in this directory (comma-separated or repeated; empty to clear)
129
+ - `teamai projects add <id>` — Add a project to manifest/projects.yaml, creating the file if needed (admin)
130
+ - `--namespaces <ns>` — Comma-separated namespaces for knowledge, skills, learnings and agents (e.g. common,checkout); env, hooks, mcp, models, docs and wiki are declared by hand
131
+ - `--name <name>` — Display name for the project
132
+ - `-d, --description <desc>` — Description for the project
133
+ - `teamai projects update <id>` — Update a project in manifest/projects.yaml (admin)
134
+ - `--add-namespaces <ns>` — Comma-separated namespaces to add to knowledge, skills, learnings and agents
135
+ - `--remove-namespaces <ns>` — Comma-separated namespaces to remove from knowledge, skills, learnings and agents
136
+ - `--name <name>` — New display name for the project
137
+ - `-d, --description <desc>` — New description for the project
138
+ - `teamai projects remove <id>` — Remove a project from manifest/projects.yaml (admin)
139
+ - `teamai projects members <id>` — List members registered for a project
140
+
141
+ ## tags
142
+
143
+ - `teamai tags` — Manage tag-based skill/rule filtering
144
+ - `teamai tags list` — List all available tags and subscription status
145
+ - `teamai tags subscribe <tags...>` — Subscribe to tags (only matching skills/rules will be synced)
146
+ - `teamai tags unsubscribe <tags...>` — Unsubscribe from tags
147
+ - `teamai tags add <type> <name> <tags...>` — Add tags to a skill or rule in tags.yaml (admin)
148
+
149
+ <type> Resource type: "skills" or "rules"
150
+ <name> Name of the skill or rule (directory name)
151
+ <tags> One or more tags to add
152
+
153
+ Examples:
154
+ $ teamai tags add skills hai-deploy hai infra
155
+ $ teamai tags add rules common-coding-style coding best-practices
156
+
157
+ - `teamai tags remove <type> <name> <tags...>` — Remove tags from a skill or rule in tags.yaml (admin)
158
+
159
+ <type> Resource type: "skills" or "rules"
160
+ <name> Name of the skill or rule (directory name)
161
+ <tags> One or more tags to remove
162
+
163
+ Examples:
164
+ $ teamai tags remove skills hai-deploy infra
165
+ $ teamai tags remove rules common-coding-style best-practices
166
+
167
+
168
+ ## source
169
+
170
+ - `teamai source` — Manage cross-team skill sources
171
+ - `teamai source add <repo>` — Add a cross-team source repo
172
+ - `--name <name>` — Alias for this source
173
+ - `teamai source remove <name>` — Remove a source and clean up its skills
174
+ - `teamai source add-http <endpoint>` — Add an HTTP source (report/sync/ack) alongside a git main repo
175
+ - `--token <key>` — API token for the HTTP endpoint (stored 0600, never committed)
176
+ - `--force` — Overwrite an existing HTTP source config
177
+ - `teamai source remove-http` — Remove the HTTP source and clean up its resources
178
+ - `teamai source list` — List all configured sources
179
+ - `teamai source browse <name>` — Browse public skills from a source
180
+
181
+ ## update
182
+
183
+ - `teamai update` — Check for updates and upgrade teamai CLI
184
+ - `--check` — Only check if an update is available, do not install
185
+
186
+ ## uninstall
187
+
188
+ - `teamai uninstall` — Remove all teamai-managed resources and hooks from this machine
189
+ - `--force` — Skip confirmation prompt
190
+ - `--agent <name>` — Only uninstall this agent's resources in this checkout; shared resources, and the project's other checkouts, go only if it is the last tool
191
+
192
+ ## script
193
+
194
+ - `teamai script` — Run a Node script the team declared in teamai.yaml
195
+ - `teamai script run <event>` — Run preInit, postInit, prePull, postPull, or postDeploy for this checkout. preInit and postInit need a terminal. postInit then syncs MCP servers.
196
+
197
+ ## env
198
+
199
+ - `teamai env` — Manage team environment variables
200
+ - `--reveal` — Show env variable values in plaintext (default: masked)
201
+ - `teamai env list` — List team environment variables
202
+ - `--reveal` — Show env variable values in plaintext (default: masked)
203
+ - `teamai env add <key> [value]` — Add or update a team environment variable, or declare a secret with --secret
204
+ - `-d, --description <desc>` — Description for the variable or secret
205
+ - `--secret` — Declare a secret in env/secrets.yaml: no value, each member sets their own
206
+ - `--url <url>` — Where a member gets a value for the secret (with --secret)
207
+ - `--role <ns>` — Write to env/<ns>/ instead of env/ (env.yaml, or secrets.yaml with --secret)
208
+ - `--project <id>` — Write to the project's env namespace (resources.env in manifest/projects.yaml)
209
+ - `teamai env remove <key>` — Remove a team environment variable or declared secret
210
+ - `--secret` — Remove the declared secret only (env/secrets.yaml), for a key env.yaml also sets
211
+ - `--role <ns>` — Remove from env/<ns>/ instead of env/
212
+ - `--project <id>` — Remove from the project's env namespace (resources.env in manifest/projects.yaml)
213
+ - `teamai env set <key>` — Set your value for a secret the team declares, or an env variable it sets, for this directory's team, on this machine (prompts without echo)
214
+ - `--stdin` — Read the value from piped stdin
215
+ - `--from-env <var>` — Read the value from this environment variable each time it is used; no copy is stored
216
+ - `--global` — Set a secret for every team on this machine; a value set for a team still wins
217
+ - `teamai env unset <key>` — Remove your value for a secret or env variable, for this directory's team, from this machine
218
+ - `--global` — Remove the value set for every team on this machine instead
219
+ - `teamai env exec <command...>` — Run a command with this directory's team env variables and secrets (put -- before the command)
220
+
221
+ ## workflow
222
+
223
+ - `teamai workflow` — Run a validated workflow from workflows/<name>.yaml
224
+ - `teamai workflow start <name>` — Create a run. With --driver local, execute command and prompt steps in this process.
225
+ - `--driver <kind>` — Run the workflow in this process. Only local is available.
226
+ - `--tools <list>` — Override local prompt tools for this run, as comma-separated name=tool pairs
227
+ - `--auto-approve` — With --driver local, automatically answer optional approve HITL requests and choose defaults in this process
228
+ - `--inputs <json>` — Values for the inputs the workflow declares, as a JSON object, for example {"issue":42}. Every declared input is required.
229
+ - `teamai workflow next <run>` — Get a lease, hitl, wait, or done JSON envelope. Show hitl.message and hitl.respond to a person, who replaces <option> with a choice.
230
+ - `--json <payload>` — Driver identity, for example {"driver":{"kind":"local","machine":"host","workspace":"/work"}}. Optional: running, the attempt ids of its open leases the driver still runs (an open lease left out is handed back), canTakeLease, false to poll while a tool runs without taking a new lease, and driver.can.hitl, true when a person can answer HITL requests and work interactively. Send driver.can.hitl on every next request, including busy polls. Every answer lists in cancelled the running attempts whose tools the driver must stop.
231
+ - `teamai workflow report <run>` — Report the outcome of a leased step. Prints a JSON envelope.
232
+ - `--json <payload>` — attempt, revision, outcome (success, failed, or released), and driver
233
+ - `teamai workflow respond <run> <step> <choice>` — Answer a waiting approve (yes/no) or choose HITL request. Required HITL requests accept terminal answers or declared person answers from a driver UI. Prints one JSON envelope.
234
+ - `--json <payload>` — Driver identity {"driver":{"kind":"ide","machine":"host","workspace":"/work"}} declares an answer a person gave in the driver UI, never one its agent chose. Records channel driver with agent false; accepts required HITL requests.
235
+ - `--note <text>` — Keep a note with the answer, readable as steps.<id>.note
236
+ - `--pass <n>` — Answer only this positive pass number; rejects an answered or replaced HITL request
237
+ - `teamai workflow retry <run> <step>` — Retry a leased or stopped step, or a HITL request to answer it again, with a new pass and revision. Reopen its dependent steps and a settled run; keep earlier passes. After reopening, run resume or let your driver poll next. Prints one JSON envelope.
238
+ - `teamai workflow resume <run>` — Continue a run with the local driver after retry, respond, or a stopped driver (Ctrl-C or closed terminal). Uses this machine's open local lease workspace, then the latest local driver's workspace on this machine, then cwd. Another live local driver returns driver_running. A settled run returns done.
239
+ - `--tools <list>` — Override local prompt tools for this run, as comma-separated name=tool pairs
240
+ - `--auto-approve` — Automatically answer optional approve HITL requests and choose defaults in this process
241
+ - `teamai workflow cancel <run> [step]` — Cancel a whole run, or a pending, waiting, leased, or running step and its open descendants. Invalidates leases; drivers stop tools listed in next.cancelled. Prints one JSON envelope.
242
+
243
+ ## hooks
244
+
245
+ - `teamai hooks` — Manage teamai hooks in AI tool settings
246
+ - `teamai hooks list` — List hook install status + effective built-in (A) and team (B) hooks
247
+ - `teamai hooks inject` — Inject teamai hooks into all AI tool settings
248
+ - `--silent` — Silent mode (suppress success message)
249
+ - `teamai hooks remove` — Remove teamai hooks from all AI tool settings
250
+
251
+ ## mcp
252
+
253
+ - `teamai mcp` — Manage team MCP servers across AI tools
254
+ - `teamai mcp list` — List team MCP servers and their per-tool install status
255
+ - `teamai mcp inject` — Inject team MCP servers into all AI tool configs
256
+ - `--dry-run` — Show what would change without writing
257
+ - `--force` — Overwrite servers that collide with user-owned entries
258
+ - `teamai mcp remove` — Remove all teamai-managed MCP servers from AI tool configs
259
+
260
+ ## webhook
261
+
262
+ - `teamai webhook` — Manage webhook integrations for team notifications
263
+ - `teamai webhook list` — List configured webhook endpoints
264
+ - `teamai webhook test` — Send test event to webhook endpoints
265
+ - `--url <url>` — Test specific endpoint URL
266
+
267
+ ## models
268
+
269
+ - `teamai models` — Share gateway model profiles and switch agents to them
270
+ - `teamai models list [profile]` — Show team and personal model profiles, or one profile, and the agents using them
271
+ - `teamai models add <id>` — Add a personal model profile stored only on this machine
272
+ - `--name <name>` — Display name
273
+ - `--protocol <protocols>` — Comma-separated: anthropic, openai-chat-completions, openai-responses
274
+ - `--base-url <url>` — Gateway root URL (without /v1)
275
+ - `--model <ids>` — Comma-separated model IDs; the first is the default
276
+ - `--from-env <name>` — Read the API key from this environment variable
277
+ - `--api-key-stdin` — Read the API key from stdin without placing it in shell history
278
+ - `teamai models configure <profile>` — Set the API key of a profile, or edit a personal profile
279
+ - `--from-env <name>` — Read the API key from this environment variable
280
+ - `--api-key-stdin` — Read the API key from stdin without placing it in shell history
281
+ - `--name <name>` — Personal profiles: new display name
282
+ - `--base-url <url>` — Personal profiles: new gateway root URL
283
+ - `--protocol <protocols>` — Personal profiles: serve models over these protocols too
284
+ - `--model <ids>` — Personal profiles: add model IDs
285
+ - `teamai models switch [profile]` — Point agents at a model profile (every compatible agent by default); omit the profile to pick one
286
+ - `--agent <name>` — Only switch this agent. Repeatable or comma-separated.
287
+ - `--model <id>` — Default model to select (defaults to the first in the profile)
288
+ - `--dry-run` — Show what would change without writing
289
+ - `teamai models restore` — Restore agent model settings captured before the first TeamAI switch
290
+ - `--agent <name>` — Only restore this agent. Repeatable or comma-separated.
291
+ - `--dry-run` — Show what would change without writing
292
+ - `teamai models remove <profile>` — Remove a personal model profile without changing agent settings
293
+
294
+ ## stats
295
+
296
+ - `teamai stats` — Show local skill usage statistics
297
+ - `--by-repo` — Break the local event log down per repository
298
+ - `--by-time` — Show local event log activity by hour of day
299
+
300
+ ## session
301
+
302
+ - `teamai session` — Session recording, cross-platform migration, and team sync
303
+ - `teamai session save` — Record a privacy-scrubbed summary of a coding session to a local monthly log
304
+ - `--session-id <id>` — Session to record (default: the agent's session, e.g. $CLAUDE_CODE_SESSION_ID, or the most recent)
305
+ - `--push` — Also push the summary to the team repo (feeds `teamai digest`)
306
+ - `--force` — Push even if the session is not flagged as valuable
307
+ - `--include-prompt` — Include the redacted first-prompt line in the pushed summary (default: off)
308
+ - `--scope <scope>` — Config scope for --push: user | workspace (default: auto-detect)
309
+ - `teamai session platforms` — List supported and installed AI agent platforms
310
+ - `teamai session migrate [sessionId]` — Migrate a session from one platform to another (or archive to same platform)
311
+ - `-s, --source <platform>` — Source platform (e.g. claude-code, codebuddy)
312
+ - `-t, --target <platform>` — Target platform
313
+ - `--cwd <path>` — Working directory (defaults to current directory)
314
+ - `--target-cwd <path>` — Override cwd for the target session
315
+ - `--push` — Also push the migrated session to the team repo
316
+ - `--repo-root <path>` — Team repo root (for --push)
317
+ - `--scrub` — Redact secrets (tokens/keys/passwords) from the session before writing it
318
+ - `--all` — Migrate every session from source (not just the 5 most recent)
319
+ - `--limit <n>` — Max sessions to migrate (only caps --all; ignored otherwise)
320
+ - `-y, --yes` — Skip confirmation prompts, including archiving unredacted transcripts
321
+ - `--json` — Print one {data}|{error} JSON envelope on stdout; never prompts (needs a session id, -s and -t)
322
+ - `teamai session push` — Push local sessions to the team repo
323
+ - `--source <platform>` — Source platform to read sessions from
324
+ - `--repo-root <path>` — Team repo root (defaults to cwd)
325
+ - `--cwd <path>` — Working directory (defaults to current directory)
326
+ - `--limit <n>` — Max sessions to push (default: 5; ignored with --all)
327
+ - `--all` — Push every session of the platform across all workspace directories (ignores --limit)
328
+ - `-y, --yes` — Skip confirmation prompts, including archiving unredacted transcripts (--all)
329
+ - `--scrub` — Redact secrets before archiving (archived sessions are team-readable)
330
+ - `teamai session pull` — Pull team sessions for the current project
331
+ - `--repo-root <path>` — Team repo root (defaults to cwd)
332
+ - `--cwd <path>` — Working directory (defaults to current directory)
333
+ - `--all` — Rebuild indexes for every repo in the team repo (not just the current project)
334
+ - `teamai session list` — List team sessions for the current project
335
+ - `--repo-root <path>` — Team repo root (defaults to cwd)
336
+ - `--cwd <path>` — Working directory (defaults to current directory)
337
+ - `--author <name>` — Filter by author
338
+ - `--all` — List sessions across all projects in the team repo (not just the current one)
339
+ - `teamai session resume <sessionName>` — Restore a team session to a local platform
340
+ - `--platform <platform>` — Target platform to restore into
341
+ - `--repo-root <path>` — Team repo root (defaults to cwd)
342
+ - `--cwd <path>` — Working directory for the restored session (defaults to current directory)
343
+ - `--author <name>` — Author of the session (if ambiguous)
344
+ - `teamai session search <query>` — Search team session content
345
+ - `--repo-root <path>` — Team repo root (defaults to cwd)
346
+ - `--cwd <path>` — Working directory (defaults to current directory)
347
+ - `--limit <n>` — Max results (default: 10)
348
+ - `--all` — Search across all projects (not just current)
349
+ - `teamai session rollback <sessionId>` — Rollback a migration (delete the target session)
350
+ - `--platform <platform>` — Platform where the session was written
351
+ - `--cwd <cwd>` — Only roll back the copy under this project path (default: all)
352
+
353
+ ## digest
354
+
355
+ - `teamai digest` — Generate weekly team activity digest
356
+
357
+ ## dashboard
358
+
359
+ - `teamai dashboard` — Start the AI coding session dashboard (Web UI)
360
+ - `-p, --port <port>` — Port number
361
+
362
+ ## bind-project
363
+
364
+ - `teamai bind-project` — Bind the current workspace to a ClawPro project for HTTP local-agent sync
365
+ - `--project-id <id>` — Project ID from /projects/mine
366
+ - `--skip` — Mark current workspace as skipped (never prompt again)
367
+ - `--prompt-mode <mode>` — Project association reminder: auto (ask in each new workspace) or manual (no automatic reminder)
368
+ - `--settings` — Show the project association reminder mode and how to change it
369
+
370
+ ## contribute
371
+
372
+ - `teamai contribute` — Contribute session knowledge to team repo; projects list shows the default destination and allowed namespaces
373
+ - `--file <path>` — Path to the contribution document
374
+ - `--title <title>` — Title for the contribution document
375
+ - `--namespace <ns>` — Write to an active learnings namespace (default: the only active namespace, or the shared root when none or several are active)
376
+ - `--session-id <id>` — Session ID for dedup tracking
377
+ - `--scope <scope>` — Target scope: user or workspace
378
+
379
+ ## recall
380
+
381
+ - `teamai recall [query...]` — Search team learnings knowledge base
382
+ - `--depth <level>` — Recall depth: route (entry-points only) | context (module-level, default) | lookup (full graph traversal)
383
+ - `--check` — Relevance precheck only: print RELEVANT/NOT_RELEVANT + top score; no file reads, no upvote
384
+ - `--caller <name>` (hidden) — Internal, set by the teamai-recall subagent to mark its own runs; do not pass it yourself
385
+ - `teamai recall disable` — Disable automatic knowledge-base recall
386
+ - `teamai recall enable` — Enable automatic knowledge-base recall
387
+ - `teamai recall status` — Show recall feature status
388
+ - `teamai recall feedback` — Record manual feedback for a recalled document
389
+ - `--positive <docId>` — Upvote a document (marks as actually useful)
390
+ - `--negative <docId>` — Record negative signal for a document
391
+ - `teamai recall maintenance` — Automatic maintenance of team knowledge base
392
+ - `--prune` — Remove low-confidence learnings
393
+ - `--threshold <n>` — Confidence threshold for pruning (default 0.15)
394
+ - `--archive` — Move to archive/ instead of deleting
395
+ - `--confidence-writeback` — Update frontmatter confidence scores
396
+ - `--update-quality` — Find stale docs/rules/skills and suggest updates
397
+ - `--dry-run` — Show what would be done without making changes
398
+ - `teamai recall promote [learningId]` — Promote a high-confidence learning to formal knowledge (docs/skills/rules)
399
+ - `--category <cat>` — Target category: skills | rules | docs
400
+ - `--dry-run` — Show what would be done without making changes
401
+
402
+ ## import
403
+
404
+ - `teamai import` — Import knowledge from local directories, remote repos, organizations, MRs, or iWiki
405
+ - `--dir <path>` — Extract code knowledge from a local directory (same as --from-repo but no clone)
406
+ - `--from-claude` (hidden) — Scan Claude/Cursor rule directories (the Claude root's rules/ — ~/.claude or the recorded toolRoots.claude — and ~/.cursor/rules)
407
+ - `--from-mr <url...>` — Extract learning from one or more merged MRs/PRs and trigger incremental teamwiki update
408
+ - `--no-discussions` — Leave the MR's review threads out of the extraction (with --from-mr)
409
+ - `--from-iwiki <space-id-or-url>` — Import documents from iWiki Space ID or page URL (requires TAI_PAT_TOKEN)
410
+ - `--resume` (hidden) — Resume an interrupted import session
411
+ - `--all` — Accept all suggestions without interactive confirmation
412
+ - `--output <path>` (hidden) — Write drafts to this directory instead of pushing to team repo; code knowledge goes to <path>/teamwiki
413
+ - `--from-repo <url>` — Clone a remote repo and generate per-repo codebase summary
414
+ - `--ssh` (hidden) — Force SSH clone even if HTTPS token is available
415
+ - `--domain <name>` (hidden) — Skip AI recommendation and assign repo to this domain explicitly
416
+ - `--from-repo-list <path>` — Batch import repos from a YAML whitelist
417
+ - `--concurrency <n>` (hidden) — Concurrent repos for --from-repo-list (default 3)
418
+ - `--incremental` — Re-extract only files changed since the last import (with --dir, --from-repo or --from-repo-list; remote repos also reuse the cached clone)
419
+ - `--skip-enrich` — Skip AI enrichment (only clone + extract + graph, no LLM calls)
420
+ - `--max-files <n>` — Max source files collected per repository (default 200)
421
+ - `--from-org <org>` — List repos under an org and generate a repo whitelist
422
+ - `--max-repos <n>` (hidden) — Cap on repos pulled from --from-org (default 200)
423
+ - `--exclude-archived` (hidden) — Exclude archived repos from --from-org (default true)
424
+ - `--include-pattern <re>` (hidden) — Regex to include repos by full name (used with --from-org)
425
+ - `--exclude-pattern <re>` (hidden) — Regex to exclude repos by full name (used with --from-org)
426
+ - `--skip-import` (hidden) — Only write drafts; skip the actual --from-repo-list run
427
+ - `--iwiki-dual` (hidden) — Enable dual-output mode for --from-iwiki (write codebase sections in addition to learning)
428
+ - `--require-review` (hidden) — Defer codebase section writes to .teamai/pending-review.jsonl for human review
429
+ - `--cache-status` — Show import cache status (repos cached, disk usage)
430
+ - `--cache-gc` — Garbage-collect stale import cache entries
431
+ - `--json` — Output cache status or GC result as JSON
432
+ - `--max-bytes <n>` (hidden) — Override capacity cap for --cache-gc
433
+ - `--stale-days <n>` (hidden) — Threshold for stale-eviction in days (default 30)
434
+
435
+ ## codebase
436
+
437
+ - `teamai codebase` — Inspect and maintain the teamwiki that `teamai import` writes
438
+ - `--project <name>` (hidden) — Codebase slug under teamwiki/evidence/code/, required for --deep-enrich
439
+ - `--upgrade-wiki` (hidden) — Migrate docs/team-codebase/ to teamwiki/ graph format
440
+ - `--lint` — Run global consistency lint over the teamwiki knowledge graph
441
+ - `--reconcile` — Reconcile product and code knowledge in teamwiki
442
+ - `--deep-enrich` — Generate deep knowledge docs from extracted evidence
443
+ - `--fix` (hidden) — Deprecated: teamwiki lint has no autofix; runs lint in report-only mode
444
+ - `--status` — Show knowledge-base git baseline (headSha / repoUrl / branch)
445
+ - `--severity <level>` (hidden) — Minimum severity to report: high|medium|low|info
446
+ - `--json` — Output report as JSON (suitable for CI)
447
+ - `--output <path>` (hidden) — Use <path>/teamwiki, as written by `teamai import --output <path>`, instead of the team repo's
448
+
449
+ ## review
450
+
451
+ - `teamai review [id]` — Inspect and process .teamai/pending-review.jsonl items; --dry-run validates apply decisions and previews rejections without writing documents or removing pending items. With --branch <name>, run read-only health checks on a team repo branch instead
452
+ - `--apply` — Apply the change for the given id (only for codebase-section)
453
+ - `--reject` — Reject the given id without applying
454
+ - `--reason <msg>` — Reason for reject
455
+ - `--all-apply` — Apply all items at or below --max-risk
456
+ - `--max-risk <level>` — Risk ceiling for --all-apply: high|medium|low (default medium)
457
+ - `--branch <name>` — Run read-only health checks on this team repo branch (e.g. teamai/push/<user>/<timestamp>) and report fail/warn/info findings
458
+ - `--json` — Machine-readable output (dry-run decisions include dryRun: true; ok reports validation only; --branch prints the findings object)
459
+
460
+ ## ci
461
+
462
+ - `teamai ci` — CI pipeline integration commands
463
+ - `teamai ci extract-mr` — Extract knowledge from MR/PR and post as comment or write to team repo
464
+ - `--url <url>` — MR/PR web URL
465
+ - `--mode <mode>` — Operation mode: comment | write | both
466
+ - `--team-repo <path>` — Team knowledge repo path (required for write mode)
467
+ - `--comment-marker <marker>` — HTML comment anchor for idempotent updates
468
+ - `--write-mode <mode>` — Write strategy: direct | pending-review
469
+ - `--output <dir>` — Write artifacts to directory
470
+ - `--individual-comments` — Post each suggestion as separate comment with reaction/resolve support
471
+ - `--no-discussions` — Leave the MR's review threads out of the extraction
@@ -0,0 +1,161 @@
1
+ # Scenario: Member — publish a reusable skill
2
+
3
+ Goal: the user turns something they built into team knowledge everyone can pull.
4
+ **Any member can do this — you do not need to be an admin.** The usual entry point
5
+ is the user just asking in plain language, e.g. *"share this xxx skill with my
6
+ team"*, in whatever language they work in.
7
+
8
+ **Publishing is a team-visible action — confirm before you run it.** A plain
9
+ worded request tells you *what* the user wants, not that they are ready to push
10
+ it to everyone. Before `teamai push` / `teamai contribute`, show exactly what
11
+ will be shared (which skill or file, and that it goes to the whole team) and get
12
+ an explicit go-ahead. Do not publish from an offhand mention of "sharing" in
13
+ ordinary conversation — only when the user has clearly asked to publish *this*
14
+ thing now.
15
+
16
+ ## Which kind of contribution?
17
+
18
+ - **A learning** (a lesson, a gotcha, how you solved something) → this is
19
+ **automatic** once recall is on (off by default) and the teamai config loads: TeamAI prompts at the end of a session worth sharing and the
20
+ dedicated `share` workflow (`teamai skill get share`) takes over (it summarizes the
21
+ session and runs `teamai contribute`). The user does not come through this flow
22
+ for it. (Step A below is only a manual fallback for while recall is off.)
23
+ - **A reusable skill** (a `SKILL.md` others invoke) → author the skill, then
24
+ `teamai push` (Step B — the main purpose of this reference).
25
+
26
+ ## Step A — Contribute a learning by hand (fallback only)
27
+
28
+ > Prefer the `share` workflow (`teamai skill get share`). Use these manual steps only while
29
+ > it refuses because recall is off.
30
+
31
+ 1. Write a short Markdown doc that captures the lesson. Keep it concrete and
32
+ actionable — a knowledge base, not a diary. Include YAML frontmatter for search
33
+ indexing:
34
+
35
+ ```markdown
36
+ ---
37
+ title: "<short title of the problem or finding>"
38
+ author: <username>
39
+ date: <YYYY-MM-DD>
40
+ tags: [tag1, tag2, tag3]
41
+ ---
42
+
43
+ ## Background
44
+ What were you doing? What went wrong?
45
+
46
+ ## Solution
47
+ How did you fix it? Key steps.
48
+
49
+ ## Takeaways
50
+ - Lesson 1
51
+ - Lesson 2
52
+ ```
53
+
54
+ 2. Save it to a temp file, then push it to the team:
55
+
56
+ ```bash
57
+ teamai contribute --file /tmp/my-learning.md --title "K8s pod startup timeout"
58
+ ```
59
+
60
+ The doc lands in the team's `learnings/` and appears for teammates on their next
61
+ `teamai pull`. It is also searchable via `teamai recall`.
62
+
63
+ > Tip: while recall is on, `teamai skill get share` auto-summarizes the current
64
+ > session instead of you writing the doc by hand.
65
+
66
+ ## Step B — Contribute a reusable skill
67
+
68
+ 1. Create the skill directory with a `SKILL.md`:
69
+
70
+ ```
71
+ skills/my-skill/SKILL.md
72
+ ```
73
+
74
+ Minimal frontmatter:
75
+
76
+ ```markdown
77
+ ---
78
+ name: my-skill
79
+ description: "One line — what it does and when to use it"
80
+ ---
81
+
82
+ # My Skill
83
+
84
+ Step-by-step instructions the AI should follow.
85
+ ```
86
+
87
+ 2. Publish it:
88
+
89
+ ```bash
90
+ teamai push --skill skills/my-skill # one skill
91
+ # or
92
+ teamai push # review and push everything
93
+ ```
94
+
95
+ To publish into a specific role namespace: `teamai push --skill <path> --role <id>`.
96
+ `--skill <path>` selects that exact local copy after resolving `~` and
97
+ symlinks; a same-named copy in another tool is never a substitute.
98
+ `--role <ns>` / `--project <id>` place every new resource, not only skills: a
99
+ new rule and a new agent land in that namespace too (a project resolves each
100
+ from its own axis — `knowledge` for rules, `agents` for agents). Without one,
101
+ the role and the active projects decide; with neither, a new rule or agent
102
+ stays at the shared root and reaches the whole team. When an active project
103
+ cannot be resolved (not in `manifest/projects.yaml`, or that file is
104
+ missing), push stops with exit 2 until you fix it or pass `--role` /
105
+ `--project`. An edit of a skill, rule or agent you received from a namespace
106
+ goes back to that namespace, even when it replaces a shared item of the same
107
+ name; the shared one is left as it is. A delivered skill copy is pushed only
108
+ when its recorded version matches exactly one current team skill, using that
109
+ path's history since its latest creation after deletion. `--role`, `--project`
110
+ and `--skill` do not establish an origin. If no unique origin is proven, push
111
+ skips the edit with a warning; copy it under a new name to send it as a new
112
+ skill. Use `--branch <name>` when a new push must target a
113
+ specific branch; an existing open PR keeps its recorded branch. TeamAI refuses
114
+ to reset a team-repo clone with user changes, so commit or stash unrelated
115
+ modified, staged, untracked, or conflicted files before retrying.
116
+
117
+ In single-repo mode, a skill or rule under `.teamai/` that matches an older
118
+ version of the team's file, as it does when the branch is behind the default
119
+ branch, is skipped with a warning that it "is an older version of" that file:
120
+ pushing it would revert a teammate's update. To publish an edit of it, bring
121
+ the current version in first (`git fetch origin && git merge origin/<default>`,
122
+ or copy the team's current file over it), redo the edit on top, and push again.
123
+
124
+ ## After contributing
125
+
126
+ - Confirm it landed: `teamai list skills` (or `teamai status`).
127
+ - Teammates receive it automatically on their next session, or via `teamai pull`.
128
+
129
+ Before listing rules, `push` refreshes copies whose bodies still match a recorded
130
+ sync revision. The header teamai generates for a tool's own rules format
131
+ (Cursor `.mdc`, JoyCode's own `.mdc`, Copilot `applyTo`, Kiro `inclusion`, Qoder
132
+ `trigger`, Trae `globs`/`alwaysApply`, CodeBuddy and WorkBuddy `alwaysApply`, Oh My Pi `alwaysApply`/`globs`) does not count as a local edit: unedited old copies update in that
133
+ format, including under `COPILOT_HOME` in user scope. Genuine local body edits remain push candidates.
134
+ Rule pre-sync leaves tools excluded by `enabledAgents` or `disabledAgents` untouched.
135
+ When only team `paths` change, `applyTo` refreshes if the local file still matches
136
+ a recorded version's generated copy; locally edited headers are kept.
137
+ The copies push refreshes are recorded, so a later `teamai pull` still updates them.
138
+ Oh My Pi and Kiro read only the top of their rules directories, so a namespaced
139
+ rule is written flat there (`rules/fe/style.md` as `fe.style.md`); an edit of that file
140
+ pushes back to `rules/fe/style.md`. Push requires a delivery record for the flat copy.
141
+ A personal file with that name is neither refreshed before push nor offered as
142
+ an edit of the team rule.
143
+ If two namespaced rules flatten to the same name, neither is written; `teamai doctor`
144
+ reports the collision even when no other rule reaches that tool. Rename one in the
145
+ team repo, then run `teamai pull`. Doctor also reports team-owned OpenCode globs
146
+ or inline blocks left after the last rule is removed.
147
+
148
+ A new file in the rules directory of a tool with a rules format of its own
149
+ (Cursor, JoyCode, Copilot, Kiro, Qoder, Trae, CodeBuddy, WorkBuddy, Oh My Pi) is the
150
+ member's own rule in that tool's format: push never offers it, and pull leaves
151
+ it. To author a new team rule, write it as a plain `.md` in `.claude/rules/`
152
+ (scope it with `paths:` frontmatter, which teamai renders into each tool's
153
+ format), then run `teamai push`. A YAML comment after an unquoted glob stays
154
+ outside its scope: `paths: **/*.ts # TypeScript files` matches `**/*.ts`, including
155
+ when written as a block-list entry under `paths:`.
156
+
157
+ ## If push is denied
158
+
159
+ A permission error usually means you don't have write access to the team repo.
160
+ Copy the exact error to your admin and ask them to grant access. (In read-only
161
+ HTTP mode, `contribute` / `push` are not available — you can only consume.)