Skip to main content

Arian

CI PyPI version Python versions License

Your documentation is a direct reflection of your software, so hold it to the same standards.

Arian generates LLM-optimized context from source code repositories. Instead of dumping raw files, it intelligently selects, compresses, and organizes code so that language models get the most relevant information — within token limits.

Status: Alpha — Core architecture is established. APIs, CLI, and output may evolve.

Highlights

  • Task-aware — File selection and compression adapt to what you're doing (bug fix, feature, review, onboarding...)
  • Token-budget-first — Set a limit, Arian respects it. Never exceeds your budget
  • Smart compression — Large files get compressed to signatures or structure outlines automatically
  • Python deep analysis — Extracts classes, functions, methods via AST for precise fragmentation
  • One commandarian scans your repo and produces a single, organized Markdown context file
  • Flexible output — Merged, separate, or grouped context files per directory

Overview

Arian does not concatenate files. It builds a structured context plan: collects files, classifies them by architectural role, analyzes symbols, applies compression, and renders Markdown optimized for LLM workflows.

# Generate context for a bug fix
arian src/ tests/ --task bug_fix

# Onboard to a new project
arian --task onboarding

# Set a token budget
arian src/ --budget 5000

Output goes to ~/.arian/output/context.md by default. Each file contains a YAML manifest, full directory tree, and syntax-highlighted code blocks organized by importance.

✍️ Author

Created by Salim Namvar. Built out of the need to feed LLMs the right code context — not just all the code.

Usage

Quick examples

# Current directory
arian

# Specific paths with a task
arian src/ lib/ --task feature

# Token budget
arian src/ --budget 10000

# Separate output per directory
arian src/ lib/ --scope separate

# Grouped output
arian --group src/,lib/ --group tests/

# Verbose logging
arian src/ --verbose

Task types

Task What gets prioritized
bug_fix Tests, implementation, dependencies
feature Domain logic, services, test coverage
review Services, domain logic
onboarding README, configuration, entry points
refactor Services, infrastructure
document README, domain, services
general No special prioritization (default)

CLI options

arian [OPTIONS] [paths]...
Option Default Description
--task general Task type driving file priorities
--budget Unlimited Maximum tokens for context
--output, -o ~/.arian/output/context.md Output file path
--scope merged merged or separate
--group Group paths (repeatable)
--verbose, -v Off Debug logging

For detailed usage, see docs/USAGE.md.

Installation

pip install arian

Requires Python 3.10+.

From source (development)

git clone https://github.com/salimnamvar/arian.git
cd arian
pip install -e ".[dev]"

Development instructions are kept to a minimum here. See docs/developer/GITFLOW.md for the full development workflow.

How it works

  1. Collect — Scans repository for files matching configured extensions
  2. Classify — Assigns each file an architectural role (readme, test, domain, service, infrastructure...)
  3. Analyze — Extracts symbols from Python via AST (other languages get role-based classification)
  4. Plan — Ranks files by relevance to the task, applies compression, enforces token budgets
  5. Materialize — Loads content, applies compression (full → signatures → structure → summary), fragments large files along symbol boundaries
  6. Render — Produces Markdown with manifest, directory tree, and syntax-highlighted code

Compression levels

Compression is budget-driven — by default every file is included at Full content. Only when a token budget is set and the total would exceed it does Arian decide per file:

Level When What it keeps
Full No budget, or file fits within budget Complete content
Signatures Budget pressure (file too big to fit at Full) Class/function signatures and docstrings
Structure Reserved for very large generated files File structure outline
Summary Reserved for very large files Brief summary only

Files are prioritized by relevance to the task: the most important files keep Full content, the next best fit as Signatures, and the rest are dropped to stay within budget.

Feedback and Contributing

Contributions are welcome! Open an issue or submit a pull request at the source repository.

For development setup and workflow, see docs/developer/GITFLOW.md.

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arian-0.8.0.tar.gz (66.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arian-0.8.0-py3-none-any.whl (83.8 kB view details)

Uploaded Python 3

File details

Details for the file arian-0.8.0.tar.gz.

File metadata

  • Download URL: arian-0.8.0.tar.gz
  • Upload date:
  • Size: 66.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for arian-0.8.0.tar.gz
Algorithm Hash digest
SHA256 91308c0c26af3f305d7e65164f036c044c4da6ab22f3cd1258506c274f71c8b1
MD5 d128e5f7352a22a4acfaf3c5e62512f8
BLAKE2b-256 79e273a6245b61c3f93eec9a0ed4cfd9236765fb9d3e988e25b216d561685042

See more details on using hashes here.

File details

Details for the file arian-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: arian-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 83.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for arian-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97324adb990bfcb2def355c96849258147e6980d93b28dae48f875263c6f1ca7
MD5 366aa6f8e1bfefd7f131d5be63d8ecf9
BLAKE2b-256 5d34c7bdb0b0092d858159f633de13cc00ad97ca0c471f4f13b6fd306b22a7b5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

This release

0.8.0 This release

2 files

0.7.0

2 files

0.6.3

2 files

0.5.0

2 files

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