teamai-cli 0.25.0-beta.6 → 0.25.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
@@ -23,15 +23,11 @@
23
23
 
24
24
  TeamAI turns individual AI capabilities into shared team capabilities — across agents, machines, and team members.
25
25
 
26
- ## Contributors
27
-
28
- Thanks to everyone who has contributed to TeamAI!
29
-
30
- <a href="https://github.com/Tencent/teamai-cli/graphs/contributors">
31
- <img src="https://contrib.rocks/image?repo=Tencent/teamai-cli" alt="Contributors" />
32
- </a>
26
+ ## Why TeamAI
33
27
 
34
- Made with [contrib.rocks](https://contrib.rocks).
28
+ <p align="center">
29
+ <img src="assets/use-cases.png" alt="Eight everyday scenarios, before and after TeamAI" width="100%">
30
+ </p>
35
31
 
36
32
  ## Quick Start
37
33
 
@@ -52,10 +48,12 @@ Once TeamAI is set up, just talk to the `/teamai` skill in your AI tool:
52
48
  **Join a team**
53
49
 
54
50
  ```text
55
- /teamai Help me join my team's TeamAI, repo URL is https://github.com/yourorg/yourrepo
51
+ /teamai Help me join my team's TeamAI, repo URL is https://github.com/your-org/your-repo
56
52
  ```
57
53
 
58
- **Share a skill with the team**
54
+ **Share with the team**
55
+
56
+ Skills, rules, MCP servers, and other agent resources can all be shared:
59
57
 
60
58
  ```text
61
59
  /teamai Share my xxx skill with the team
@@ -68,7 +66,7 @@ Once TeamAI is set up, just talk to the `/teamai` skill in your AI tool:
68
66
  ```
69
67
 
70
68
  <details>
71
- <summary>Prefer the command line? (manual setup)</summary>
69
+ <summary>Command-line install</summary>
72
70
 
73
71
  ### Install
74
72
 
@@ -78,7 +76,7 @@ npm install -g teamai-cli
78
76
 
79
77
  ### Team admin / solo user
80
78
 
81
- Create a shared-experience repo on your git host (GitHub, GitLab, GitCode, CNB, TGit, or a private Git service), **grant write access to team members**, then run `teamai init https://github.com/yourorg/yourrepo`.
79
+ Create a shared-experience repo on your git host (GitHub, GitLab, GitCode, CNB, TGit, or a private Git service), **grant write access to team members**, then run `teamai init https://github.com/your-org/your-repo`.
82
80
 
83
81
  > **No team repo yet?** Start from a template pre-loaded with production-ready skills, rules, and review agents. Browse the [teamai-hub](https://github.com/teamai-hub) org, click **Fork**, then `teamai init` against your new repo.
84
82
 
@@ -89,237 +87,38 @@ Create a shared-experience repo on your git host (GitHub, GitLab, GitCode, CNB,
89
87
 
90
88
  # Project-scope init (default, resources installed under the project directory)
91
89
  cd /path/to/my-project
92
- teamai init https://github.com/yourorg/yourrepo
90
+ teamai init https://github.com/your-org/your-repo
93
91
 
94
92
  # Or, user-scope init (resources installed under ~/)
95
- teamai init https://github.com/yourorg/yourrepo --scope user
93
+ teamai init https://github.com/your-org/your-repo --scope user
96
94
  ```
97
95
 
98
96
  Once initialized, every AI session automatically pulls the latest skills / rules and other Harness updates published by admins — no manual sync needed.
99
97
 
100
98
  </details>
101
99
 
102
- > **Full usage guide:** [docs/usage-guide.md](docs/usage-guide.md) ([中文版](docs/usage-guide.zh-CN.md)) — covers everything from team creation to day-to-day use.
103
-
104
- ## Product architecture
105
-
106
- **Team Execution × Team Context (beta) × Team Improvement (beta)**:
107
-
108
- | Layer | Job | In this CLI today |
109
- |-------|-----|-------------------|
110
- | **Team Execution** | Make every agent work the team's way | `init` / `pull` / `push`, skills, rules, agents, hooks, MCP, env |
111
- | **Team Context** (beta) | Make every agent understand the team | recall, learnings, codebase graph, teamwiki... |
112
- | **Team Improvement** (beta) | Make every execution improve the team | friction-based share-learnings, sessions, digest, dashboard... |
113
-
114
- ## Overview
115
-
116
- <table>
117
- <thead>
118
- <tr>
119
- <th rowspan="2">Agent</th>
120
- <th colspan="7">Team Execution</th>
121
- <th colspan="3">Team Context (beta)</th>
122
- <th colspan="3">Team Improvement (beta)</th>
123
- </tr>
124
- <tr>
125
- <th>skills</th><th>rules</th><th>docs</th><th>env</th><th>agents</th><th>hooks</th><th>mcp</th>
126
- <th>learnings</th><th>codebase</th><th>teamwiki</th>
127
- <th>usage</th><th>sessions</th><th>dashboard</th>
128
- </tr>
129
- </thead>
130
- <tbody>
131
- <tr><td>Claude Code</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
132
- <tr><td>Codex</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
133
- <tr><td>Cursor</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
134
- <tr><td>GitHub Copilot CLI</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
135
- <tr><td>CodeBuddy</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
136
- <tr><td>WorkBuddy</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
137
- <tr><td>OpenCode</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
138
- <tr><td>OpenClaw</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
139
- <tr><td>Hermes</td><td align="center">✓</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
140
- <tr><td>DeepSeek Harness</td><td align="center">✓</td><td align="center">—</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
141
- <tr><td>Qoder</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
142
- <tr><td>Kiro</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
143
- <tr><td>ZCode</td><td align="center">✓</td><td align="center">—</td><td align="center">✓</td><td align="center">—</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td></tr>
144
- <tr><td>Oh My Pi</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">✓</td><td align="center">—</td><td align="center">—</td><td align="center">—</td></tr>
145
- </tbody>
146
- </table>
147
-
148
- **Git providers** — GitHub · GitLab · GitCode · CNB · TGit · private Git service.
149
-
150
- ### Distribution Controls
151
-
152
- Team-wide settings an admin configures once and delivers to every member on `teamai pull`:
153
-
154
- | Capability | Command | What it does |
155
- |------------|---------|--------------|
156
- | **Projects** | `teamai projects` | Bind a working directory to one or more logical projects so it syncs that project's skills, knowledge, and isolated learnings. Orthogonal to roles. |
157
- | **Roles** | `teamai roles` | Define role → namespace mappings so each member syncs only the skills for their role. |
158
- | **Tags** | `teamai tags` | Tag skills / rules so members subscribe to just the tags they need. |
159
- | **Sources** | `teamai source` | Subscribe to additional skill repos — other teams' public repos, or shared/public repos within your own org; subscribed skills sync automatically on pull. |
160
-
161
- Learnings isolation: `learnings/` at the repo root is shared with everyone; `learnings/<project-id>/` is project-private. See the [usage guide](docs/usage-guide.md#multi-project-project-as-a-dimension-orthogonal-to-role).
162
-
163
- ## Team Execution
164
-
165
- > One Team. One Harness. Every Agent.
166
-
167
- TeamAI keeps skills, rules, docs, and hooks in a shared git repo and distributes them to every member's local AI tools through a "push → review & merge → pull" flow — with support for subscribing to other teams' or shared repos' Harness.
168
-
169
- ### How It Works
170
-
171
- ```
172
- teamai push → create branch + MR → reviewer approves + merges
173
- ↓
174
- SessionStart hook → teamai pull → synced to local AI tools
175
- ```
176
-
177
- ### What Gets Shared
178
-
179
- Each resource is delivered to every agent:
180
-
181
- | Resource | In the team repo | Notes |
182
- |----------|------------------|-------|
183
- | **Skills** | `skills/<name>/SKILL.md` | |
184
- | **Rules** | `rules/*.md` | |
185
- | **Docs** | `docs/` | Foundational project docs; not all loaded by default (progressive disclosure) |
186
- | **Agents** | `agents/<name>.yaml`, `agents/<namespace>/<name>.yaml` | Root agents reach everyone; a namespace directory ships only to roles/projects that list it under `agents:` |
187
- | **Culture** | `culture.md` | Team mission, values, and working principles — injected into each agent's CLAUDE.md / AGENTS.md so every session inherits them |
188
- | **CLAUDE.md** | `claudemd/*.md` | |
189
- | **Env** | `env/` | Shared team-level environment variables and switches; do not put secrets here |
190
- | **Hooks** | `hooks/hooks.yaml` | Each hook may carry `roles:` to reach only members holding one of those roles |
191
- | **MCP** | `mcp/mcp.yaml` | Each server may carry `roles:` to reach only members holding one of those roles |
192
- | **Packages** | `teamai.yaml` | Currently npm packages and Claude Code plugins only |
193
- | **Models** | — | Not implemented for every provider yet |
194
-
195
- For file formats and full workflows, see the [Usage Guide](docs/usage-guide.md).
196
-
197
- ## Team Context (beta)
198
-
199
- > Every agent understands how the team works.
200
-
201
- Beyond distributing the Harness, TeamAI organizes accumulated team experience and code structure into a searchable knowledge base that the AI recalls automatically when needed.
202
-
203
- ### Automatic Experience Sharing
204
-
205
- When a session ends, the Stop hook scores it by **friction** — signals that the session hit something worth remembering: you interrupted or corrected the AI, denied a tool call, or the AI had to retry failing tools. A long-but-routine session (lots of tool calls, no friction) does not trigger; a session where you actually fought a problem does. If the score is high enough, the AI suggests:
206
-
207
- ```
208
- [teamai] This session may contain a problem worth documenting: you interrupted the AI twice, the AI retried failing tools 8 times.
209
-
210
- Task: Fix duplicate project-level Hook injection
211
-
212
- Consider running /teamai-share-learnings to summarize what you learned and share it with your team.
213
- ```
214
-
215
- The hint names the non-zero friction signals that triggered it and, when available, includes a redacted, single-line summary of the first task. The `/teamai-share-learnings` skill summarizes the session and pushes a learning document directly to the team repo. Each session is prompted at most once. Teams can switch the hint off with `sharing.contributeHint.enabled: false` in `teamai.yaml` (members: `contributeHintEnabled` in local config) while keeping the rest of the Stop hook.
216
-
217
- ### Team Knowledge Recall
100
+ ## Learn More
218
101
 
219
- Let the AI automatically search accumulated team knowledge before a task. This feature is **off by default** and must be enabled explicitly — teams can set `sharing.recall.enabled: true` in `teamai.yaml` as the default, and members can override locally:
102
+ - [Usage Guide](docs/usage-guide.md) ([中文版](docs/usage-guide.zh-CN.md)) — setup, onboarding, daily workflows, and commands
103
+ - [Product Overview](docs/product-overview.md) ([中文版](docs/product-overview.zh-CN.md)) — architecture, capabilities, and agent support
104
+ - [Git Providers](docs/providers.md) — supported repository providers
105
+ - [Windows Setup](docs/windows-hooks.md) ([中文版](docs/windows-hooks.zh-CN.md)) — hooks and shell configuration
106
+ - [Technical Designs](docs/designs/) — design documents and proposals
220
107
 
221
- ```bash
222
- teamai recall enable # on: deploy the teamai-recall subagent + inject guidance rules
223
- teamai recall disable # off: remove the subagent and rules
224
- teamai recall status # show effective state (team default + user override)
225
- ```
226
-
227
- **Search runs via a subagent**: once enabled, `teamai pull` deploys the built-in `teamai-recall` subagent into each AI tool's `agents/` directory. The AI invokes it before a task — the subagent extracts keywords, runs the search, reads the matched source files, and returns a structured summary of team knowledge. The subagent first runs a relevance precheck (`teamai recall --check`) and skips retrieval entirely when the task is unrelated to team knowledge. Under the hood it shells out to the `teamai recall` command, which you can also run manually:
228
-
229
- ```bash
230
- $ teamai recall "port conflict"
231
- [1/2] MR review caught a port-conflict bug ★1 [user]
232
- Author: member-a | Score: 18.5 | Tags: troubleshooting, networking
233
-
234
- [2/2] Deployment configuration best practices [project]
235
- Author: member-b | Score: 12.0 | Tags: deploy, config
236
- Matched: conflict | Missing: port
237
- ```
238
-
239
- ### Codebase Knowledge Graph
240
-
241
- `teamai import` parses source repos into a structured graph under `teamwiki/`, enabling structurally-aware retrieval:
242
-
243
- ```bash
244
- teamai import --from-repo https://github.com/org/repo
245
- teamai import --from-org myorg # batch import all repos
246
- teamai codebase --extract /path/to/repo # local extract into teamwiki/
247
- teamai codebase --deep-enrich --project my-service --output /path/to/repo # generate deep knowledge docs
248
- teamai codebase --reconcile --output /path/to/repo # map product docs to code pages
249
- teamai codebase --lint --output /path/to/repo # check the locally extracted graph
250
- ```
251
-
252
- Extract writes `teamwiki/evidence/code/<project>/_manifest.json` even when AI enrichment is skipped or produces nothing, so `--deep-enrich` can start.
253
-
254
- The graph stores components, interfaces, configs, and cross-repo import edges. `teamai recall` uses it for graph-boosted re-ranking.
255
- When a recall hit comes from a codebase page, the result includes a `Sources:` line listing the relevant source file paths — giving agents a direct starting point for code changes instead of re-exploring the repo.
256
-
257
- Edges come from two tracks that run together, with AST results taking precedence on overlap:
258
-
259
- - **AST track** (TypeScript/JavaScript, Python, Go): a WASM [tree-sitter](https://tree-sitter.github.io/) parser resolves `import`/`require`, call sites, and TS `implements` clauses to precise file-to-file `DEPENDS_ON` / `REFERENCES` / `IMPLEMENTS` edges (tagged `code-ast`, with confidence weights).
260
- - **Heuristic track** (all languages, including Java/Rust): regex-based extraction (tagged `code-heuristic`), which also covers languages the AST track does not.
261
-
262
- The WASM parser is a pure-JavaScript dependency — no native toolchain is required. If it fails to load for any reason, extraction falls back to the heuristic track and records an `AST_UNAVAILABLE` gap. Set `TEAMAI_SKIP_AST=1` to force heuristic-only extraction.
263
-
264
- ## Team Improvement (beta)
108
+ ## Contributors
265
109
 
266
- > Every execution makes the entire team smarter.
110
+ Thanks to everyone who has contributed to TeamAI!
267
111
 
268
- ### Maintenance
112
+ <a href="https://github.com/Tencent/teamai-cli/graphs/contributors">
113
+ <img src="https://contrib.rocks/image?repo=Tencent/teamai-cli" alt="Contributors" />
114
+ </a>
269
115
 
270
- As skills and knowledge accumulate, prune what the team no longer uses. `teamai recall maintenance` archives low-confidence learnings and flags stale skills, rules, and docs for cleanup or updates:
116
+ Made with [contrib.rocks](https://contrib.rocks).
271
117
 
272
- ```bash
273
- teamai recall maintenance --prune --dry-run # preview
274
- teamai recall maintenance --prune --archive # archive unused learnings
275
- teamai recall maintenance --update-quality # draft updates for stale skills / docs
276
- ```
118
+ ## Contributing
277
119
 
278
- Insight into how the team actually uses its AI tools, and a starting point for turning session friction into shared skills, rules, and knowledge:
279
-
280
- | Capability | Command | What it shows |
281
- |------------|---------|---------------|
282
- | **Usage** | `teamai digest` | Weekly team digest — 7-day success, prompt, active-time, estimated cost, cache, and correction trends, plus lifetime totals. |
283
- | **Sessions** | `teamai session save` | Privacy-scrubbed per-session summaries (tool sequence, prompt turns, interventions) that feed the digest's Session Highlights. |
284
- | **Dashboard** | `teamai dashboard` | Unified Overview / Team Execution / Team Context / Team Improvement views with local live sessions, 7-day trends, estimated cost per session, English/Chinese, and light/dark/system themes. |
285
- | **KB Health** | `teamai dashboard` → Team Context / Team Improvement | Coverage by type, top-recalled and silent entries, last-recall month distribution, author contributions, and maintenance; the full `/kb-report` remains available. |
286
-
287
- ## Commands
288
-
289
- | Command | Description |
290
- |---------|-------------|
291
- | `teamai init` | Initialize: OAuth login, link repo, register member, inject hooks |
292
- | `teamai pull` | Pull team resources and inject into local AI tools |
293
- | `teamai push` | Push local resources to a branch and open a Merge Request |
294
- | `teamai packages [install] [target]` | Install declared npm packages and Claude plugins; with a target, also update `teamai.yaml`. Bare `teamai packages` installs everything; `teamai packages install <target>` adds one |
295
- | `teamai status` | Show local vs team repo diff and resource counts, including namespaced skills and nested docs |
296
- | `teamai contribute` | Share session experience to the team repo's `teamai-learnings` branch |
297
- | `teamai recall <query>` | Search the team knowledge base (BM25 + graph-boost) |
298
- | `teamai recall enable/disable/status` | Toggle or check recall state |
299
- | `teamai recall promote [learningId]` | Promote a high-confidence learning to formal knowledge (skills/rules/docs) |
300
- | `teamai recall maintenance` | Maintain knowledge base health: prune low-confidence learnings, writeback confidence scores, flag stale entries |
301
- | `teamai import` | Import knowledge (`--dir`, `--from-repo`, `--from-org`, `--from-repo-list`, `--from-mr`) |
302
- | `teamai codebase --extract [path]` | Extract code facts and build the local graph under `teamwiki/` |
303
- | `teamai codebase --deep-enrich` | Generate deep knowledge docs from extracted evidence |
304
- | `teamai codebase --reconcile` | Reconcile product documentation with extracted code knowledge |
305
- | `teamai codebase --lint` | Knowledge graph health check |
306
- | `teamai ci extract-mr --url <url>` | CI: extract knowledge from MR, post comments, write after merge |
307
- | `teamai members` | List team members |
308
- | `teamai projects` | Bind a working directory to one or more logical projects |
309
- | `teamai roles` | Manage team roles and namespaces |
310
- | `teamai tags` | Manage tag-based skill/rule filtering |
311
- | `teamai skill exclude add/remove/list` | Manage skills excluded from local sync ([usage guide](docs/usage-guide.md#excluding-skills-you-dont-need)) |
312
- | `teamai source` | Manage skill subscription sources (other teams or your org's shared repos) |
313
- | `teamai remove <type> <name>` | Remove a resource and open MR |
314
- | `teamai session save` | Record a privacy-scrubbed session summary to a monthly log (`--push` feeds `digest`) |
315
- | `teamai digest` | Generate weekly team usage digest |
316
- | `teamai doctor` | Diagnose configuration issues (`--json` for CI, hooks and agents) |
317
- | `teamai uninstall` | Remove all teamai resources and hooks |
120
+ Join the conversation, or open an issue or PR. See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for how to contribute.
318
121
 
319
122
  ## License
320
123
 
321
124
  [MIT](LICENSE)
322
-
323
- ## Contributing
324
-
325
- PRs are welcome! Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) first.