Autonomous CLI supervisor for staged AI workflows
Project description
cybervisor
cybervisor is an autonomous CLI supervisor for development runs. It executes a default 5-stage pipeline with Gemini CLI, Claude Code, or a mock agent, supports customizing stages in YAML config, installs runtime hooks for non-interactive execution, enforces optional stage-result contracts, and keeps audit logs in JSONL.
What it does
- Runs the default five ordered stages:
Spec,Review Spec,Implement,Review Code,Verify - Allows custom stage lists in
cybervisor.yaml - Supports optional structured stage-result contracts and artifact-driven routing
- Fails fast when the selected agent CLI or hook verifier credentials are missing
- Writes non-secret hook runtime metadata and settings snapshots under
.cybervisor/hooks/for non-mock runs - Keeps verifier credentials in inherited
CYBERVISOR_LLM_*env vars instead of persisting them under.cybervisor/hooks/ - Snapshots
.gemini/settings.jsonor.claude/settings.jsonand restores the exact pre-run content on exit - Streams live agent output to stderr and persists per-stage logs under
.cybervisor/ - Exits with
130onSIGINTorSIGTERMafter cleanup
Requirements
- Python 3.11+
uv- One of:
geminionPATHclaudeonPATHmockmode for local deterministic runs
CYBERVISOR_LLM_API_KEYfor non-mock runs
Optional local env loading is supported from .env in the working directory. cybervisor reads only CYBERVISOR_LLM_BASE_URL, CYBERVISOR_LLM_API_KEY, and CYBERVISOR_LLM_MODEL, and does not override variables already exported in the shell.
Install
Install the CLI onto your PATH:
uv tool install -e .
After installation, verify:
cybervisor --version
Developer fallback if you do not want to install the CLI globally:
uv run cybervisor --version
Setup
uv sync
cp .env.example .env
Set at least:
CYBERVISOR_LLM_API_KEY=...
# Optional overrides
# CYBERVISOR_LLM_BASE_URL=https://api.openai.com/v1
# CYBERVISOR_LLM_MODEL=auto
Usage
Minimal run:
cybervisor "Create a 360 feedback system" --config cybervisor.yaml
Start from a specific stage:
cybervisor "Create a 360 feedback system" --start-stage "Implement"
Version and help:
cybervisor --version
cybervisor --help
Minimal config:
pipeline:
agent_tool: gemini
stages:
- name: Spec
- name: Review Spec
- name: Implement
- name: Review Code
- name: Verify
Notes:
hook:values are sourced fromCYBERVISOR_LLM_*env vars, not from config file literals- If a stage omits
prompt_template, the default template is used - If
stages:is omitted, the default five-stage pipeline is used - If
stages:is provided,cybervisorruns the stages exactly as configured - Stages may optionally declare a
contractfor required result artifacts and anext_stagefor explicit success-path routing - When a review stage can route
changes_requestedto a correction stage, set that review stage'snext_stageexplicitly for theapprovedpath instead of relying on linear order - Use
--start-stage STAGE_NAMEto skip earlier stages and begin execution at the named stage
Review/fix loop example:
pipeline:
agent_tool: claude
stages:
- name: Implement
- name: Review Code
next_stage: Verify
prompt_template: |
Review the implementation.
Write the final result to .cybervisor/contracts/artifacts/Review Code.yaml.
contract:
allowed_statuses: [approved, changes_requested]
routes:
changes_requested:
next_stage: Fix Code
injections: [summary, details, actions]
- name: Fix Code
next_stage: Review Code
prompt_template: |
Fix the issues described by the latest review.
Full contract:
{latest_contract_yaml}
Summary:
{latest_contract_summary}
Details:
{latest_contract_details_yaml}
Actions:
{latest_contract_actions_yaml}
- name: Verify
In this pattern:
Review Codewithstatus: approvedgoes toVerifyReview Codewithstatus: changes_requestedgoes toFix CodeFix Codeloops back toReview Code- If
Review Codeomittednext_stage: Verify, a linear stage list would otherwise fall through toFix Code - Contract prompt guides live at
.cybervisor/contracts/prompts/[Stage Name].md
Runtime behavior
For gemini and claude runs, cybervisor:
- Performs preflight checks.
- Writes shared hook runtime metadata into
.cybervisor/hooks/. - Persists an exact settings snapshot in
.cybervisor/hooks/. - Patches the active tool settings file so the selected agent invokes the packaged
cybervisor-agent-hookentry point. - Starts the agent in a dedicated process group when supported.
- Uses the runtime hook to classify autonomy decisions as
approveorblock, then adapts those into the selected tool's native hook output so the agent continues autonomously. - If the active stage declares a contract, uses the same hook runtime to block completion until the required artifact exists and is structurally valid.
- Streams agent output into stderr and the stage log file.
- Re-validates contract artifacts after agent exit, then routes by contract status or explicit
next_stagewhen configured. - Restores settings and removes runtime files on success, failure, or interrupt.
Generated artifacts:
.cybervisor/logs/cybervisor.log.jsonl: structured run log.cybervisor/logs/stages/<stage_name>.jsonl: captured transcript per stage.cybervisor/contracts/artifacts/*.yaml: optional stage-result artifacts for contract-enabled stages.cybervisor/contracts/prompts/*.md: authored contract prompt guides for contract-enabled stages
Development
Validation commands used by this repo:
uv run mypy --strict src
uv run pytest
Useful focused runs:
uv run pytest tests/integration/test_pipeline_e2e.py
uv run pytest tests/unit/test_hooks.py tests/unit/test_pipeline.py tests/unit/test_signals.py
Manual demo workflow
The repository includes a demo bootstrap helper:
scripts/e2e-demo-project.sh
That script:
- creates a fresh demo workspace with
scripts/init-demo-project.sh - supports
--agent-tool claude|geminiand defaults toclaude - optionally starts a local deterministic hook verifier stub when run with
--with-local-api - copies
templates/demo/.envinto the demo workspace as.env - prints the exact
cdandcybervisorcommand to run manually in your shell - reminds you to install the CLI first if
cybervisoris not yet on yourPATH
Specs Directory
Feature folders under specs/ are archival implementation artifacts after delivery. The current source of truth for runtime behavior is the checked-in code plus the main project docs and constitution.
Repository layout
src/cybervisor/ Core CLI package
src/cybervisor/core_hooks/ Hook runtime and verifier logic
scripts/ Demo bootstrap and end-to-end scripts
templates/demo/ Demo project scaffold
tests/ Unit and integration coverage
specs/ Speckit feature artifacts
.specify/ Constitution, templates, and repo scripts
AGENTS.md Symlink to .specify/memory/constitution.md
GEMINI.md Symlink to AGENTS.md
CLAUDE.md Symlink to AGENTS.md
Agent docs
The agent mandate files are symlinked by design:
AGENTS.md->.specify/memory/constitution.mdGEMINI.md->AGENTS.mdCLAUDE.md->AGENTS.md
If mandate content needs to change, update .specify/memory/constitution.md, not the symlinks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cybervisor-0.1.3.tar.gz.
File metadata
- Download URL: cybervisor-0.1.3.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ad5d12a7bd5ea4f1789e8c86c32085966c82d1f486918555e3874cd3b237c7
|
|
| MD5 |
cb23c916e94384ed86e173244f6f659c
|
|
| BLAKE2b-256 |
0f794d189024a775891c612551d0506e263dd1fe7ede0e9f6c9752b3cc074611
|
File details
Details for the file cybervisor-0.1.3-py3-none-any.whl.
File metadata
- Download URL: cybervisor-0.1.3-py3-none-any.whl
- Upload date:
- Size: 45.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a884748888490300014a0e3dd22bf74c3fd60a24591d5e6a270d3f9ba12bbc9a
|
|
| MD5 |
2d736dfaad23666a5e0b2582695407e7
|
|
| BLAKE2b-256 |
65090772d51dd1e11f5464a8ee298f7c11d6f3e8557abc6d8e59d891e8f48b12
|