User Guide
A hands-on guide to setting up and running OrgLoop. This covers everything from installation through day-to-day operations. If you haven’t read it yet, What is OrgLoop? provides the conceptual foundation.
1. Install OrgLoop
Section titled “1. Install OrgLoop”Prerequisites: Node.js >= 22.
npm install -g @orgloop/cliVerify:
orgloop version2. Initialize a project
Section titled “2. Initialize a project”orgloop init scaffolds a project with connector configs, directories, and a .env.example.
Interactive mode (asks you questions):
mkdir my-org && cd my-orgorgloop init? Project name: my-org? Description: Engineering organization event routing? Which connectors? github, linear, openclaw, claude-codeNon-interactive mode (for scripts, CI):
orgloop init --name my-org --connectors github,linear,openclaw,claude-code --no-interactiveThis creates:
my-org/ orgloop.yaml # Project manifest connectors/ github.yaml # GitHub source config linear.yaml # Linear source config openclaw.yaml # OpenClaw actor config claude-code.yaml # Claude Code source config routes/ example.yaml # Example route (customize this) transforms/ transforms.yaml # Transform definitions drop-bot-noise.sh # Example transform script loggers/ default.yaml # File logger sops/ example.md # Example launch prompt .env.example # Required environment variables .gitignoreIf you selected claude-code as a connector, init also offers to install the Claude Code Stop hook into your ~/.claude/settings.json.
The CLI tells you what to do next:
Next: run `npm install` to install dependencies, then `orgloop doctor` to check your environment.3. Install dependencies
Section titled “3. Install dependencies”After scaffolding, install the @orgloop/* packages listed in package.json:
npm installThis installs connector, transform, and logger packages into node_modules/. The CLI resolves plugins from this directory at runtime.
4. Configure your environment
Section titled “4. Configure your environment”OrgLoop configs reference secrets via ${VAR_NAME} syntax. The actual values come from environment variables.
Check what you need
Section titled “Check what you need”orgloop envEnvironment Variables:
✗ GITHUB_REPO connectors/github.yaml → Repository in owner/repo format → https://github.com/settings/tokens ✗ GITHUB_TOKEN connectors/github.yaml → GitHub personal access token (repo scope) → https://github.com/settings/tokens/new?scopes=repo,read:org ✗ LINEAR_TEAM_KEY connectors/linear.yaml ✗ LINEAR_API_KEY connectors/linear.yaml → Linear API key ✗ OPENCLAW_WEBHOOK_TOKEN connectors/openclaw.yaml → OpenClaw webhook authentication token
0 of 5 variables set. 5 missing.Fix missing variables, then run `orgloop validate`.Each missing variable shows:
- Which YAML file requires it
- A description of what the value is
- A URL where you can create the credential (when available)
Set your variables
Section titled “Set your variables”export GITHUB_REPO="my-org/my-repo"export GITHUB_TOKEN="ghp_..."export LINEAR_TEAM_KEY="ENG"export LINEAR_API_KEY="lin_api_..."export OPENCLAW_WEBHOOK_TOKEN="..."Or use a .env file (copy from the generated .env.example).
5. Health check
Section titled “5. Health check”orgloop doctorOrgLoop Doctor — my-org
Credentials ✓ GITHUB_REPO ✓ GITHUB_TOKEN — valid (user: @alice, scopes: repo, read:org) ✓ LINEAR_API_KEY ✓ OPENCLAW_WEBHOOK_TOKEN
Services ✓ openclaw — running at http://127.0.0.1:18789
Config ✓ orgloop.yaml — valid project manifest ✓ connectors/github.yaml — valid source definition ✓ connectors/linear.yaml — valid source definition ✓ connectors/openclaw.yaml — valid actor definition
Route Graph (no warnings)
All checks passed.Next: run `orgloop start` to start.Doctor goes beyond env — it validates credentials against live APIs (when connectors provide validators), detects running services, validates config syntax, and checks route graph integrity.
For CI/automation: orgloop doctor --json returns machine-readable output.
6. Validate config
Section titled “6. Validate config”orgloop validate ✓ orgloop.yaml valid project manifest ✓ connectors/github.yaml valid source definition ✓ connectors/linear.yaml valid source definition ✓ connectors/openclaw.yaml valid actor definition ✓ connectors/claude-code.yaml valid source definition ✓ transforms/transforms.yaml valid transform group ✓ transform: drop-bot-noise valid script transform ✓ loggers/default.yaml valid logger group0 errors, 0 warnings ✓Next: run `orgloop doctor` for a full health check.Validate checks:
- YAML syntax
- Schema conformance (
apiVersion,kind, required fields) - Reference integrity (routes reference existing sources, actors, transforms)
- Transform script existence and permissions
- Route graph warnings (dead sources, unreachable actors, orphan transforms)
- Missing environment variables
7. Preview changes
Section titled “7. Preview changes”orgloop planOrgLoop Plan — my-org
Sources: + github (new — poll every 5m) + linear (new — poll every 5m) + claude-code (new — hook)
Actors: + openclaw-engineering-agent (new)
Routes: + github-pr-review (new) + github-pr-comment (new) + github-ci-failure (new) + claude-code-to-supervisor (new) + linear-to-engineering (new)
Transforms: + drop-bot-noise (new — script)
Loggers: + file-log (new)
Plan: 12 to add, 0 to change, 0 to remove.
Run `orgloop start` to execute this plan.Plan compares your YAML config against the last running state (stored in ~/.orgloop/state.json). On first run, everything shows as + new. After changes, you see ~ changed and - removed.
Symbols: + new, ~ changed, = unchanged, - removed.
8. Visualize routes
Section titled “8. Visualize routes”orgloop routesOrgLoop Routes — my-org
github ──▶ github-pr-review ──▶ openclaw-engineering-agent └─ filter: resource.changed └─ transform: drop-bot-noise
github ──▶ github-ci-failure ──▶ openclaw-engineering-agent └─ filter: resource.changed └─ transform: drop-bot-noise
linear ──▶ linear-to-engineering ──▶ openclaw-engineering-agent └─ filter: resource.changed
claude-code ──▶ claude-code-to-supervisor ──▶ openclaw-engineering-agent └─ filter: actor.stopped
4 routes, 0 warningsFor machine-readable output: orgloop routes --json.
9. Start the engine
Section titled “9. Start the engine”orgloop startApplying plan...
Source github — polling started (every 5m)Source linear — polling started (every 5m)Source claude-code — hook listener startedActor openclaw-engineering-agent — readyRoute github-pr-review — activeRoute github-ci-failure — activeRoute linear-to-engineering — activeRoute claude-code-to-supervisor — activeLogger file-log — configured
OrgLoop is running. PID: 42831Logs: orgloop logs | Status: orgloop status | Stop: orgloop stopWhat happens when start runs:
- Loads and validates config
- Checks all environment variables (fails fast if any are missing)
- Resolves connector packages (
@orgloop/connector-github, etc.) - Initializes sources, actors, transforms, loggers
- Starts the scheduler (poll-based sources poll on their interval)
- Starts the webhook server (for hook-based sources like Claude Code)
- Writes PID and state files to
~/.orgloop/ - Runs in foreground (Ctrl+C to stop)
Background mode
Section titled “Background mode”orgloop start --daemonForks to background and writes PID to ~/.orgloop/orgloop.pid.
Supervised daemon mode
Section titled “Supervised daemon mode”orgloop start --daemon --supervisedRuns as a daemon with an auto-restart supervisor. If the OrgLoop process crashes, the supervisor automatically restarts it. Recommended for production deployments.
Pre-flight failures
Section titled “Pre-flight failures”If env vars are missing, start shows which ones and exits before starting anything:
Environment Variables:
✓ GITHUB_REPO ✗ GITHUB_TOKEN connectors/github.yaml → GitHub personal access token (repo scope) → https://github.com/settings/tokens/new?scopes=repo,read:org
1 variable missing — run `orgloop env` for details.10. Day-to-day operations
Section titled “10. Day-to-day operations”Check status
Section titled “Check status”orgloop statusOrgLoop — my-org (running, PID 42831)
NAME TYPE INTERVAL github poll 5m linear poll 5m claude-code hook —
NAME STATUS openclaw-engineering-agent healthy
NAME SOURCE ACTOR github-pr-review github openclaw-engineering-agent github-ci-failure github openclaw-engineering-agent linear-to-engineering linear openclaw-engineering-agent
Recent Events (last 5): TIME SOURCE TYPE ROUTE STATUS 14:32:01 github resource.changed github-pr-review success 14:31:55 github resource.changed github-ci-failure success 14:27:12 linear resource.changed linear-to-engineering successIf OrgLoop is not running:
OrgLoop is not running.Run `orgloop start` to start.View logs
Section titled “View logs”Tail logs (follows new entries):
orgloop logsFilter logs:
orgloop logs --source github # Only GitHub eventsorgloop logs --route github-pr-review # Only this routeorgloop logs --result drop # Only dropped eventsorgloop logs --since 2h # Last 2 hoursorgloop logs --event evt_abc123 # Trace a specific eventQuery mode (don’t follow, just print matches):
orgloop logs --no-follow --source linear --since 1hJSON output:
orgloop logs --json --no-followTest with synthetic events
Section titled “Test with synthetic events”Generate a sample event for a connector:
orgloop test --generate githubThis prints a realistic event JSON to stdout. Pipe it back to test the pipeline:
orgloop test --generate github | orgloop test -Injecting test event: resource.changed (source: github)
Transform: drop-bot-noise — PASS (2ms)Route match: github-pr-reviewDelivery: openclaw-engineering-agent — OK (simulated)
Event evt_abc1234567890 traced successfully through 1 route.Test from a file:
orgloop test event.jsonDry run (trace path without delivering):
orgloop test event.json --dry-runStop the engine
Section titled “Stop the engine”orgloop stopOr press Ctrl+C if running in foreground. If multiple modules share the daemon, stop only unloads the current directory’s module. Use orgloop shutdown to take down the entire daemon.
REST API
Section titled “REST API”The runtime exposes a REST API at http://127.0.0.1:4800/api/ for programmatic monitoring:
# Runtime statuscurl http://127.0.0.1:4800/api/status
# Route statscurl http://127.0.0.1:4800/api/routes
# Recent eventscurl http://127.0.0.1:4800/api/events?source=github&limit=10
# Per-source detailcurl http://127.0.0.1:4800/api/sourcesSee the CLI Command Reference for the full endpoint list.
11. When OrgLoop stops
Section titled “11. When OrgLoop stops”When OrgLoop stops (Ctrl+C, orgloop stop, process killed):
- All polling stops. Sources stop fetching new events.
- No new events are processed. Events that arrived but weren’t yet processed are lost (no durable queue by default).
- Actors are not notified. Running actor sessions continue independently — they don’t know OrgLoop stopped.
- State is preserved. The last config state remains in
~/.orgloop/state.json. Source checkpoints are persisted per-project in<project>/.orgloop/checkpoints/(configurable viadefaults.checkpoint.dir). Logs remain in~/.orgloop/logs/.
To restart:
orgloop startPlan will show = unchanged for existing components and pick up where it left off (sources resume from their last checkpoint).
12. Customizing
Section titled “12. Customizing”Add a new connector
Section titled “Add a new connector”orgloop add connector my-source --type sourceorgloop add connector my-target --type actorCreates a YAML file in connectors/ and adds it to orgloop.yaml.
Add a new route
Section titled “Add a new route”orgloop add route pr-to-slack --source github --actor slack-notifyCreates a YAML file in routes/.
Add a transform
Section titled “Add a transform”Script-based (bash, any language):
orgloop add transform my-filter --type scriptCreates a bash script in transforms/ and a YAML definition. Exit code 0 = pass the event, exit code 78 = drop it.
Package-based (TypeScript):
orgloop add transform my-enricher --type packageCreates a TypeScript package transform for more complex logic.
Add a logger
Section titled “Add a logger”orgloop add logger audit-logCreates a logger YAML in loggers/.
Manual editing
Section titled “Manual editing”You can always edit YAML files directly. The structure is:
| Directory | Contents |
|---|---|
orgloop.yaml | Project manifest, references all other files |
connectors/*.yaml | Source and actor definitions |
routes/*.yaml | Routing rules |
transforms/*.yaml | Transform definitions (+ scripts) |
loggers/*.yaml | Logger definitions |
sops/*.md | Launch prompts referenced by routes |
After editing, run orgloop validate to check your work.
13. CLI quick reference
Section titled “13. CLI quick reference”| Command | Description |
|---|---|
orgloop init | Scaffold a new project |
orgloop add connector <name> | Add a new connector |
orgloop add route <name> | Add a new route |
orgloop add transform <name> | Add a new transform |
orgloop add logger <name> | Add a new logger |
orgloop env | Check environment variables |
orgloop env check | Check env vars (exit 1 if missing) |
orgloop doctor | Full environment health check |
orgloop validate | Validate config files |
orgloop plan | Show what would change (dry run) |
orgloop routes | Visualize routing topology |
orgloop start | Start the runtime |
orgloop start --daemon | Start as background daemon |
orgloop start --daemon --supervised | Start as supervised daemon (auto-restart) |
orgloop status | Show runtime status |
orgloop logs | Tail the event log |
orgloop test [file] | Inject a test event |
orgloop test --generate <connector> | Generate a sample event |
orgloop stop | Stop the current module (or daemon if last) |
orgloop shutdown | Stop the daemon and all modules |
orgloop hook claude-code-stop | Forward Claude Code stop hook |
Global options:
| Option | Description |
|---|---|
--config <path> | Path to orgloop.yaml (default: ./orgloop.yaml) |
--json | Machine-readable JSON output |
--no-interactive | Disable interactive prompts |
For the full reference, see CLI Command Reference.
Next steps
Section titled “Next steps”- Five Primitives — understand Sources, Actors, Routes, Transforms, Loggers in depth
- Event Taxonomy — the three event types and how they compose
- Engineering Org example — full production setup walkthrough
- Building Connectors — create your own source or target connector
- Project Setup — create and configure an OrgLoop project