diff --git a/content/docs/worktree/repo-configuration.mdx b/content/docs/worktree/repo-configuration.mdx index 3edb496..87805dd 100644 --- a/content/docs/worktree/repo-configuration.mdx +++ b/content/docs/worktree/repo-configuration.mdx @@ -30,26 +30,27 @@ If a run-script tab is already active for that worktree, Supacode closes it befo The setup script launches once after a new worktree is created. -Good setup scripts: - -- start your coding agent -- install dependencies -- generate local artifacts -- boot a local service you always need - -Example: +Good examples: ```bash -codex -``` +# copy gitignored files to the worktree +cp "$SUPACODE_ROOT_PATH/.env" .env -Or: - -```bash +# install dependencies pnpm install + +# generate local artifacts pnpm prisma generate + +# boot a local service you always need +docker compose up -d + +# start your coding agent (codex, claude, opencode, copilot, ...) +codex ``` +A new worktree contains no gitignored files. Copy the ones you need in the setup script, or enable **Copy ignored files to new worktrees** in repository settings to copy all of them, including large directories such as `node_modules`. + ![Setup Script](/setup-script-claude.png) Supacode runs the setup script inside the new worktree's terminal context, so the output is visible immediately in the app. @@ -73,6 +74,15 @@ docker compose down If the archive script fails, the archive does not proceed. +## Script environment + +These variables are available in every Supacode terminal, including run, setup, and archive scripts: + +| Variable | Value | +| --- | --- | +| `SUPACODE_ROOT_PATH` | Path to the main repository | +| `SUPACODE_WORKTREE_PATH` | Path to the current worktree | + ## Where this configuration lives These values are repository settings.