---
name: setup
description: >-
  TeamAI day 0 and repo lifecycle: create a team repo as admin, join an existing team as a member, manage members, roles, MCP and env, and uninstall. Loaded on demand by the teamai discovery stub.
title: setup
canonical_url: https://skilld.dev/gh/tencent/teamai-cli/setup
last_updated: 2026-10-15T13:02:45.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/join-member.md](https://skilld.dev/api/skills-raw/tencent/teamai-cli/setup/references/join-member.md), [references/manage-admin.md](https://skilld.dev/api/skills-raw/tencent/teamai-cli/setup/references/manage-admin.md), [references/provider-tgit.md](https://skilld.dev/api/skills-raw/tencent/teamai-cli/setup/references/provider-tgit.md), [references/setup-admin.md](https://skilld.dev/api/skills-raw/tencent/teamai-cli/setup/references/setup-admin.md), [references/uninstall.md](https://skilld.dev/api/skills-raw/tencent/teamai-cli/setup/references/uninstall.md).
>
> If the user asked to install this Skill, run `npx skilld install tencent/teamai-cli/setup`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/setup`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/tencent/teamai-cli/setup) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/setup`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/setup --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/setup --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# teamai — setup and lifecycle

You run the commands; the user only makes choices when you ask. **They may not
know Git** — never explain branches, commits or clones.

## Before anything

```bash
node --version      # must be >= 20
teamai --version    # install once with: npm install -g teamai-cli
```

Then pick the flow. A user **setting up a new team** becomes its admin and creates
the repo; a user **joining an existing team** needs a repo URL from their admin. A
would-be member without a URL is still the **join** flow — `join-member.md` tells
them how to ask for it. Do not send them to the create-repo flow because the URL
is missing.

| The user wants to…                                                          | Load this                                   |
|-----------------------------------------------------------------------------|---------------------------------------------|
| Set up TeamAI for a team from scratch (create the repo)                      | `{SKILL_DIR}/references/setup-admin.md`     |
| Join their team, with or without a repo URL                                  | `{SKILL_DIR}/references/join-member.md`     |
| Publish or update skills, rules, MCP, env; invite members; manage roles      | `{SKILL_DIR}/references/manage-admin.md`    |
| Remove TeamAI from this machine                                              | `{SKILL_DIR}/references/uninstall.md`       |
| Publish one skill or contribute a doc                                        | `"$(teamai skill path core)/references/contribute-member.md"` |
| Anything that breaks along the way                                           | `"$(teamai skill path core)/references/troubleshooting.md"` |

Supported Git providers are Tencent TGit, GitHub, GitLab and CNB;
`{SKILL_DIR}/references/setup-admin.md` carries the detection probe, the sign-in
and create-repo URLs, and the per-provider caveats, and points at
`{SKILL_DIR}/references/provider-tgit.md` for everything TGit-specific.

## Rules for these flows

1. **Always use a full URL** for the team repo (e.g.
   `https://github.com/your-org/your-repo`). Never the `owner/repo` short form.
2. **Don't limit which AI tools get set up — cover all of them by default.**
   Unless the user names specific tools, do **not** pass `--agent` to restrict the
   install. Let `teamai init` set up every AI tool already installed (omitting
   `--agent` gives an interactive picker; select all detected tools). **After init,
   report which agents were set up** — in the user's language, which tools now
   auto-start TeamAI, which detected tools were skipped and why (e.g. CodeBuddy
   design), and any installed hooks that still need trust (e.g. Codex with
   automatic trust disabled or unavailable). Verify the real per-tool result with
   `teamai doctor` and `teamai hooks list`.
3. **`teamai init` does not pull.** It saves the config and installs hooks. It does
   not copy team skills, rules or MCP. In workspace scope it creates a tool directory
   only for a tool named with `--agent`, or picked when a person runs it in a
   terminal. Those resources arrive on that tool's next session start, or when you
   run `teamai pull`. Run from an agent shell (no terminal), a workspace-scope init
   without `--agent` creates no tool directory: the directory appears when the user
   opens that tool in the project, and that session start pulls.
4. **Finish with `teamai doctor`.** Every setup or onboarding flow ends by running
   it and resolving what it reports before you call the job done.

Every public command and every flag, including the flags `--help` hides, is listed in
`teamai skill get core --full` under `references/commands.md`. Do not guess a flag:
there is no member-invite flag, for instance — inviting happens on the Git
platform's website, as `manage-admin.md` describes.

## References

In the files below, `{SKILL_DIR}` is the directory `teamai skill path setup` prints; a reference file you open on its own writes that directory as `SKILL_DIR` in braces.

| File | When to load it |
|---|---|
| `{SKILL_DIR}/references/setup-admin.md` | Creating a team repo: provider detection, auth, repo creation, first push. |
| `{SKILL_DIR}/references/join-member.md` | Joining an existing team from a repo URL. |
| `{SKILL_DIR}/references/manage-admin.md` | Day-to-day admin: publishing resources, roles, projects, MCP, env, members. |
| `{SKILL_DIR}/references/uninstall.md` | Removing TeamAI from a machine or from one agent. |
| `{SKILL_DIR}/references/provider-tgit.md` | Tencent TGit: reachability probe, `gf` install and login, repo creation on init. |

`teamai skill get setup --full` prints this skill with all five appended.
