Metadata-Version: 2.4
Name: yoru-cli
Version: 0.1.1
Summary: Yoru — audit-grade session receipts for autonomous AI coding agents.
Project-URL: Homepage, https://yoru.sh
Project-URL: Documentation, https://yoru.sh/docs
Project-URL: Repository, https://github.com/yoru-sh/cli
Project-URL: Issues, https://github.com/yoru-sh/cli/issues
Author-email: Yoru authors <hello@yoru.sh>
License: MIT
License-File: LICENSE
Keywords: ai-agents,aider,audit,claude-code,cursor,observability
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# yoru-cli

The Claude Code hook installer for Yoru. One command installs a `PostToolUse` hook that forwards every tool call, file edit, and red-flag event to a Yoru backend. Your next session shows up in the dashboard automatically.

[![PyPI](https://img.shields.io/pypi/v/yoru-cli.svg)](https://pypi.org/project/yoru-cli/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)

## Install

```bash
pip install yoru-cli
yoru init
```

`yoru init` opens a pairing URL in your browser, writes `~/.claude/hooks/yoru.sh`, and registers the hook in `~/.claude/settings.json`. By default it points at Yoru Cloud ([yoru.sh](https://yoru.sh)) — free forever for one developer.

Requires Python 3.10+. One runtime dep: `httpx`.

## Usage

```bash
yoru init                               # pair against https://api.yoru.sh
yoru init --server https://yoru.acme    # pair against your self-hosted server
yoru init --token yoru_xxx --force      # non-interactive (CI / scripted rotation)

yoru tail < events.jsonl                # post a batch of events (debug)

yoru --version
yoru --help
```

Exit codes: `0` ok · `1` already installed (use `--force`) · `2` auth failed · `3` 4xx · `4` 5xx/network.

## How the hook works

The installed script is ~20 lines of Bash that `POST`s one JSON event per Claude Code tool call:

```json
{"session_id": "…", "user": "…", "kind": "tool_use", "tool": "Bash", "content": "…"}
```

It uses `curl --max-time 2 || true` so a Yoru outage never stalls your terminal — Claude Code doesn't notice the hook is even there.

## Self-host the server

The CLI is MIT. The server (backend + dashboard) is AGPL-3.0 and lives at **[github.com/yoru-sh/yoru](https://github.com/yoru-sh/yoru)**. `docker-compose up`, then `yoru init --server https://your-host` — done.

## License

[MIT](./LICENSE) · Copyright (c) 2026 Yoru authors. Issues and PRs welcome at [github.com/yoru-sh/cli](https://github.com/yoru-sh/cli).
