Thanks for your interest in improving TeamAI! This document explains how to get a dev environment running, how to structure changes, and how to get your PR merged.
git clone https://github.com/Tencent/teamai-cli.git
cd teamai-cli
npm installnpm run build # Build with tsup → dist/
npx tsc --noEmit # Type check
npx vitest run # Run unit tests
npx vitest run --coverage
npm run test:e2e # E2E tests (optional, requires a live test repo)npm link
teamai --versionsrc/
providers/ # git hosting provider abstraction
github/ # GitHub (gh CLI or GITHUB_TOKEN)
tgit/ # Tencent TGit (gf CLI)
resources/ # per-resource-type handlers (skills, rules, docs, env, ...)
utils/ # shared helpers (git, fs, logger, prompt, ...)
*.ts # top-level command entry points (init, push, pull, ...)
See docs/providers.md for how to add a new git provider.
- Fork the repo and create a feature branch from
master. - Write tests for your change (we target 80%+ coverage).
- Run
npx vitest runandnpx tsc --noEmit— both must pass. - Use conventional commits where possible:
feat:,fix:,chore:,docs:,refactor:,test:. - Open a PR with a clear description: what's the problem, what's the fix, anything reviewers should pay attention to.
- TypeScript strict mode is on; avoid
anyunless genuinely needed. - Prefer async/await over callbacks.
- Keep commands in
src/*.tsthin — heavy lifting lives insrc/resources/orsrc/utils/. - Avoid narrating comments ("// increment counter"). Comments should explain why, not what.
- Unit tests go in
src/__tests__/. Mirror the source file name (init.ts→init.test.ts). - Mock external I/O (git, fetch, child_process) at the module boundary.
- Avoid relying on real network access unless guarded by an env variable (like
TEAMAI_TEST_TOKEN).
Please file issues at github.com/Tencent/teamai-cli/issues. Include:
- What you tried to do
- What happened (error output, stack trace)
- What you expected
- Your OS, Node.js version, and
teamai --version
For security issues, please do not open a public issue. Email the maintainers or use GitHub's private vulnerability reporting.
By contributing, you agree your contribution will be licensed under the MIT License.