Print the structural outline of source files for LLM navigation
Project description
outliner
Print the structural outline of source files — declarations with line ranges — so an LLM agent (or human) can navigate a file without reading it whole.
Usage
outliner [OPTIONS] [FILE...]
| Option | Description |
|---|---|
-g, --grep EXPR |
Only show items whose signature matches EXPR (case-insensitive) |
-s, --syntax LANG |
Override syntax auto-detection when it is ambiguous |
Pass a file, a directory (walked recursively), or omit arguments to read stdin.
Use - to read stdin explicitly. --syntax is only needed when content
auto-detection cannot identify the language (e.g. an ambiguous extensionless
script piped on stdin).
Output
3,4 type Driver struct
19,6 func New() *Driver
26,12 func (d *Driver) StartLogging(ctx context.Context, f *os.File) error
Each line: <start>,<count> <signature>
start— 1-based line number, right-alignedcount— number of lines covered by the item (including doc-comments above)signature— first non-comment line of the declaration; multi-line signatures are merged into one line
Nesting is visible in two ways: overlapping ranges (a class range contains its
methods) and native-format indentation in the signature (indented for code,
#/## heading levels for Markdown).
Installation
pip install outliner
Running
# From within the outliner/ directory
uv run outliner path/to/file.py
# From the repository root
uv run --project outliner outliner path/to/file.py
# Outline an entire directory
uv run --project outliner outliner src/
Running Tests
# From within the outliner/ directory
uv run pytest
Supported Languages
Python, Go, Markdown, reStructuredText — with Java, Rust, JavaScript/TypeScript, C/C++, C#, and many more in progress.
Example Use Cases
Structural overview — Run on a directory to see all declarations across many files before reading anything:
$ outliner src/
==> src/billing.py <==
12,8 class Invoice
22,4 def create(customer_id: str, items: list[Item]) -> Invoice
38,6 def send(invoice: Invoice, method: str) -> bool
==> src/payments.py <==
8,3 class PaymentMethod
14,12 def charge(method: PaymentMethod, amount: Decimal) -> Receipt
Find all copies of a pattern — --grep serialize across a source tree locates every implementation of a repeated function in one command:
$ outliner --grep serialize src/
==> src/invoice.py <==
44,5 def serialize(self) -> dict
==> src/receipt.py <==
31,3 def serialize(self) -> dict
Find functions whose interface mentions a term — --grep searches signatures, not bodies. It finds functions whose interface involves a concept, skipping internal uses, comments, and call sites:
$ outliner --grep payment src/
14,12 def charge(method: PaymentMethod, amount: Decimal) -> Receipt
61,4 def refund(payment: Payment) -> bool
Find functions accepting a specific type — --grep PaymentMethod locates every function where the type appears in parameters, return types, or generic bounds. Multi-line signatures are merged into a single line before matching, so nothing is missed:
$ outliner --grep PaymentMethod src/
14,12 def charge(method: PaymentMethod, amount: Decimal) -> Receipt
88,4 def validate(m: PaymentMethod) -> bool
Project details
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 outliner_cli-0.1.0.tar.gz.
File metadata
- Download URL: outliner_cli-0.1.0.tar.gz
- Upload date:
- Size: 67.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b289010286e11f7f50b31f68ae68ea4389b0ad505203c62222c469d97f5843d0
|
|
| MD5 |
a8191037c42bc0ea665eaabcade4c9ad
|
|
| BLAKE2b-256 |
7252947b1278c621de1810852de3141e881653082f6806d74cc4c745b49324c3
|
Provenance
The following attestation bundles were made for outliner_cli-0.1.0.tar.gz:
Publisher:
publish-outliner.yml on cederberg/incubator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
outliner_cli-0.1.0.tar.gz -
Subject digest:
b289010286e11f7f50b31f68ae68ea4389b0ad505203c62222c469d97f5843d0 - Sigstore transparency entry: 1409204443
- Sigstore integration time:
-
Permalink:
cederberg/incubator@6755a0fb518f9b528e2e41f625b937b837e55423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cederberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-outliner.yml@6755a0fb518f9b528e2e41f625b937b837e55423 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file outliner_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: outliner_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a21e02d2894090b2a8f110a0b95f0fef833e0da3ba18fa06cce2756bd951f41
|
|
| MD5 |
17603e10412b378ffb5bea8cda7c214f
|
|
| BLAKE2b-256 |
c8501ff3a8040755bd9076a6f5a88fa0bfaaa3867430689870d1f10c2ed991f2
|
Provenance
The following attestation bundles were made for outliner_cli-0.1.0-py3-none-any.whl:
Publisher:
publish-outliner.yml on cederberg/incubator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
outliner_cli-0.1.0-py3-none-any.whl -
Subject digest:
1a21e02d2894090b2a8f110a0b95f0fef833e0da3ba18fa06cce2756bd951f41 - Sigstore transparency entry: 1409204506
- Sigstore integration time:
-
Permalink:
cederberg/incubator@6755a0fb518f9b528e2e41f625b937b837e55423 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cederberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-outliner.yml@6755a0fb518f9b528e2e41f625b937b837e55423 -
Trigger Event:
workflow_dispatch
-
Statement type: