CLI Installation
The Chainabit CLI is an npm package and needs Node.js 20 or later. After installation, both chainabit and cb run the same CLI. The install command is the same on every system; what differs is how you get Node.js and how your shell finds globally installed commands. Follow the steps for your system.
Step 1: Check Node.js
Open a terminal (Terminal on macOS, your shell on Linux, PowerShell on Windows) and run:
node --versionIf it prints v20 or later, continue to Step 2. If the command is missing or the version is older, install Node.js first:
Install Node.js with Homebrew:
brew install nodeWithout Homebrew, download the installer from nodejs.org and run it. Then open a new terminal window and check again with node --version.
Package managers on some distributions ship an older Node.js, so a version manager is the most reliable option. Install nvm by following its instructions, open a new terminal, then run:
nvm install --lts
node --versionOn Windows Subsystem for Linux, install Node.js inside the Linux distribution and make sure npm is the Linux one, not the Windows one:
command -v npmA path that starts with /mnt/c/ means the Windows npm is being used. Install Node.js inside Linux and open a new terminal.
In PowerShell, install the current LTS release with WinGet:
winget install OpenJS.NodeJS.LTSWithout WinGet, download the installer from nodejs.org and run it. Close PowerShell, open a new window, and check again with node --version.
Step 2: Install the CLI
The command is the same on macOS, Linux, and Windows:
npm install -g @chainabit/cliStep 3: Verify the install
chainabit --version
chainabit --help
cb --helpIf your shell prints that chainabit was not found, or Windows refuses to run it, use the fix for your system below.
Step 4: Fix a missing command
The global install puts chainabit in npm's global directory. Your shell must be able to find that directory.
Find the directory:
npm config get prefixAdd its bin folder to your PATH in ~/.zshrc, then reload the file:
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcIf the install itself failed with EACCES, do not use sudo. Give npm a global directory you own, then repeat Step 2:
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFind the directory:
npm config get prefixAdd its bin folder to your PATH in ~/.bashrc (use ~/.zshrc if your shell is zsh), then reload the file:
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcIf the install itself failed with EACCES, do not use sudo. Use nvm from Step 1, or give npm a global directory you own and repeat Step 2:
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcOn Windows the commands live directly in npm's prefix folder. Find it:
npm config get prefixAdd that folder to your user PATH, then close PowerShell and open a new window:
[Environment]::SetEnvironmentVariable("Path", "$([Environment]::GetEnvironmentVariable('Path','User'));$(npm config get prefix)", "User")If PowerShell reports that running scripts is disabled on this system, allow locally installed scripts for your user only:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedIn Command Prompt (CMD), chainabit runs without this policy change.
Local Project Install
npm install --save-dev @chainabit/cli
npm exec -- chainabit --helpUpgrade
npm install -g @chainabit/cli@latestUninstall
npm uninstall -g @chainabit/cliAfter Install
The quickest way to start is:
chainabit auth login
chainabit auth whoami
chainabit workspace listChoose a workspace ID from the result, select it with chainabit workspace use <id>, then check chainabit workspace current. Continue with the quickstart for your first workflow.
If you are working in automation, prefer a developer token:
export CHAINABIT_DEVELOPER_TOKEN="cbt_live_..."
chainabit auth login --token-env CHAINABIT_DEVELOPER_TOKENYou can also use stdin when a pipeline already has the token available:
printf '%s' "$CHAINABIT_DEVELOPER_TOKEN" | chainabit auth login --token-stdinSecure Install Notes
- Avoid passing passwords, API keys, or tokens directly on the command line when possible.
- Load a trusted environment file explicitly with
--env-file <path>orCHAINABIT_ENV_FILE; local.envfiles are not discovered automatically. - If your environment already has a valid token, set
CHAINABIT_TOKENinstead of performing an interactive login.
Troubleshooting
command not found: follow Step 4 to put npm's global directory onPATH- wrong version after upgrade: restart your shell and run
hash -r - private registry: configure npm registry/auth before installing