Skip to main content

Annotates source files with their relative paths for easier AI/debug context

Project description

Annotator

Annotator is a simple CLI utility that prepends relative file paths as comments to your project files as the first line.
It’s designed to make AI debugging easier by automatically marking file paths for better context and easier copy-pasting.


✨ Features

  • 🚀 Automatically annotates files with their relative paths.
  • 🛠️ Supports many programming languages and file types out of the box.
  • ⚙️ Fully customizable via a .annotator.json configuration file.
  • 🚫 Exclude specific directories, files, or extensions.
  • Lightweight and fast — no external dependencies.

📝 Example .annotator.json

{
  "comment_styles": {
    ".md": "<!--",
    "Dockerfile": "#"
  },
  "exclude_extensions": ["*.test.js", "*.spec.ts"],
  "exclude_dirs": ["test", "dist"],
  "exclude_files": [".env"]
}
Configuration Notes
  • comment_styles: Maps file extensions (from the first . to the end) or exact filenames to their comment syntax.
    Example: .js//, .md<!--. You can add any extension to annotate non-default types.

  • exclude_extensions: Skips all files with these full extensions (from the first .).
    Note: Even if an extension is mapped in comment_styles, files matching an excluded extension will not be annotated.

  • exclude_dirs: Skips these directories entirely.
    Note: Any file inside an excluded directory is never annotated, even if its extension is mapped in comment_styles.

  • exclude_files: Skips specific full filenames (with extensions) entirely.
    Note: These take precedence over both comment_styles and exclude_extensions.

  • Extension parsing: Extensions are always taken from the first . to the end of the filename.
    Example: For a file named file.a.b.c.js, the full extension is .a.b.c.js.


Installation

1. Install pipx

Follow the official guide: pipx Installation Guide

2. Install annotator-cli via pipx (recommended):

pipx install annotator-cli

🚀 Usage

1. Run the CLI

annotator /path/to/project

Annotator will process and annotate all eligible files based on your configuration.

2. Uninstall (if needed)

pipx uninstall annotator-cli

⚠️ Disclaimer

This software is provided as-is, without warranty of any kind.
Use at your own risk — the author is not responsible for data loss, crashes, or security issues.


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

annotator_cli-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

annotator_cli-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file annotator_cli-0.1.0.tar.gz.

File metadata

  • Download URL: annotator_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for annotator_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e634ada1da399c78804aff7ae8d4a1c55a24c40d84f0c781ae9df1ed8593153b
MD5 98edaa55e264056f2940769f400d1e68
BLAKE2b-256 e9c06ac9dfad4dd33fd899588c990b566c415807f78e615bc4c745ca9557a116

See more details on using hashes here.

File details

Details for the file annotator_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: annotator_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for annotator_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 779b3a30ce463578a8d22b54c91f435f11c74b6bf9fd7765aebc13c51065183e
MD5 8445794a460f94c7d2eba28ce2b58424
BLAKE2b-256 5d730ed0e745a318232fdf5bddddf04447c0efc519627ec6bf611bb0566e570f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page