Tencent's teamai-cli: One Git Repo to Rule 20+ AI Coding Assistants

Tencent's open-source teamai-cli solves fragmented AI coding assistant configurations by using a shared Git repository to distribute skills, rules, MCP configs, and hooks across 20+ tools like Cursor and Claude Code, enabling Git-native collaboration, automatic friction-based knowledge capture, and code knowledge graph retrieval for team-wide AI governance.

AI Architecture Path
AI Architecture Path
AI Architecture Path
Tencent's teamai-cli: One Git Repo to Rule 20+ AI Coding Assistants

Problem: Fragmented AI Assistant Configurations

Teams using multiple AI coding assistants (Cursor, Claude Code, Codex, WorkBuddy, Windsurf, etc.) face configuration chaos. Each developer maintains local skills, coding standards, MCP configurations, and security rules independently. Sharing a useful AI skill requires manual file transfers via chat; onboarding new members means copying configs one by one; updates leave most teammates on stale versions. Consequently, the same task yields wildly different code styles and security checks, making code reviews painful. Moreover, hard-won debugging experience disappears when a session ends — colleagues repeat the same mistakes because tribal knowledge isn't captured.

Solution: teamai-cli — Git-Native AI Collaboration Infrastructure

Tencent recently open-sourced teamai-cli (MIT license, TypeScript). It doesn't build a new platform; instead it reuses developers' familiar Git workflow to centrally manage all AI assistant resources — Skills, Rules, documentation, Hooks, MCP configs — while automatically capturing team debugging experience and building a code knowledge graph. The tool addresses two core problems: configuration fragmentation and experience loss.

Core Concept

In one sentence: put all AI Agent "gear" into a shared Git repo and distribute it to every developer via Git, achieving one configuration for multiple tools and a single team-wide AI behavior standard. Previously each developer's AI config was a private dialect; teamai-cli becomes the common language. Developers keep their preferred AI client, but the rules, skills, and reference docs the AI follows are identical. It's essentially an AI tooling management layer — like injecting an employee handbook, coding standards, knowledge base, and security scripts directly into everyone's local AI tools. No centralized service is required; versioning, review, and rollback all use native Git, so learning curve is near zero.

Four Core Capabilities

1. Cross-Tool Unified Harness Distribution: Write Once, Sync to 20+ AI Tools

Supports Claude Code, Codex, Cursor, CodeBuddy, WorkBuddy, Gemini CLI, Windsurf, Trae, Aider, Amp, OpenClaw, and more. Traditional pain point: a skill tuned in Claude must be rewritten for Cursor, and again for Codex, leading to drift. teamai-cli stores all Skills, Rules, docs, Hook scripts, and MCP service configs in the Git repo. Running teamai pull automatically distributes resources to each tool's native directory:

Claude Code: ~/.claude/skills/ Cursor: ~/.cursor/skills/ Codex, CodeBuddy, etc.: corresponding directories

MCP services are declared once in mcp/mcp.yaml; sync converts them to each tool's native format, with secrets using environment variable placeholders so they're never committed. Hooks are defined in hooks/hooks.yaml and can bind events/tools — e.g., a PreToolUse hook that runs a secret-scanning script before any AI command executes, enforcing a unified security gate.

2. Git-Native Collaboration Flow: Reuse MR Reviews, Zero Extra Training

teamai-cli invents no new protocol; it's pure Git workflow:

Local AI resource changes → teamai push auto-creates a branch and opens MR → review & merge → next time a member starts an AI session, the SessionStart hook silently runs teamai pull to sync latest config.

Admins set up a shared repo on GitHub/TGit/CNB; members run teamai init once to connect. Changes propagate automatically — no manual notifications needed. Role isolation is supported via manifest/roles.yaml: backend, frontend, PM, DevOps get separate skill namespaces. Members switch roles with teamai roles set dev; pull then fetches only that role's resources. Composite roles (primary + additive) handle hybrid positions. Individuals can locally exclude unwanted skills without affecting the shared repo:

teamai skill exclude add xxx-skill
teamai pull

3. Friction-Signal-Driven Experience Capture: Auto-Detect High-Value Debugging Sessions

This is the most creative design. It doesn't record every session indiscriminately; it identifies high-value struggle scenarios. A Stop Hook collects friction signals : manual AI interruption, rejected tool calls, repeated AI command retries — all marked as friction. Smooth, one-shot tasks don't trigger alerts; only sessions with repeated battles and failures prompt:

[teamai] This session may contain record-worthy issues: you interrupted AI 2 times, AI retried failed tools 8 times. Task: Fix duplicate project-level Hook injection Suggest running /teamai-share-learnings to summarize and share this experience.

