<div align="right">Table of Contents ↗️</div>
<h1 align="center"><code>za</code></h1>
<p align="center">
🛠️ <strong>Zero-to-All</strong> — scan your workspace and generate an opinionated <code>CONTEXT.md</code> so AI, code-reviewers and newcomers always have the full picture.
</p>
<div align="center">
[](https://crates.io/crates/za)
[](https://github.com/lvillis/za)
[](https://github.com/lvillis/za/actions)
[](https://hub.docker.com/r/lvillis/za)
[](https://hub.docker.com/r/lvillis/za)
[](LICENSE)
</div>
---
## ✨ Features
* **Zero-config scan** – walks the project tree and respects `.gitignore`, global ignores and custom `.aiignore`.
* **Smart snippets** – keeps the first/last *N* lines of each text file; optional hex preview for binary/invalid-UTF-8 files.
* **Beautiful output** – generated `CONTEXT.md` includes a directory tree, collapsible code blocks and language highlighting.
* **CLI ergonomics** – powered by `clap` & `indicatif`; built-in `--help` and fancy spinner animation.
* **Pluggable roadmap** – stubs for `diff` and `stats` sub-commands pave the way for incremental context and code analytics.
## 🛠️ Installation
### Cargo
```console
cargo install za # requires Rust ≥ 1.74
```
### Pre-built binary
```shell
curl -Ls https://github.com/lvillis/za/releases/latest/download/za-x86_64-unknown-linux-musl \
-o /usr/local/bin/za && chmod +x /usr/local/bin/za
```
## ⚡ Quick Start
```shell
# generate CONTEXT.md in project root (keeps 200 lines per file)
za gen
# advanced: keep 800 lines, include binary preview, write to docs/CONTEXT.md
za gen --max-lines 800 --include-binary --output docs/CONTEXT.md
```
Example output (excerpt):
```markdown
# 📚 Project Context — generated by za
_Generated at: 2025-05-07T14:47:50Z_
## 1. Directory Overview
(27 ) Cargo.toml
(30 ) README.md
(237 ) src/main.rs
## 2. File Snippets
<details><summary>src/main.rs</summary>
```rust
// src/main.rs
use anyhow::Result;
…
</details>
```