Build LLM-ready context documents from source repositories
Project description
Arian
Build optimized LLM-ready context from source code repositories. Arian scans a codebase, classifies files by architectural role, analyzes supported languages, applies token-aware compression strategies, and renders Markdown optimized for Large Language Model workflows.
Status: Alpha — Core architecture is established. APIs, CLI interfaces, and output schemas may evolve.
Prerequisites
- Python 3.10 or higher
Quick Start
Install from PyPI:
pip install arian
Or install locally for development:
git clone https://github.com/salimnamvar/arian.git
cd arian
pip install -e ".[dev]"
Generate context for a repository:
arian --task bug_fix
Output is written to .tmp/ by default. Specify a custom path with --output:
arian --task feature --output context.md
Scope to specific directories:
arian src/ lib/
Generate separate context files per directory:
arian src/ lib/ --scope separate
Usage
arian [OPTIONS] [paths]...
| Option | Default | Description |
|---|---|---|
paths |
CWD | Directories or files to include |
--task |
general |
Task type driving file selection priorities |
--output / -o |
.tmp |
Output file path |
--max-tokens |
5000 |
Maximum tokens for context |
--per-chunk |
4000 |
Target tokens per chunk |
--query / -q |
— | Optional task context hint for relevance planning |
--scope |
merged |
Scope mode: merged (single file) or separate (one per path) |
--verbose / -v |
False |
Enable debug logging |
Task Types
| Task | Purpose |
|---|---|
bug_fix |
Prioritizes likely affected implementation, tests, and dependencies |
feature |
Prioritizes domain, services, and test coverage |
review |
Prioritizes services and domain logic |
onboarding |
Prioritizes README, configuration, and entry points |
refactor |
Prioritizes services and infrastructure |
document |
Prioritizes README, domain, and services |
general |
No special prioritization |
How Arian Works
Arian does not simply concatenate repository files. It creates a context plan:
- Scans repository structure
- Classifies files by architectural role
- Analyzes supported languages using language-specific analyzers (Python via AST)
- Uses repository structure and dependency information to improve context selection
- Applies token-budget-aware compression
- Generates optimized context output
Development
Clone the repository and install with dev dependencies:
git clone https://github.com/salimnamvar/arian.git
cd arian
pip install -e ".[dev]"
Run the linter:
ruff check src/ tests/
Run the formatter:
ruff format src/ tests/
Run the type checker:
pyright
Run the tests:
pytest
Scope
Arian builds structured context representations from source repositories and renders them into LLM-friendly formats. Markdown is currently the supported output renderer. It is not a code analysis platform, a documentation generator, or a general-purpose linter.
Currently supported: Python source analysis via AST. Other languages receive role-based classification and basic compression without deep language analysis.
Design Principles
Arian uses a planner-driven architecture where context selection, compression decisions, and rendering are separate stages.
Arian follows:
- Domain-driven modeling with immutable entities and value objects
- Separation between planning and rendering
- Token-budget-first context generation
- Language-specific analysis through pluggable analyzers
- Deterministic transformations where possible
Contributing
Contributions are accepted. Open an issue or submit a pull request at the source repository.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arian-0.5.0.tar.gz.
File metadata
- Download URL: arian-0.5.0.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7a72a974ff2f2a0c6c0935f43421140d5defc6ea5162046f01b4256ea750457
|
|
| MD5 |
3eff79d472b031fae2d31416efa290ad
|
|
| BLAKE2b-256 |
0776a1ccd0d38def888d659926da61a768ee0dc0f84507470482b8176707bbb7
|
File details
Details for the file arian-0.5.0-py3-none-any.whl.
File metadata
- Download URL: arian-0.5.0-py3-none-any.whl
- Upload date:
- Size: 56.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cab64a53aa6e49b7e696213245aadb492bc68fdb6223af676693dc441f10c5a5
|
|
| MD5 |
a5c6f71e7a8b33688117cd3925a65bea
|
|
| BLAKE2b-256 |
63b522e3fa8c3fe6079c7dee82f8b7e8bee10dd95dfa5dfcf0b29e31bd861c7e
|