Getting Started

Install NightShift, run your first problem, and understand how to describe tasks in YAML. Up and running in under 5 minutes.

Requirements

Installation

terminal
# 1. Clone the repository
git clone https://github.com/geopard-studio/nightshift.git
cd nightshift

# 2. Install in editable mode (creates the nightshift CLI command)
pip install -e .

# 3. Set your Anthropic API key
export ANTHROPIC_API_KEY="sk-ant-api03-..."

# Verify installation
nightshift --version
NightShift 0.1.0
💡

Add export ANTHROPIC_API_KEY=... to your ~/.zshrc or ~/.bashrc so you don't have to set it every session.

Your First Run

The quickest way to try NightShift is with a natural language description:

terminal
# Natural language — works for simple tasks
nightshift run "fix the divide-by-zero bug in calculator.py"

coordinator: reading problem, querying KB...
kb: 0 relevant entries (first run)
ar: no patterns yet, using default team
agent[fixer]: analyzing calculator.py...
agent[fixer]: found ZeroDivisionError in line 47
evaluator: checking git diff...
✓ quality: 4/5 · cost: $0.18 · 45s
✓ 5 KB entries written

On the second run with a similar problem, the Coordinator reads what it learned from this run and improves its approach.

Problem YAML Format

For complex tasks, use a problem.yaml file. This gives the system more context and lets you specify acceptance criteria and budget.

problem.yaml
title: SWOT analysis for EV conversion startup

description: |
  Research the market for converting internal combustion
  engine vehicles to electric. Focus on the US market.
  Find real market size data with citations.

acceptance:
  - Market size with real source citations (not estimates)
  - 4-quadrant SWOT matrix in the output
  - Executive summary under 300 words
  - At least 3 named competitors analyzed

optimize_for: quality # or: speed, cost
max_budget_usd: 3.0
max_attempts: 3 # retry up to 3 times if quality is low

YAML Fields

Field Type Required Description
title string required Short name for the problem. Used in KB entries and logs.
description string required Full problem description. Be specific — vague descriptions produce vague results.
acceptance list optional Criteria the output must meet. Passed to the Evaluator — each criterion is checked individually.
optimize_for enum optional quality (default), speed, or cost. Influences Coordinator's planning choices.
max_budget_usd float optional Hard budget cap in USD (LLM API cost). Run stops if exceeded. Default: 5.0.
max_attempts int optional Maximum improvement iterations. Default: 3. Set to 1 to disable retries.
context string optional Additional context the Coordinator gets before planning (e.g., "target audience: CTOs").

Acceptance criteria are your contract with the Evaluator. The more specific you are, the more reliably the system meets them. "At least 3 named competitors" is better than "competitor analysis."

Running in Background

For longer runs, use --bg to detach and monitor separately:

terminal
# Start in background
nightshift solve problem.yaml --bg
✓ Run started (PID 12847)

# Check status anytime
nightshift status
phase: executing · nodes: 3/5 done · cost: $0.24

# Send a hint mid-run
nightshift inject "focus on the US market, not global"
✓ Message delivered to Auditor inbox

# Stop gracefully
nightshift stop
✓ Stop signal sent. Finishing current node...

Understanding the Output

When a run completes, NightShift creates files in the current directory:

The KB is in .nightshift/ in your project directory. Add .nightshift/ to your .gitignore if you don't want to commit it. The global KB at ~/.nightshift/ is never committed.

What Next