Metadata-Version: 2.4
Name: oni-cli
Version: 1.0.0
Summary: Single-command context aggregation for LLMs, straight to your macOS clipboard.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pyfiglet>=1.0.4
Requires-Dist: questionary>=2.1.1
Requires-Dist: rich>=15.0.0
Requires-Dist: typer>=0.27.2


<div align="center">

  <img src="https://rowlinsonmike.com/oni.png" alt="ONI Logo" width="180" />

  # ONI

  **Single-command context aggregation for LLMs, straight to your macOS clipboard.**

  <br />

  <img src="https://rowlinsonmike.com/oni-demo.gif" alt="ONI Demo" width="750" />

</div>

---

CLI that makes a single context widow from your files and sends it directly to your macOS clipboard.

---

## Key Features

- **Direct to Clipboard**: Uses macOS `pbcopy` under the hood to send your aggregated code context straight to your clipboard.
- **Smart Filtering**: Ignores binary files and junk directories (`.git`, `node_modules`, `.venv`, build caches) automatically.
- **Syntax Awareness**: Maps file extensions to Markdown code fences (`py`, `ts`, `rs`, `go`, `sql`, etc.) for LLM legibility.
- **Interactive Prompting**: If run with no arguments, Oni prompts for target glob patterns.
- **Size Safeguards**: Skips oversized source files with customizable thresholds.

---

## Installation

Ensure you have Python 3.9+ installed:


---

## Quick Usage

### Parse everything in the current directory

```bash
oni

```

*If called without patterns, Oni triggers an interactive prompt defaulting to `**/*`.*

### Parse specific directories or file globs

```bash
# Ingest entire src directory
oni src/**/*

# Combine specific file types
oni "src/**/*.py" "config/*.json"

# Ingest explicit targets
oni main.py pyproject.toml docs/README.md

```

---

## CLI Options Reference

```text
Usage: oni [OPTIONS] [PATTERNS]...

```

| Flag / Option | Short | Default | Description |
| --- | --- | --- | --- |
| `[PATTERNS]...` | — | `None` (Prompts) | File paths or glob patterns (e.g. `src/**/*.py`, `main.py`). |
| `--meta / --raw` | — | `--meta` | Includes repository file context header and aggregate statistics. |
| `--max-kb` | `-m` | `512` | Upper size limit in KB per file. Larger files are spat out. |
| `--preview` | `-p` | `False` | Prints the first 2,500 characters of the prompt to terminal. |
| `--help` | — | — | Displays the command-line usage and exits. |

### Examples with Flags

#### Omit Metadata Header

Generate pure code fence blocks with no introductory repository summaries:

```bash
oni "src/**/*.rs" --raw

```

#### Adjust Max File Size Threshold

Lower file size limit to 200 KB and inspect the payload before pasting:

```bash
oni "**/*.ts" --max-kb 200 --preview

```

---

## Automatic Exclusions

Oni ignores the following paths during scanning:

```text
.git          node_modules     __pycache__
.venv         venv             .pytest_cache
.mypy_cache   dist             build
.DS_Store     .idea            .vscode

```

Binary files are detected via null-byte inspection and excluded from the output buffer.
