Skip to main content

bashOS

CI Python 3.11+ License: MIT

A terminal-first AI runtime. Claude slash commands routed through a LangGraph kernel, running on your Claude Code OAuth — for all things software development and information systems.

 _             _    ___  ____
| |__  __ _ __| |_ / _ \/ ___|
| '_ \/ _` (_-< ' \ (_) \___ \
|_.__/\__,_/__/_||_\___/|____/

The terminal is the core access point: one REPL (and one-shot CLI) reaches every capability. Commands are markdown specs in .claude/commands/ — the exact files Claude Code loads as project slash commands — and the bashOS kernel routes those same files through AI orchestration loops. One spec, two runtimes.

Quickstart

./bin/bashos                 # first run bootstraps .venv, then drops into the REPL
bashos ▸ /sh find files over 100MB modified this week
bashos ▸ /script rotate logs in /var/log, keep 7 days     # drafted, shellcheck-verified, repaired
bashos ▸ /sys why is this machine slow                    # read-only agent probes the real machine
bashos ▸ count unique IPs in access.log                   # no slash → kernel classifies → /pipe
bashos ▸ !git status                                      # raw passthrough to your real shell

One-shot, from any terminal or script:

bashos run /explain "rsync -avz --delete src/ host:/dst"
bashos run -n /script backup my dotfiles     # -n dry-run: routing + rendered prompt, no model call
bashos run -v /sh list open ports            # -v prints the kernel trace
bashos list                                  # command table
bashos doctor                                # auth + environment checks

Auth — Claude Code OAuth first

bashOS needs no API key. Backends, in preference order:

backend how it authenticates setup
claude-code (default) Claude Agent SDK → your Claude Code login (subscription OAuth) install Claude Code, claude → log in — done
claude-code (headless) long-lived OAuth token claude setup-token → CLAUDE_CODE_OAUTH_TOKEN=...
api (fallback) direct Anthropic API billing ANTHROPIC_API_KEY=...

Force one with BASHOS_BACKEND=claude-code|api; pick a model with BASHOS_MODEL or -m (default claude-opus-5). bashos doctor shows what was detected. Copy .env.example to .env for persistent settings.

Commands

command loop what it does
/sh prompt natural language → a safe, correct shell command
/explain prompt explain any command, pipeline, error, or config like a man page
/script refine production-grade bash script — drafted, shellcheck-verified, auto-repaired
/debug react diagnose a failure by inspecting this machine (read-only)
/sys react system health / questions, answered from live read-only probes
/pipe prompt design text/data pipelines (grep · sed · awk · sort · jq)
/regex prompt craft + explain + test regular expressions
/cron prompt build or explain cron expressions and schedules
/port prompt translate between bash ↔ POSIX sh ↔ zsh ↔ PowerShell ↔ Python
/audit prompt security-review a shell script, findings ranked by severity

Every one of these also works as a plain slash command inside Claude Code when you open this repo — same file, no duplication.

Architecture

 terminal (REPL / CLI · typer + rich + prompt-toolkit)
    │
    ▼
 kernel — LangGraph state machine
    input ─▶ parse ─┬─▶ dispatch ──▶ prompt  (one model call)            ┐
                    │       ▲   └──▶ refine  (draft→shellcheck→repair)   ├─▶ respond
                    │       │   └──▶ react   (agent loop, read-only)     ┘
                    └─▶ classify  (bare english → best command)
    │
    ▼
 model runtime — Claude Code OAuth (Agent SDK) ▸ or ANTHROPIC_API_KEY fallback
    │
    ▼
 userland — .claude/commands/*.md  (shared with Claude Code)

The full design — layer contracts, loop semantics, tool policy, extension guide — is in docs/HARNESS.md. The long-range vision (an image-based Linux appliance with the agent kernel as a first-class OS service) is the bashOS reference architecture; HARNESS.md maps this runtime onto its layers.

Extending

Add a command by dropping one markdown file into .claude/commands/:

---
description: what it does
argument-hint: <what to pass>
bashos:
  loop: prompt        # or refine | react
---
Prompt body with $ARGUMENTS.

No registration, no code — it appears in bashos list and in Claude Code immediately.

Safety model

  • /sh and friends generate commands; they never execute them.
  • The react loop (/sys, /debug) runs under an explicit read-only tool policy: file reads plus an allowlist of diagnostic probes; write, edit, and network tools are denied; every tool action streams to your terminal live.
  • /script output is verified by shellcheck when installed, and labeled unverified when not.
  • Only ! lines execute anything by your intent — and that's your own shell.

Services (Docker)

LangChain and LangGraph run in-process as libraries — the terminal needs no services. The optional compose stack adds infrastructure around the terminal:

docker compose up -d           # phoenix + langgraph-dev
docker compose run bashos      # the terminal itself, containerized
service port what it is
phoenix 6006 Arize Phoenix — every kernel loop traced (UI + OTLP HTTP; gRPC on 4317)
langgraph-dev 2024 LangGraph API server exposing the same kernel graph over HTTP (langgraph.json → kernel; LangGraph Studio-compatible)
bashos — the terminal, containerized (profiles: [cli] — started explicitly)

Container auth: interactive claude login isn't possible in a container, so set CLAUDE_CODE_OAUTH_TOKEN (mint with claude setup-token) or ANTHROPIC_API_KEY in .env. Already running a Phoenix elsewhere? Remap host ports via BASHOS_PHOENIX_*_PORT, or point PHOENIX_COLLECTOR_ENDPOINT at it — full guide in docs/SERVICES.md.

Local tracing without containers: pip install -e ".[trace]", run Phoenix anywhere, and set PHOENIX_COLLECTOR_ENDPOINT. On the claude-code backend, spans cover the kernel and loop structure; use the api backend for token-level LLM telemetry.

Development

python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -q            # offline: fake model, no auth needed

Roadmap

  • Session memory: LangGraph checkpointer so loops share conversational state
  • An --exec confirm-then-run mode for /sh
  • Streaming token output in the REPL
  • More loops: plan-execute, multi-draft panel w/ judge
  • More userland: /git, /docker, /net, /db

Metadata

Release files for bashos 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bashos 0.1.0
File Size Uploaded Provenance Actions
bashos-0.1.0.tar.gz 45.2 kB With provenance Details for bashos-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bashos 0.1.0
File Interpreter ABI Platform Actions
bashos-0.1.0-py3-none-any.whl Python 3 none any Details for bashos-0.1.0-py3-none-any.whl

Total release size: 73.8 kB

Release files / bashos-0.1.0.tar.gz

Download URL bashos-0.1.0.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f320fa11238510f41f08cc0a00b71dc323fbb397aa5c351be8ef5cdc912a6cfc
BLAKE2b-256 checksum
How to use checksums
fbe9f6163cfab41a637f1d575c7ad954b4332aaebd12d79cdab3ae0058e68e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / bashos-0.1.0-py3-none-any.whl

Download URL bashos-0.1.0-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab022127a498d7921efc2aba1b87b3cb2431905920b2bfb047e164e70ad1a16
BLAKE2b-256 checksum
How to use checksums
5ad977290f37a7d619bb15cf3123d4106246897c522f4a76a06f4090df6aa695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Security for bashos 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bashos-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page