This guide covers all methods of installing LevelCode on your system.
Before installing LevelCode, ensure you have:
- Node.js 18+ or Bun 1.3.5+
- A terminal that supports ANSI colors
- An OpenRouter API key
npm install -g levelcodebun install -g levelcodeyarn global add levelcode# Clone the repository
git clone https://github.com/yethikrishna/levelcode.git
cd levelcode
# Install dependencies
bun install
# Build the project
bun run build
# Link for global use
bun linkIf you want to use LevelCode programmatically:
# NPM
npm install @levelcode/sdk
# Bun
bun add @levelcode/sdk
# Yarn
yarn add @levelcode/sdk# Option 1: Environment variable
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
# Option 2: .env file in your project
echo "OPENROUTER_API_KEY=sk-or-v1-your-key-here" > .envlevelcode --versioncd your-project
levelcodeLevelCode works on Windows via:
- Windows Subsystem for Linux (WSL) - Recommended
- Git Bash
- PowerShell (with some limitations)
For the best experience on Windows, use WSL:
# Install WSL
wsl --install
# In WSL, install Bun
curl -fsSL https://bun.sh/install | bash
# Install LevelCode
bun install -g levelcodeLevelCode works out of the box on macOS. We recommend using Bun for faster installation:
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Install LevelCode
bun install -g levelcodeLevelCode is fully supported on all major Linux distributions:
# Using Bun (recommended)
curl -fsSL https://bun.sh/install | bash
bun install -g levelcode
# Using npm
npm install -g levelcodeEnsure the npm/bun global bin directory is in your PATH:
# For npm
export PATH="$PATH:$(npm config get prefix)/bin"
# For bun
export PATH="$PATH:$HOME/.bun/bin"Add this line to your ~/.bashrc or ~/.zshrc for persistence.
If you get EACCES errors, avoid using sudo. Instead:
# Configure npm to use a different directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH="$PATH:$HOME/.npm-global/bin"- Verify your key at OpenRouter
- Check for typos in the key
- Ensure the key has sufficient credits
Need help? Open an issue on GitHub