|
| 1 | +--- |
| 2 | +title: Agent Setup |
| 3 | +description: Use `ai-devkit install` to apply or reconcile AI agent setup from your project configuration. |
| 4 | +--- |
| 5 | + |
| 6 | +The `ai-devkit install` command applies your saved project configuration (`.ai-devkit.json`) to your workspace. |
| 7 | +It is the best command for repeatable setup, onboarding, and syncing agent files after configuration changes. |
| 8 | + |
| 9 | +Before running these commands: |
| 10 | +- Install AI DevKit (`npm install -g ai-devkit`) or use `npx ai-devkit@latest ...` |
| 11 | +- Run commands from your project root directory |
| 12 | + |
| 13 | +## When to Use `install` vs `init` |
| 14 | + |
| 15 | +Use `ai-devkit init` when: |
| 16 | +- You are setting up AI DevKit in a project for the first time |
| 17 | +- You want interactive prompts to choose environments and phases |
| 18 | +- You want non-interactive bootstrap from a template file (`ai-devkit init --template`) |
| 19 | + |
| 20 | +Use `ai-devkit install` when: |
| 21 | +- `.ai-devkit.json` already exists |
| 22 | +- You want deterministic setup without re-answering prompts |
| 23 | +- You want to reconcile missing agent files or command folders |
| 24 | + |
| 25 | +## Basic Usage |
| 26 | + |
| 27 | +Create a file named `fullstack-engineer.yaml` in your project root with this content: |
| 28 | + |
| 29 | +```yaml |
| 30 | +environments: |
| 31 | + - cursor |
| 32 | + - claude |
| 33 | + - codex |
| 34 | +phases: |
| 35 | + - requirements |
| 36 | + - design |
| 37 | + - planning |
| 38 | + - implementation |
| 39 | + - testing |
| 40 | +skills: |
| 41 | + - registry: codeaholicguy/ai-devkit |
| 42 | + skill: debug |
| 43 | + - registry: codeaholicguy/ai-devkit |
| 44 | + skill: dev-lifecycle |
| 45 | +``` |
| 46 | +
|
| 47 | +Initialize from that template: |
| 48 | +
|
| 49 | +```bash |
| 50 | +ai-devkit init --template ./fullstack-engineer.yaml |
| 51 | +``` |
| 52 | + |
| 53 | +If `.ai-devkit.json` already exists in this project, apply setup with: |
| 54 | + |
| 55 | +```bash |
| 56 | +ai-devkit install |
| 57 | +``` |
| 58 | + |
| 59 | +Overwrite existing install artifacts without extra prompts: |
| 60 | + |
| 61 | +```bash |
| 62 | +ai-devkit install --overwrite |
| 63 | +``` |
| 64 | + |
| 65 | +## What `ai-devkit install` Sets Up |
| 66 | + |
| 67 | +Based on your configured environments, AI DevKit installs or updates files such as: |
| 68 | +- `AGENTS.md` or `CLAUDE.md` |
| 69 | +- Environment command folders (for example `.cursor/commands/`, `.claude/commands/`, `.codex/commands/`) |
| 70 | +- Other environment-specific templates defined by AI DevKit |
| 71 | + |
| 72 | +The exact artifacts depend on the environments configured in `.ai-devkit.json`. |
| 73 | + |
| 74 | +## Typical Agent Setup Flow |
| 75 | + |
| 76 | +1. Initialize once: |
| 77 | + |
| 78 | +```bash |
| 79 | +ai-devkit init |
| 80 | +``` |
| 81 | + |
| 82 | +Or initialize deterministically from template: |
| 83 | + |
| 84 | +```bash |
| 85 | +ai-devkit init --template ./fullstack-engineer.yaml |
| 86 | +``` |
| 87 | + |
| 88 | +2. Commit `.ai-devkit.json` to your repository. |
| 89 | + |
| 90 | +3. On another machine or for another teammate, run: |
| 91 | + |
| 92 | +```bash |
| 93 | +ai-devkit install |
| 94 | +``` |
| 95 | + |
| 96 | +This keeps agent setup consistent across contributors and CI-like automation workflows. |
| 97 | + |
| 98 | +## Troubleshooting |
| 99 | + |
| 100 | +### `.ai-devkit.json` not found |
| 101 | + |
| 102 | +Run: |
| 103 | + |
| 104 | +```bash |
| 105 | +ai-devkit init |
| 106 | +``` |
| 107 | + |
| 108 | +This creates the configuration file used by `install`. |
| 109 | + |
| 110 | +If you prefer non-interactive setup, use the template command shown in Basic Usage. |
| 111 | + |
| 112 | +### Existing files are not updated |
| 113 | + |
| 114 | +If you want to force replacement of install-managed artifacts, run: |
| 115 | + |
| 116 | +```bash |
| 117 | +ai-devkit install --overwrite |
| 118 | +``` |
| 119 | + |
| 120 | +### I changed environments but setup still looks old |
| 121 | + |
| 122 | +Re-run: |
| 123 | + |
| 124 | +```bash |
| 125 | +ai-devkit install |
| 126 | +``` |
| 127 | + |
| 128 | +This re-applies setup using the current `.ai-devkit.json` content. |
| 129 | + |
| 130 | +## Next Steps |
| 131 | + |
| 132 | +- [Supported AI Agents & Environments](/docs/2-supported-agents) |
| 133 | +- [Getting Started](/docs/1-getting-started) |
| 134 | +- [Development with AI DevKit](/docs/3-development-with-ai-devkit) |
0 commit comments