On confirmation, the AI auto-summarizes the debugging experience and commits it to the team Git repo, turning personal trial-and-error into shared knowledge.

4. Knowledge Recall + Code Knowledge Graph: AI No Longer Blind

After knowledge accumulates, AI must retrieve it at the right moment. Enable recall: teamai recall enable On each task start, the teamai-recall sub-agent automatically searches the team knowledge base using BM25 + graph-enhanced ranking, with a relevance pre-check to skip unrelated tasks and avoid overhead. Manual search:

teamai recall "GPU memory overflow"
teamai import

parses a code repo to generate a structured code knowledge graph, extracting components, interfaces, configs, and cross-repo dependencies. Search results include source file paths so AI can jump directly to relevant code instead of scanning the whole repo. Batch import for an entire organization: teamai import --from-org myorg Cross-team skill subscription builds an internal AI skill federation: security team maintains a code-audit skill; business teams subscribe without reinventing:

teamai source add https://github.com/other-team/teamai-public.git --name other-team
teamai source browse other-team

Complete Hands-On Steps

Prerequisites

Node.js ≥18, Git environment.

1. Global Install

npm install -g teamai-cli
# verify
teamai --version

2. Admin Initialize (Team Repo, One-Time)

Create empty repo on Git platform, recommended name TeamAi-团队名, grant members read/write. Two init scopes:

# Project-level: resources live in current project dir, travel with project (recommended for business projects)
cd /path/to/my-project
teamai init <组织>/TeamAi-团队名

# User-level: resources in ~ dir, shared across all projects on this machine
teamai init <组织>/TeamAi-团队名 --scope user

Inheritance mode lets project repo layer on top of user-level public security resources: teamai init <仓库地址> --inherit-user-scope Small teams/individuals: run teamai init without a pre-existing repo; it auto-creates one. Can also init inside a business repo — config lives in .teamai/ without polluting main code.

3. Team Member Onboarding

npm install -g teamai-cli
cd /path/to/my-project
teamai init https://github.com/组织/TeamAi-团队名

Done — subsequent AI sessions auto-sync.

4. Daily High-Frequency Commands

# Push changes, auto-create MR
teamai push
# Push all without confirmation
teamai push --all
# Manual pull latest config
teamai pull
# Dry-run preview
teamai pull --dry-run
# View local status
teamai status
# List all Skills/Rules/MCP/Hooks
teamai list
# View members
teamai members
# Inspect a skill
teamai skill show <技能名>
# Knowledge recall management
teamai recall enable
teamai recall "search keyword"
# Import code to generate knowledge graph
teamai import --from-repo 仓库地址
# Subscribe external team skill source
teamai source add <仓库地址> --name 别名
# Diagnose local issues
teamai doctor
# Export session, generate weekly digest
teamai session save
teamai digest

Launch local dashboard to view team AI usage data:

teamai dashboard --port 8080

Limitations to Consider

Auto-sync relies on AI tool's SessionStart Hook. If the client lacks Hook support or Hooks are disabled, auto-sync fails — fallback to manual teamai pull.

Knowledge recall is disabled by default ; must be enabled manually to avoid unnecessary retrieval overhead.

Tools outside the supported list need community-contributed adapters.

Who Should Adopt teamai-cli

✅ Teams mixing multiple AI assistants wanting unified coding standards, security checks, MCP configs.

✅ Teams with many new hires/outsource staff needing one-click delivery of full AI usage norms.

✅ Teams repeatedly hitting the same pitfalls, wanting to capture AI interaction lessons.

✅ Enterprises seeking cross-team AI capability reuse (e.g., security team distributing audit skills).

✅ Organizations avoiding complex AI platforms, preferring low-cost governance atop existing Git.

❌ Teams using a single AI tool with no multi-agent config sync needs.

❌ Teams without Git collaboration flow, unwilling to adopt MR review model.

Conclusion

AI coding tools evolve rapidly — models and clients update constantly — but the rules, skills, and team experience governing them remain locked on individual laptops, an overlooked pain point. teamai-cli doesn't chase disruptive concepts; it picks the most pragmatic path: reuse Git, bringing AI configuration and experience into the mature code collaboration system . No new platform, no workflow rewrite. One-time setup gives team-wide AI capability distribution, automatic debugging experience capture, and ultra-low-cost AI Agent governance.

Project source: https://github.com/Tencent/teamai-cli
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

knowledge sharingconfiguration managementdeveloper toolsGit workflowTencent open sourceAI coding assistantsAI agent governanceteamai-cli
AI Architecture Path
Written by

AI Architecture Path

Focused on AI open-source practice, sharing AI news, tools, technologies, learning resources, and GitHub projects.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.