Claude Code-style CLI harness for the ninja subnet agent
Project description
katana
katana is a small PyPI-ready CLI package that runs the public
ninja-subnet/ninja agent like a local coding
assistant.
Subnet 66 harnesses are now multi-file bundles: an agent.py entrypoint plus a
stdlib-only agent/ package (up to 32 *.py files), with tau_agent_files.json
listing every file. katana bundles the latest such snapshot at build time,
loads it exactly the way the validator does (the bundle root goes on sys.path
so the entrypoint's from agent.* import ... resolves), and calls its
validator-compatible contract:
solve(repo_path, issue, model, api_base, api_key)
Single-file agents (just agent.py) remain fully supported.
Install
Prerequisites
- Python 3.11 or newer
pip(bundled with Python)- An OpenRouter API key
From PyPI (recommended)
pip install katana-cli
Verify the installation:
katana --version
From source
Clone the repository and install in editable mode:
git clone https://github.com/ninja-subnet/katana-cli.git
cd katana-cli
python -m pip install -e .
Verify the installation:
katana --version
Configure
katana config
This stores your OpenRouter API key and default model in the OS user config
directory, such as ~/.config/katana/config.json on Linux. The file is written
with user-only permissions.
Environment variables override stored config:
OPENROUTER_API_KEY=...
KATANA_MODEL=anthropic/claude-sonnet-4.6
Use
Open an interactive session in the current git repo:
katana
Run a one-shot task:
katana "fix the failing parser test"
Run explicitly:
katana run --repo . --model anthropic/claude-sonnet-4.6 "add validation for empty input"
By default, katana previews the returned patch and asks before applying it.
Use --apply to request application after the run.
Agent Sources
Show bundled metadata:
katana agent info
Cache and use a specific ninja-subnet/ninja ref. The whole bundle (every file in
tau_agent_files.json) is fetched, not just agent.py:
katana agent update --ref 486999c820ff92184deea0d2fc6723880be3e84e
katana run --agent-ref 486999c820ff92184deea0d2fc6723880be3e84e "fix the issue"
Use your own compatible local agent. --agent-path accepts either a single
agent.py or a bundle directory containing agent.py (and, optionally, an
agent/ package and a tau_agent_files.json manifest):
katana run --agent-path ./agent.py "fix the issue"
katana run --agent-path ./my_bundle "fix the issue"
katana --agent-path ~/agents/my_agent.py "fix the issue"
Custom agents must expose the same callable contract as the bundled agent:
def solve(repo_path, issue, model, api_base, api_key):
return {"patch": "", "logs": "", "steps": 0, "cost": None, "success": True}
For a multi-file bundle, agent.py is the entrypoint and may import its
supporting modules (from agent.foo import bar); list every file, including
agent.py, in tau_agent_files.json.
Models
katana models
Recommended defaults are intentionally simple. You can pass any OpenRouter model
id with --model.
Development
python -m pip install -e '.[dev]'
pytest
python -m build
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 katana_cli-0.1.0.tar.gz.
File metadata
- Download URL: katana_cli-0.1.0.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e95aa06963f646522bac52bd54fb4ee0f1d8a92c29953be76c497de630ae021
|
|
| MD5 |
806642060cbbd91baeccc9f00f12309b
|
|
| BLAKE2b-256 |
dee521fdb1f19b03b0a36ed956f4f4f1ce0aed6a0a003140780a215cc9fa883a
|
Provenance
The following attestation bundles were made for katana_cli-0.1.0.tar.gz:
Publisher:
publish.yml on ninja-subnet/katana-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
katana_cli-0.1.0.tar.gz -
Subject digest:
4e95aa06963f646522bac52bd54fb4ee0f1d8a92c29953be76c497de630ae021 - Sigstore transparency entry: 2083562081
- Sigstore integration time:
-
Permalink:
ninja-subnet/katana-cli@cbb96898bce759dfc8556aa2cc8f15dc3e186364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ninja-subnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbb96898bce759dfc8556aa2cc8f15dc3e186364 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file katana_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: katana_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d634843ed69d32837fc735c540e2c0df273e8d15f41ab538f0e741323b238561
|
|
| MD5 |
9dbd86f5de3fc3578accdda529cfdafc
|
|
| BLAKE2b-256 |
415699138c8d785a58f62944c775e80c76671cfa55d15922d801c9d2fa445841
|
Provenance
The following attestation bundles were made for katana_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ninja-subnet/katana-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
katana_cli-0.1.0-py3-none-any.whl -
Subject digest:
d634843ed69d32837fc735c540e2c0df273e8d15f41ab538f0e741323b238561 - Sigstore transparency entry: 2083562102
- Sigstore integration time:
-
Permalink:
ninja-subnet/katana-cli@cbb96898bce759dfc8556aa2cc8f15dc3e186364 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ninja-subnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbb96898bce759dfc8556aa2cc8f15dc3e186364 -
Trigger Event:
workflow_dispatch
-
Statement type: