# Juergen

A batteries-included [pi-coding-agent](https://github.com/badlogic/pi-mono) configuration. Turns pi into **Juergen** — a senior Linux sysadmin & data scientist persona with subagent orchestration, custom extensions, and a curated set of community packages.

Clone, install, authenticate, go.

## Prerequisites

You need **Node.js ≥ 22.19**, **npm**, and **git**. Already have them? Skip to [Install](#install).

| Platform            | Setup guide                                             |
| ------------------- | ------------------------------------------------------- |
| **macOS**           | [docs/setup-macos.md](docs/setup-macos.md)              |
| **Windows (WSL 2)** | [docs/setup-wsl.md](docs/setup-wsl.md)                  |
| **Linux**           | Use your distro's package manager — you know the drill. |

### LLM Provider

You need access to at least one LLM provider:

| Provider               | How to get access                                                                                 |
| ---------------------- | ------------------------------------------------------------------------------------------------- |
| **Anthropic** (Claude) | Sign up at [console.anthropic.com](https://console.anthropic.com), add billing, create an API key |
| **Claude Pro/Max**     | Subscribe at [claude.ai](https://claude.ai), then use `/login` inside pi (no API key needed)      |
| **OpenAI** (GPT)       | Sign up at [platform.openai.com](https://platform.openai.com), add billing, create an API key     |
| **Google** (Gemini)    | Sign up at [aistudio.google.com](https://aistudio.google.com), create an API key                  |
| **OpenRouter**         | Sign up at [openrouter.ai](https://openrouter.ai) — one key for many models                       |

You'll enter credentials inside pi after launching — no environment variables needed.

## Install

```bash
# 1. Install the pi coding agent globally
npm install -g @earendil-works/pi-coding-agent

# 2. Clone this config and run the installer
git clone https://github.com/oyax1337/juergen.git /tmp/juergen
/tmp/juergen/install.sh

# 3. Start pi
juergen
```

The installer migrates `~/.pi/agent` into a git checkout (preserves existing sessions, auth, and runtime state), links extension dependencies, installs community packages and MCP servers, sets up ast-grep for code analysis, and adds a `juergen` shell alias.

### Authentication

Authenticate interactively after launching:

| Method                   | How                                    | Best for                              |
| ------------------------ | -------------------------------------- | ------------------------------------- |
| **OAuth / Subscription** | Type `/login` and select your provider | Claude Pro/Max, ChatGPT Plus, Copilot |
| **API Key**              | Type `/login` and enter your key       | Anthropic, OpenAI, OpenRouter, Google |

Credentials persist in `auth.json` (git-ignored). Env vars (`ANTHROPIC_API_KEY`, etc.) also work.

## Updating

```bash
pi update                              # Update pi binary + packages
cd ~/.pi/agent && git pull             # Update Juergen config
```

Edit files in `~/.pi/agent` directly — local changes take effect on next launch.

## Documentation

| Doc                                              | Description                                                         |
| ------------------------------------------------ | ------------------------------------------------------------------- |
| [Extensions](docs/extensions.md)                 | Custom extensions, shared modules, and how to write your own        |
| [Coding Guidelines](docs/coding-guidelines.md)   | Coding standards for this repo                                      |
| [Packages](docs/packages.md)                     | Community packages and MCP servers                                  |
| [Agents](docs/agents.md)                         | Subagents, preset chains, and skills                                |
| [Commands](docs/commands.md)                     | Slash commands, hotkeys, and quick reference                        |
| [Configuration](docs/configuration.md)           | Config files reference (settings.json, mcp.json, etc.)              |
| [Browser MCP](docs/browser-mcp.md)               | Playwright MCP setup: browser selection, profiles, remote debugging |
| [Scripts](docs/scripts.md)                       | Setup, update, status, and config restore scripts                   |
| [macOS Setup](docs/setup-macos.md)               | Prerequisites for macOS                                             |
| [WSL Setup](docs/setup-wsl.md)                   | Prerequisites for Windows (WSL 2)                                   |

## License

MIT
