Skip to main content

Export source code and project files into AI-friendly text bundles with manifest

Project description

anything-to-text

Export source code and project files into AI-friendly text bundles with a compact manifest.

Commands: anything-to-text or att (short alias)

Features

  • Multi-language support: Python, TypeScript, JavaScript, Java, Kotlin, Swift, HTML/CSS, and more
  • AI-optimized output: Creates bundle files with embedded metadata for AI assistants
  • Smart filtering: Respects .gitignore and skips build/cache directories automatically
  • Manifest generation: Produces MANIFEST.json with precise file location mappings
  • Project overview: Optional PROJECT_OVERVIEW.txt for architecture insights
  • Secret protection: Skips .env, keys, certificates, and other sensitive files by default
  • Fancy interactive UI: Checkbox-style selection with questionary
  • Large file handling: Automatically splits large files into manageable chunks

Installation

pip install anything-to-text

Quick Start

CLI Usage

# Show version
anything-to-text --version
att --version

# Interactive mode - scan current directory
anything-to-text
att

# Specify project root
anything-to-text /path/to/project
att /path/to/project

# Non-interactive mode with specific categories
anything-to-text /path/to/project --non-interactive --categories python typescript
att /path/to/project --non-interactive --categories python typescript

# Export specific files or folders
anything-to-text . --non-interactive --paths src main.py
att . --non-interactive --paths src main.py

# Generate project overview
anything-to-text . --project-overview
att . --project-overview

# Use fancy interactive UI
anything-to-text . --fancy-ui
att . --fancy-ui

# Set custom output directory
anything-to-text . --output-dir ./my-bundles
att . --output-dir ./my-bundles

# Adjust max lines per bundle
anything-to-text . --max-lines 10000
att . --max-lines 10000

# Include secret files (use with caution)
anything-to-text . --include-secret-files
att . --include-secret-files

Python API

from pathlib import Path
from anything_to_text import CodeExporter, ExportConfig

# Simple export
exporter = CodeExporter()
result = exporter.export(
    project_root="/path/to/project",
    categories=["python", "typescript"],
    interactive=False,
    project_overview=True,
)

print(f"Created {result.bundles_created} bundles")
print(f"Exported {result.files_exported} files")
print(f"Output directory: {result.output_dir}")

# Or use configuration object
config = ExportConfig(
    project_root=Path("/path/to/project"),
    max_lines=10000,
    include_secret_files=False,
    categories=["python", "web_ui"],
    interactive=False,
)

exporter = CodeExporter(config)
result = exporter.export()

Output Files

After running, you'll get:

File Description
bundle_001.txt, bundle_002.txt, ... Text bundles containing your source code
MANIFEST.json Maps files to bundles and line ranges
README_EXPORT.txt Summary of the export
PROJECT_OVERVIEW.txt (Optional) Architecture overview

Categories

Category Description Extensions
python Python backend / scripts .py
typescript TypeScript / TSX .ts, .tsx
javascript JavaScript / JSX .js, .jsx, .mjs, .cjs
java_kotlin Android / JVM .java, .kt, .kts, .gradle
ios_apple iOS / Apple platform .swift, .m, .h, etc.
web_ui HTML / CSS / UI .html, .css, .scss, .vue, etc.
config_docs Config / metadata .json, .yaml, .xml, .toml, .md

Category Aliases

Alias Maps to
py python
ts, tsx typescript
js, jsx javascript
java, kotlin, android java_kotlin
ios, swift, apple ios_apple
web, frontend, ui web_ui
config, docs config_docs

Usage Examples

Export Python and TypeScript code for AI review

att /my-project --non-interactive --categories python typescript --project-overview

Export specific folders

att . --non-interactive --paths src/components src/utils

Full export with all features

att /path/to/project \
    --non-interactive \
    --categories python typescript web_ui \
    --max-lines 10000 \
    --project-overview \
    --output-dir ./ai-review-bundles

Interactive mode with fancy UI

att . --fancy-ui

Use with AI assistants

After running the exporter:

  1. Attach bundles: Upload bundle_001.txt (and others) to your AI assistant
  2. Include manifest: Upload MANIFEST.json so the assistant understands file mappings
  3. Add overview: Upload PROJECT_OVERVIEW.txt for architecture context
  4. Ask questions: The assistant can now reference exact file locations and line numbers

Security

By default, the following files are skipped to protect sensitive data:

  • .env files and variants (*.env.*)
  • Private keys (*.pem, *.key, id_rsa, id_ed25519)
  • Certificates (*.crt, *.cer, *.der)
  • Keystores (*.jks, *.keystore, *.p12, *.pfx)
  • Mobile provisioning (*.mobileprovision)
  • Firebase/Google config (google-services.json, GoogleService-Info.plist)

Use --include-secret-files to override this behavior (use with caution).

CLI Options

usage: anything-to-text [-h] [--max-lines MAX_LINES] [--output-dir OUTPUT_DIR]
                        [--non-interactive] [--categories [CATEGORIES ...]]
                        [--paths [PATHS ...]] [--include-secret-files]
                        [--fancy-ui] [--project-overview] [--version]
                        [project_root]

positional arguments:
  project_root          Project root to scan (default: current directory)

options:
  -h, --help            Show help message
  --version             Show version
  --max-lines N         Max lines per bundle (default: 8000)
  --output-dir DIR      Custom output directory
  --non-interactive     Run without prompts
  --categories CATS     Categories to export (e.g., python typescript)
  --paths PATHS         Specific files/folders to export
  --include-secret-files Include secret-like files
  --fancy-ui            Use checkbox-style interactive UI
  --project-overview    Generate PROJECT_OVERVIEW.txt

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

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

anything_to_text-0.3.2.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

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

anything_to_text-0.3.2-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file anything_to_text-0.3.2.tar.gz.

File metadata

  • Download URL: anything_to_text-0.3.2.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for anything_to_text-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c9bbbec8065a89012c63abcf2a3366b940345a047c8eb053f8aa4609a08db798
MD5 7241cfdf7511e32e2cdd05f0e9ae2da6
BLAKE2b-256 349bbef35e317d509972d1271a2d994e4ac999539ee34c9e00079ba25712baa5

See more details on using hashes here.

File details

Details for the file anything_to_text-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for anything_to_text-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c3554de0be74987e3587f3265b5815c6dd5897701f2a219f5e73f12d477a00d
MD5 60b18e4def32218d93f443777a4dc33e
BLAKE2b-256 3422bbeab4bef9b176e14562cfa1a196da029390bc0ece5ccf53b2ca8aa96ead

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