Installation
This guide covers all available installation methods for DojOps, plus upgrade, uninstall, and troubleshooting instructions.
Prerequisites
- Node.js >= 20 (required for npm and shell script methods)
- Docker (required for Docker method only)
Installation Methods
npm (recommended)
The simplest method if you already have Node.js installed.
npm i -g @dojops/cliUpgrade:
npm update -g @dojops/cliUninstall:
npm uninstall -g @dojops/cliShell Script
POSIX-compliant installer that verifies prerequisites and runs npm install -g.
curl -fsSL https://raw.githubusercontent.com/dojops/dojops/main/install.sh | shInstall a specific version:
curl -fsSL https://raw.githubusercontent.com/dojops/dojops/main/install.sh | sh -s -- --version 1.0.0The script will:
- Verify Node.js >= 20 is installed
- Verify npm is available
- Run
npm install -g @dojops/cli - Verify the
dojopscommand is available
Upgrade: Re-run the script (installs @latest by default).
Uninstall: npm uninstall -g @dojops/cli
Docker
Run DojOps without installing anything locally. The image is published to GitHub Container Registry (GHCR).
One-off generation:
docker run --rm -it \
-e OPENAI_API_KEY \
ghcr.io/dojops/dojops "Create a Terraform config for S3"API server + dashboard:
docker run --rm -p 3000:3000 \
-e OPENAI_API_KEY \
-e DOJOPS_API_KEY=your-api-key \
ghcr.io/dojops/dojops serveWith local project mount (for init/plan/apply):
docker run --rm -it \
-v "$(pwd)":/workspace -w /workspace \
-e OPENAI_API_KEY \
ghcr.io/dojops/dojops initPin a version:
docker run --rm -it ghcr.io/dojops/dojops:1.0.0 --versionUpgrade: Pull the latest image:
docker pull ghcr.io/dojops/dojops:latestUninstall: Remove the image:
docker rmi ghcr.io/dojops/dojops:latestVerify Installation
After installing via any method:
dojops --version # Print version
dojops doctor # System health check
dojops --help # Show all commandsTroubleshooting
command not found: dojops
npm’s global bin directory may not be in your PATH. Fix:
# Find npm's global prefix
npm prefix -g
# Add it to PATH (add to your shell profile for persistence)
export PATH="$(npm prefix -g)/bin:$PATH"Permission errors during npm install -g
Option 1 — use sudo:
sudo npm install -g @dojops/cliOption 2 — configure npm to use a user-writable directory:
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATHNode.js version too old
DojOps requires Node.js >= 20. Check your version:
node --versionUpgrade using nvm :
nvm install 20
nvm use 20Docker permission denied
If you get a permission error pulling from GHCR, authenticate first:
echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdinPublic images should not require authentication. If the error persists, check your Docker daemon configuration.