Installation
Prerequisites
Section titled “Prerequisites”Before installing cspace, make sure you have the following:
| Dependency | Required | Purpose | Install |
|---|---|---|---|
| Docker with Compose v2 | Yes | Runs devcontainer instances | docs.docker.com |
Environment variables
Section titled “Environment variables”cspace containers read environment variables from your project’s .env file. Add these before running cspace up:
| Variable | Required | Purpose |
|---|---|---|
ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN | Yes (one of) | Authenticates Claude Code inside containers. Use an API key or an OAuth token from claude auth login. |
GH_TOKEN | Yes | GitHub personal access token for git push/pull and PR creation inside containers. Needs repo, workflow, and read:org scopes. See Git Authentication. |
# Add to your .env file (not committed to git)echo 'ANTHROPIC_API_KEY=sk-ant-...' >> .envecho 'GH_TOKEN=ghp_...' >> .envInstall
Section titled “Install”Homebrew (macOS)
Section titled “Homebrew (macOS)”brew tap elliottregan/cspacebrew install cspaceInstall script (macOS and Linux)
Section titled “Install script (macOS and Linux)”curl -fsSL https://raw.githubusercontent.com/elliottregan/cspace/main/install.sh | bashThis will:
- Download the correct pre-built binary for your OS and architecture from GitHub Releases
- Verify the SHA-256 checksum
- Ad-hoc sign the binary on macOS (required for Apple Silicon)
- Add
~/.cspace/binto yourPATHin the appropriate shell RC file - Install zsh completions (if you use zsh)
After installation, restart your shell or source your RC file:
source ~/.zshrc # or ~/.bashrc, ~/.profileVerify the installation:
cspace versionCustom install location
Section titled “Custom install location”To install cspace somewhere other than ~/.cspace, set CSPACE_HOME before running the script:
CSPACE_HOME=/opt/cspace curl -fsSL https://raw.githubusercontent.com/elliottregan/cspace/main/install.sh | bashSpecific version
Section titled “Specific version”To install a specific version:
VERSION=v0.1.0 curl -fsSL https://raw.githubusercontent.com/elliottregan/cspace/main/install.sh | bashShell completions
Section titled “Shell completions”On zsh, the installer automatically sets up tab completions:
- Creates
~/.zsh/completions/(or$ZDOTDIR/.zsh/completions/) - Generates completions from the binary as
_cspace
After installation, you get tab completion for all cspace commands, instance names, and planet names:
cspace <TAB> # shows all commandscspace up <TAB> # suggests planet names (mercury, venus, earth...)cspace ssh <TAB> # suggests running instance namescspace down <TAB> # suggests running instance namesDeveloper tooling
Section titled “Developer tooling”If you’re working on cspace itself, install the lint/format/test toolchain and git hooks:
make install-tools # installs golangci-lint v2, goimports, lefthook (requires Go)make setup-hooks # wires pre-commit and pre-push hooks via lefthookInstall shellcheck separately via your system package manager:
- macOS:
brew install shellcheck - Debian/Ubuntu:
sudo apt-get install shellcheck - Alpine:
sudo apk add shellcheck
Run the same checks CI runs:
make check # fmt-check + vet + lint + testUpdating
Section titled “Updating”To update cspace to the latest version:
cspace self-updateOr re-run the install script — it detects the existing installation and replaces the binary.
Next steps
Section titled “Next steps”Continue to the Quick Start to initialize your first project and launch an instance.