Skip to content
/ ctxify Public

ctxify: CLI tool to copy repo context to your clipboard for LLMs ๐Ÿค–

License

Notifications You must be signed in to change notification settings

MQ37/ctxify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ctxify ๐ŸŽ‰

Turn Your Git Repo into a Clipboard-Ready Context Machine

Vibe coded using xAI's based Grok model

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 Modes:
    • Selection Mode: Pick files with fuzzy tab autocompletion.
    • Exclusion Mode: Exclude files or directories interactively.
  • ๐ŸŒณ 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
  • -e / --exclude: Exclude files or directories interactively with tab autocompletion.
    ctxify -e
  • -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.

About

ctxify: CLI tool to copy repo context to your clipboard for LLMs ๐Ÿค–

Resources

License

Stars

Watchers

Forks

Packages

No packages published