Skip to main content

outliner

Print the structural outline of source files — declarations and callable landmarks with line ranges — so an LLM agent (or human) can navigate a file without reading it whole.

Usage

outliner-cli [OPTIONS] [FILE...]
Option Description
-g, --grep EXPR Only show items whose signature matches EXPR
-s, --syntax LANG Override syntax auto-detection when ambiguous
-t, --type LANG Only include files of this language (repeatable)
-w, --width COLS Truncate lines (0=off, auto=fit, default 120)
-x, --exclude GLOB Exclude files from directory walks (gitignore-style)

Pass a file, a directory (walked recursively), or omit arguments to read stdin. Use - to read stdin explicitly. Directory walks honor .gitignore and skip hidden directories; all other files are listed, with binary and unrecognized files shown as one-line binary file / unsupported file summaries. --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-aligned
  • count — number of lines covered by the item (including doc-comments above)
  • signature — first non-comment line of a declaration; multi-line signatures are merged into one line; lines longer than the output width are truncated with ...

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-cli

Running

# With the package installed (pip or uvx):
uvx outliner-cli path/to/file.py

# From within the outliner/ directory
uv run outliner-cli path/to/file.py

Running Tests

# From within the outliner/ directory
uv run pytest

Supported Languages

AsciiDoc, C/C++, C#, Clojure, Go, HTML, Java, JavaScript/TypeScript (incl. Svelte, Vue, and Astro components), JSON/NDJSON, Markdown, Org-mode, Perl, PHP, Python, reStructuredText, Ruby, Rust, Scala, Shell, Swift, XML, and Zig.

Example Use Cases

Structural overview — Run on a directory to see declarations across all files before reading anything:

$ uvx outliner-cli 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:

$ uvx outliner-cli --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:

$ uvx outliner-cli --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:

$ uvx outliner-cli --grep PaymentMethod src/
 14,12  def charge(method: PaymentMethod, amount: Decimal) -> Receipt
 88,4   def validate(m: PaymentMethod) -> bool

Inspect a dataset without opening it — JSON/NDJSON files show a schema overview with file size, record count, data types, optionality, and truncated sample values:

$ uvx outliner-cli titanic.json
$             163.9 KB · json · array[891]
.Age          float|int? -- 22
.Cabin        str? -- "C85"
.Embarked     str? -- "S"
.Fare         float|int -- 7.25
.Name         str -- "Braund, Mr. Owen Harris"
.Survived     int -- 0

XML files show an indented structural outline with XML-native node kinds:

$ uvx outliner-cli pubmed26n0001.xml
/                                195.5 MB · xml · sampled 204K elems
<PubmedArticleSet>               elem
  <PubmedArticle>                elem+
    <MedlineCitation>            elem
      @Status                    attr -- "MEDLINE"
      <Article>                  elem
        <ArticleTitle>           text -- "Formate assay in body fluids..."
        <Abstract>               elem?

Metadata

Release files for outliner-cli 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for outliner-cli 0.4.0
File Size Uploaded Provenance Actions
outliner_cli-0.4.0.tar.gz 95.5 kB With provenance Details for outliner_cli-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for outliner-cli 0.4.0
File Interpreter ABI Platform Actions
outliner_cli-0.4.0-py3-none-any.whl Python 3 none any Details for outliner_cli-0.4.0-py3-none-any.whl

Total release size: 152.8 kB

Release files / outliner_cli-0.4.0.tar.gz

Download URL outliner_cli-0.4.0.tar.gz
Size 95.5 kB
Tags Source
SHA-256 checksum
How to use checksums
651074acdeac6da3885985da7427c48ea1113c4865df508ff0dcca18f52775b3
BLAKE2b-256 checksum
How to use checksums
f9d84a01b1a688f278fc27cf342ce38002c9f1bc04607d784d814421781cbb3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / outliner_cli-0.4.0-py3-none-any.whl

Download URL outliner_cli-0.4.0-py3-none-any.whl
Size 57.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77bf6a334eaed3f95a9679d02c2850194ef52ead47d346a95e3b42e0415ab274
BLAKE2b-256 checksum
How to use checksums
ce4f268593476461d63c4dc1225ad9556d77ad5a9c7cc9b3055cc454efebda71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Security for outliner-cli 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for outliner_cli-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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