Autonomous software development with github/roo
Project description
Khive · Developer Toolkit for Polyglot Agent Monorepos
Khive is an opinionated toolbox that keeps multi-language agent projects fast, consistent, and boring-in-a-good-way. One command -
khive- wraps all the little scripts you inevitably write for formatting, CI gating, Git hygiene and doc scaffolding, then gives them a coherent UX that works the same on your laptop and inside CI.
The toolkit is written in pure Python (3.11+), has zero runtime
dependencies, and delegates real work to best-of-breed tools like ruff,
cargo, deno, and pnpm.
--
- need PERPLEXITY_API_KEY and EXA_API_KEY for
khive info searchto work - need OPENROUTER_API_KEY for
khive info consultto work - to use reader,
pip install "khive[reader]"orpip install "khive[all]"to install all dependencies
Table of Contents
- Core Philosophy
- Quick Start
- Command Catalogue
- Usage Examples
- Configuration
- Prerequisites
- Project Layout
- Contributing
- License
Core Philosophy
- Single entry-point →
khive <command> - Convention over config → sensible defaults, TOML for the rest
- CI/local parity → the CLI and the GH workflow run the same code
- Idempotent helpers → safe to run repeatedly; exit 0 on "nothing to do"
- No lock-in → wraps existing ecosystem tools instead of reinventing them
Quick Start
# 1 · clone & install
$ git clone https://github.com/khive-dev/khive.git
$ cd khive
$ uv pip install -e . # editable install - puts `khive` on your PATH
# 2 · bootstrap repo (node deps, rust fmt, git hooks, …)
$ khive init -v
# 3 · hack happily
$ khive fmt --check # smoke-test formatting
$ khive ci --check # quick pre-commit gate
Command Catalogue
| Command | What it does (TL;DR) |
|---|---|
khive init |
Verifies toolchain, installs JS & Python deps, runs cargo check, wires Husky hooks. |
khive fmt |
Opinionated multi-stack formatter (ruff + black, cargo fmt, deno fmt, markdown). |
khive commit |
Stages → (optional patch-select) → conventional commit → (optional) push. |
khive pr |
Pushes branch & opens/creates GitHub PR (uses gh). |
khive ci |
Local CI gate - lints, tests, coverage, template checks. Mirrors GH Actions. |
khive clean |
Deletes a finished branch locally & remotely - never nukes default branch. |
khive new-doc |
Scaffolds markdown docs (ADR, RFC, IP…) from templates with front-matter placeholders. |
khive reader |
Opens/reads arbitrary docs via docling; returns JSON over stdout. |
khive search |
Validates & (optionally) executes Exa/Perplexity searches. |
Run khive <command> --help for full flag reference.
Usage Examples
# format *everything*, fixing files in-place
khive fmt
# format only Rust & docs, check-only
khive fmt --stack rust,docs --check
# staged patch commit, no push (good for WIP)
khive commit "feat(ui): dark-mode toggle" --patch --no-push
# open PR in browser as draft
khive pr --draft --web
# run the same CI suite GH will run
khive ci
# delete old feature branch safely
khive clean feature/old-experiment --dry-run
# spin up a new RFC doc: docs/rfcs/RFC-001-streaming-api.md
khive new-doc RFC 001-streaming-api
# open a PDF & read slice 0-500 chars
DOC=$(khive reader open --source paper.pdf | jq -r .doc_id)
khive reader read --doc "$DOC" --end 500
Configuration
Khive reads TOML from your project root. All keys are optional - keep the file minimal and override only what you need.
pyproject.toml snippets
[tool.khive fmt]
# enable/disable stacks globally
enable = ["python", "rust", "docs", "deno"]
[tool.khive fmt.stacks.python]
cmd = "ruff format {files}" # custom formatter
check_cmd = "ruff format --check {files}"
include = ["*.py"]
exclude = ["*_generated.py"]
[tool.khive-init]
# selective steps
steps = ["check_tools", "install_python", "install_js", "cargo_check"]
# extra custom step - runs after built-ins
[[tool.khive-init.extra]]
name = "docs-build"
cmd = "pnpm run docs:build"
Prerequisites
Khive helps you install tooling but cannot conjure it from thin air. Make sure
these binaries are reachable via PATH:
- Python 3.11+ &
uv - Rust toolchain -
cargo,rustc,rustfmt, optionalcargo-tarpaulin - Node + pnpm - for JS/TS stacks & Husky hooks
- Deno ≥ 1.42 - used for Markdown & TS fmt
- Git + GitHub CLI
gh- Git ops & PR automation - jq - report post-processing, coverage merging
Run khive init --check to verify everything at once.
Project Layout
khive/
khive_cli.py # ← unified dispatcher
khive_init.py # env bootstrapper
khive_fmt.py # formatter orchestrator
khive_commit.py # conventional commit helper
khive_pr.py # PR automation via gh
khive_ci.py # test / lint / coverage gate
khive_clean.py # branch janitor
khive_new_doc.py # markdown scaffolder
khive_reader.py # docling wrapper CLI
khive_search.py # Exa / Perplexity search CLI
utils.py # shared ANSI & helpers
All scripts expose a main() entry-point; khive_cli.py maps sub-commands via
its COMMANDS dict so extension is trivial.
Contributing
- Fork → branch (
feat/…) → hack khive fmt && khive ci --checkuntil greenkhive commit "feat(x): …"+khive pr- Address review comments → squash-merge ☑️
We follow Conventional Commits and semantic-release tagging.
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 khive-0.2.1.tar.gz.
File metadata
- Download URL: khive-0.2.1.tar.gz
- Upload date:
- Size: 436.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f4763c3a220b7c85fcdab06f3e1172c3b12b644e7cae8c9ca13766bd47d588
|
|
| MD5 |
9a5bd4b377081b121fa20925523f0546
|
|
| BLAKE2b-256 |
e56397556a871371403f8eef9123900b5815296215bd244d2a754ddadf658484
|
File details
Details for the file khive-0.2.1-py3-none-any.whl.
File metadata
- Download URL: khive-0.2.1-py3-none-any.whl
- Upload date:
- Size: 241.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6a42ee21ac3da7bb8a01925e3c915e9f0c8a7e9f14aead3f1ad13571c7a450e
|
|
| MD5 |
65857bcbc8fc04569ce58a3a9ea67715
|
|
| BLAKE2b-256 |
9440d09efb318554cb17732c3831bdaa5402ae412225118bae014f4567a9ad5e
|