Skip to main content
This page covers two script types most teams need:
  1. App install scripts (machine setup)
  2. Worktree bootstrap scripts (session setup)

1) App install script (machine setup)

Base command:
curl -fsSL https://ctx.rs/install | sh
Optional install path override:
CTX_INSTALL_DIR="$HOME/.local/share/ctx" curl -fsSL https://ctx.rs/install | sh

Team pattern

Keep a thin wrapper script in your internal setup repo, then call the official installer from that wrapper. Example wrapper:
#!/usr/bin/env bash
set -euo pipefail

CTX_INSTALL_DIR="${CTX_INSTALL_DIR:-$HOME/.local/share/ctx}"
export CTX_INSTALL_DIR

curl -fsSL https://ctx.rs/install | sh
Use wrapper scripts for consistency, but keep them small and auditable.

2) Worktree bootstrap script (session setup)

Worktree bootstrap runs when a new worktree starts. In the GUI:
  1. Open Settings.
  2. Go to Worktree Bootstrap.
  3. Set Setup command.
  4. Set Timeout (seconds).
  5. Choose whether to Delay agent start until completion.

Good bootstrap tasks

  • Install dependencies.
  • Prepare generated files needed for agent context.
  • Run lightweight setup checks.

Example bootstrap script (Node/pnpm)

#!/usr/bin/env bash
set -euo pipefail

if command -v pnpm >/dev/null 2>&1; then
  pnpm install --frozen-lockfile
else
  npm ci
fi

Wait vs. background behavior

  • Enable Delay agent start until completion when agents require setup outputs immediately.
  • Disable it when setup is long-running and agents can begin discovery work in parallel.

Script safety guidance

  • Fail fast (set -euo pipefail).
  • Keep scripts deterministic.
  • Avoid interactive prompts.
  • Keep secrets out of scripts tracked in docs.