Skip to content

Installation

  • Node.js >= 18
  • Docker — required for SonarQube static analysis. If you don’t have Docker or don’t need SonarQube, disable it with --no-sonar or set sonarqube.enabled: false in config
  • At least one AI agent CLI installed: Claude, Codex, Gemini, Aider, or OpenCode

You need at least one agent installed before running kj init. Install one or more:

AgentCLIInstall
Claudeclaudenpm install -g @anthropic-ai/claude-code
Codexcodexnpm install -g @openai/codex
GeminigeminiSee Gemini CLI docs
Aideraiderpip install aider-chat
OpenCodeopencodeSee opencode.ai
Terminal window
npm install -g karajan-code
Terminal window
kj init

The wizard auto-detects your installed agents and walks you through configuration:

  1. Select default coder agent — Which AI writes the code (e.g., Claude)
  2. Select default reviewer agent — Which AI reviews the code (e.g., Codex)
  3. Enable triage? — Auto-classify task complexity to activate only necessary roles (default: No)
  4. Enable SonarQube? — Static analysis with quality gates via Docker (default: Yes)
  5. Development methodology — TDD (test-driven, recommended) or Standard

After the wizard completes, it creates:

  • ~/.karajan/kj.config.yml — Main configuration file (or $KJ_HOME/kj.config.yml)
  • review-rules.md — Default review guidelines (in your project directory)
  • coder-rules.md — Default coder guidelines (in your project directory)

If SonarQube is enabled, the wizard also starts a Docker container (karajan-sonarqube) and provides instructions to generate your SonarQube token.

Terminal window
kj doctor

This checks your entire environment: git, Docker, SonarQube connectivity, agent CLIs, and rule files. Fix any issues it reports before running your first task.

Terminal window
git clone https://github.com/manufosela/karajan-code.git
cd karajan-code
./scripts/install.sh

Alternative: Non-interactive setup (CI/automation)

Section titled “Alternative: Non-interactive setup (CI/automation)”

For CI pipelines or automated environments where you can’t run the interactive wizard:

Terminal window
./scripts/install.sh \
--non-interactive \
--kj-home /path/to/.karajan \
--sonar-host http://localhost:9000 \
--sonar-token "$KJ_SONAR_TOKEN" \
--coder claude \
--reviewer codex \
--run-doctor true

If you enabled SonarQube during kj init:

  1. Open http://localhost:9000 in your browser
  2. Log in with default credentials (admin / admin) — you’ll be prompted to change the password
  3. Go to My Account → Security → Generate Tokens
  4. Create a Global Analysis Token
  5. Add it to your config:
# In ~/.karajan/kj.config.yml
sonarqube:
token: "your-token-here"

Or set the environment variable:

Terminal window
export KJ_SONAR_TOKEN="your-token-here"

Run Karajan Code in a container (Alpine + Node 20) — no local Node.js installation required:

Terminal window
docker run --rm -it ghcr.io/manufosela/karajan-code kj doctor

Or use it as a base image for CI pipelines:

FROM ghcr.io/manufosela/karajan-code
COPY . /workspace
WORKDIR /workspace
RUN kj init --non-interactive --coder claude --reviewer codex

One-line installation without npm:

Terminal window
curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install.sh | sh

This downloads the latest release, installs it globally, and runs kj init.

If you prefer installing via pip:

Terminal window
cd wrappers/python && pip install .

This installs the kj command via a Python wrapper that delegates to the Node.js CLI.

Download standalone binaries from GitHub Releases — no Node.js required. Available for Linux, macOS, and Windows.

RTK (Rust Token Killer) reduces token consumption by 60-90% on Bash command outputs. Install it globally and KJ benefits automatically:

Terminal window
brew install rtk
rtk init --global

See RTK on GitHub for more details.