This guide walks you through building and running Cyrus from the source repository instead of installing the published npm package.
Before building from source, ensure you have:
- Node.js v18 or higher
- pnpm v10.11.0 or higher
- jq (required for Claude Code parsing)
- Git
macOS:
# Install Homebrew if not already installed
# See https://brew.sh
# Install dependencies
brew install jq gh node pnpm
# Verify installations
node --version # Should be v18+
pnpm --version # Should be v10.11.0+
jq --version # Should show version like jq-1.7Linux/Ubuntu:
# Install Node.js (via nvm recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 18
# Install pnpm
npm install -g pnpm@10.11.0
# Install other dependencies
sudo apt install -y gh git jq
# Verify installations
node --version # Should be v18+
pnpm --version # Should be v10.11.0+
jq --version # Should show version like jq-1.7Windows (WSL): Follow the Linux instructions above in your WSL terminal.
# Clone the repository
git clone https://github.com/ceedaragents/cyrus.git
cd cyrus
# Or if you've already cloned it
cd /path/to/cyrusCyrus is a pnpm monorepo. Install all dependencies from the root:
pnpm installThis will install dependencies for:
- All packages in
packages/ - All apps in
apps/
Before you can run the CLI, you need to build all packages:
pnpm buildThis builds the entire monorepo in the correct dependency order:
- Core packages (
@cyrus/core,@cyrus/claude-parser, etc.) - Application packages (
@cyrus/cli)
Tip: If you make changes to any package, you'll need to rebuild it. You can build a specific package:
# Build only the core package
cd packages/core
pnpm build
# Or from root
pnpm --filter @cyrus/core buildNow link the CLI so you can run cyrus from anywhere:
cd apps/cli
pnpm install -g .This creates a global symlink to your local development version. Any changes you make and rebuild will be immediately available.
Alternative: Use pnpm link
cd apps/cli
pnpm link --globalVerify the installation:
which cyrus
# Should show path to your local build
cyrus --version
# Should show the current versionFollow the same configuration steps as the self-hosting guide:
- Create your environment file at
~/.cyrus/.env - Add your Linear OAuth credentials
- Add your Claude Code authentication
See Self-Hosting Guide for detailed environment setup.
Now you can run your locally built version:
cyrusAll the same commands work:
cyrus self-auth
cyrus self-add-repo https://github.com/yourorg/yourrepo.git
cyrus check-tokensWhen developing Cyrus, you'll typically work in watch mode:
Option A: Watch Mode (Recommended)
Open two terminals:
Terminal 1 - Build watcher:
cd /path/to/cyrus
pnpm devThis runs TypeScript in watch mode for all packages. Changes are compiled automatically.
Terminal 2 - Run Cyrus:
cyrusWhen you make changes:
- The watch mode automatically rebuilds
- Restart the
cyruscommand to pick up changes
Option B: Manual Rebuild
# Make changes to code
# Then rebuild
pnpm build
# Run cyrus
cyrusBefore committing changes, run tests:
# Run all tests
pnpm test
# Run tests for packages only (faster)
pnpm test:packages:run
# Run tests in watch mode
pnpm test:packages
# Run TypeScript type checking
pnpm typecheck
# Run linting
pnpm lint# Test only edge-worker package
cd packages/edge-worker
pnpm test:run
# Test only CLI app
cd apps/cli
pnpm test:run# If you have the published version installed, remove it first
npm uninstall -g cyrus-ai
# Link your local version
cd /path/to/cyrus/apps/cli
pnpm install -g .# Remove local version
cd /path/to/cyrus/apps/cli
npm uninstall -g .
# Install published version
npm install -g cyrus-aiThe global link may not have been created. Try:
cd apps/cli
npm uninstall -g .
pnpm install -g .
# Verify
which cyrusMake sure you've rebuilt:
cd /path/to/cyrus
pnpm buildThen restart the cyrus command.
Clean and reinstall:
# Clean all build artifacts
pnpm clean # If available
# Or manually
rm -rf node_modules
rm -rf apps/*/node_modules
rm -rf packages/*/node_modules
rm -rf apps/*/dist
rm -rf packages/*/dist
# Reinstall
pnpm install
pnpm buildCheck your Node.js version:
node --version # Should be v18+Run type checking to see all errors:
pnpm typecheckMake sure all packages are built:
pnpm build
pnpm test:packages:runUnderstanding the monorepo structure helps when developing:
cyrus/
├── apps/
│ ├── cli/ # Main CLI application (what you run)
│ ├── electron/ # GUI app (in development)
│ └── proxy/ # OAuth/webhook proxy server
└── packages/
├── core/ # Shared types, session management
├── claude-parser/ # Parses Claude stdout with jq
├── claude-runner/ # Executes Claude Code CLI
├── edge-worker/ # Core agent logic
├── gemini-runner/ # Gemini integration
└── ndjson-client/ # NDJSON streaming client
When you change code:
- Packages: Changes require rebuild (
pnpm build) - CLI: Changes require rebuild and restart
- Dependencies flow: packages → apps
When contributing changes:
- Make your changes
- Run tests:
pnpm test:packages:run - Run type checking:
pnpm typecheck - Run linting:
pnpm lint - Update
CHANGELOG.mdunder## [Unreleased] - Commit and create a PR
See CLAUDE.md for detailed development guidelines.
- Self-Hosting Guide - Complete self-hosting setup
- Git & GitHub Setup - Configure Git and GitHub CLI
- Configuration Reference - Detailed config options
- CLAUDE.md - Full development guidelines