Skip to main content

A tool to print git repository files with tree structure

Project description

ctxify 🎉

Turn Your Git Repo into a Clipboard-Ready Context Machine

Built mostly with the help of xAI's Grok model—AI-powered coding at its finest!

GitHub release (latest by date) Code Checks License

ctxify is a sleek CLI tool that grabs all tracked files in your Git repository, builds a neat tree structure, and copies everything—code and all—to your clipboard with a single command. Perfect for sharing project context, debugging, or feeding your code straight into AI assistants. It even gives you an approximate token count for fun! 🚀


Why ctxify?

Ever wanted to:

  • Share your project structure and code in one go?
  • Hand-pick files interactively with tab autocompletion?
  • Skip the hassle of manually copying files?
  • Get just the structure without the contents?
  • Know how many tokens your project weighs in at?

ctxify does it all. It's lightweight, fast, and skips the fluff (like lock files or .gitignore). Built with Python 3.13 and Git magic. ✨


Features

  • 📂 Git-Powered Tree View: Prints a gorgeous file tree of tracked files.
  • 📋 Clipboard Ready: Copies the tree and file contents instantly.
  • 🚫 Smart Filtering: Ignores non-code files (e.g., uv.lock, .txt) by default.
  • 📝 Markdown Support: Optionally include .md files with a flag.
  • 🎮 Interactive Mode: Pick files with fuzzy tab autocompletion.
  • 🌳 Structure-Only Mode: Output just the tree, no contents.
  • 📏 Token Count: Estimates tokens (1 token ≈ 4 chars) for the full output.

Installation

Install ctxify from PyPI:

  • With pipx (recommended for isolated CLI tools):

    pipx install ctxify
    
  • With uv (fast and modern Python tool management):

    uv tool install ctxify
    

Optional (for clipboard support)

On Linux, install xclip:

sudo apt install xclip

On macOS, clipboard support is built-in (uses pbcopy), so no additional installation is needed.


Usage

Run it from your Git repo's root:

ctxify

Options

  • --md / -md: Include .md files (e.g., README.md).
    ctxify --md
    
  • -i / --interactive: Select files interactively with tab autocompletion.
    ctxify -i
    
  • -s / --structure: Output only the project structure, no contents.
    ctxify -s
    

Example Output

Files Included in Context (from .):
├── .python-version
└── src
    └── ctxify
        ├── __init__.py
        ├── cli.py
        └── main.py

Approximate token count: 512 (based on 1 token ≈ 4 chars)

The clipboard gets the tree plus file contents (unless using -s)—ready to paste anywhere!


Contributing

Love ctxify? Want to make it better?

  • Fork it.
  • Submit a PR.
  • Open an issue with ideas or bugs.

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

ctxify-0.1.7.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

ctxify-0.1.7-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ctxify-0.1.7.tar.gz.

File metadata

  • Download URL: ctxify-0.1.7.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ctxify-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7ba101dbe6254920c8159a3d45b72ef7c2e2df17ca534d82aef8b0f5c24bacfe
MD5 90bfb57b2aaefa2e9aec210e3ab1efe7
BLAKE2b-256 90c8a4ec5c5fc03c3430c8ffa3df1df117d6b5b15c62695a8a851cf4d407c703

See more details on using hashes here.

File details

Details for the file ctxify-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ctxify-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ctxify-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ecc7cd8c0cf26350c9f30e3d31320a6cf4ddb36a71c59ea1d32f15019af96cbb
MD5 6bcfeec61b68ea42a6f14b00fa9c92ab
BLAKE2b-256 d77f1a7b27d8e94ec2fabfd557931e0a9aba849fa46a904f8eb0771b8c36e761

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