{"id":47516097,"url":"https://github.com/vaibhav-mattoo/cxt","last_synced_at":"2026-04-01T07:00:38.682Z","repository":{"id":302580666,"uuid":"1012790471","full_name":"vaibhav-mattoo/cxt","owner":"vaibhav-mattoo","description":"Command-line tool written in Rust to extract and aggregate project context to clipboard for AI chatbots like ChatGPT or Perplexity 🚀","archived":false,"fork":false,"pushed_at":"2025-08-12T01:33:17.000Z","size":17183,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T03:25:01.818Z","etag":null,"topics":["ai","ai-assistant","best","chatgpt","code-sharing","developer-experience","developer-productivity","developer-tools","file-aggregation","perplexity","productivity","rust","simple","terminal","tui"],"latest_commit_sha":null,"homepage":"https://github.com/vaibhav-mattoo/cxt","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaibhav-mattoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-02T22:20:10.000Z","updated_at":"2025-08-24T14:23:31.000Z","dependencies_parsed_at":"2025-07-26T06:07:25.346Z","dependency_job_id":"3d72200b-bb27-4f29-9a79-89b8bda6c4e2","html_url":"https://github.com/vaibhav-mattoo/cxt","commit_stats":null,"previous_names":["vaibhav-mattoo/cxt"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vaibhav-mattoo/cxt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhav-mattoo%2Fcxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhav-mattoo%2Fcxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhav-mattoo%2Fcxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhav-mattoo%2Fcxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaibhav-mattoo","download_url":"https://codeload.github.com/vaibhav-mattoo/cxt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhav-mattoo%2Fcxt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31269174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T06:57:45.811Z","status":"ssl_error","status_checked_at":"2026-04-01T06:57:42.389Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-assistant","best","chatgpt","code-sharing","developer-experience","developer-productivity","developer-tools","file-aggregation","perplexity","productivity","rust","simple","terminal","tui"],"created_at":"2026-03-27T13:00:30.243Z","updated_at":"2026-04-01T07:00:38.676Z","avatar_url":"https://github.com/vaibhav-mattoo.png","language":"Rust","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT"],"sub_categories":[],"readme":"# cxt - Context Extractor\n\n[![Crates.io](https://img.shields.io/crates/v/cxt)](https://crates.io/crates/cxt)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Homebrew Tap](https://img.shields.io/badge/homebrew--tap-v0.1.3-blue?logo=homebrew)](https://github.com/vaibhav-mattoo/homebrew-cxt)\n[![AUR version](https://img.shields.io/aur/version/cxt?logo=arch-linux)](https://aur.archlinux.org/packages/cxt)\n[![Last Commit](https://img.shields.io/github/last-commit/vaibhav-mattoo/cxt)](https://github.com/vaibhav-mattoo/cxt/commits)\n\nA command-line tool that aggregates file and directory contents into your clipboard, perfect for providing project context to AI chatbots in your browser like ChatGPT, Perplexity etc.\n\n## Showcase\n\n\n\n\nhttps://github.com/user-attachments/assets/18fa3c3c-0d87-442e-bb30-cbfe36e0e116\n\n\n\n\n\n*Watch the demo to see `cxt` in action - interactive file selection and clipboard aggregation*\n\n## Use Case\n\nWhen you're working in the terminal and need to quickly share your project's code structure and contents with an AI assistant, `cxt` makes it effortless. Instead of manually copying files one by one, you can select multiple files and directories, and `cxt` will aggregate all their contents with clear path headers, giving the AI full context of your project structure.\n\n## Installation\n\n### Universal Install Script\n\nThe easiest way to install `cxt` on any system:\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/cxt/main/install.sh | sh\n```\n\nThis script will automatically detect your system and install the appropriate binary.\n\nRemember to add `~/.local/bin` to your `$PATH` if prompted by the install script, by adding `export PATH=\"$HOME/.local/bin:$PATH\"` in the end of your shell config(~/.bashrc, ~/.zshrc etc).\n\n### From Cargo\n\n```bash\ncargo install cxt\n```\n\n### Using homebrew\n\nYou can install `cxt` through brew on Linux or macOS by:\n\n```bash\nbrew tap vaibhav-mattoo/cxt\nbrew install cxt\n```\n\n### On Arch Linux (AUR)\n\nYou can install `cxt` directly from the AUR:\n\n```bash\nyay -S cxt\n# or\nparu -S cxt\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/vaibhav-mattoo/cxt.git\ncd cxt\ncargo install --path .\n```\n\n## Quick Start\n\n### Interactive Mode\nLaunch the interactive file selector:\n\n```bash\ncxt\n# or\ncxt --tui\n```\n\nNavigate with arrow keys or `hjkl`, select files/directories with `Space`, and confirm with `c`.\n\n### Command Line Mode\nWildcard functionality is now supported! You can use patterns like \"*.py\" or \"src/**/*.rs\".\n\nCopy specific files to clipboard:\n\n```bash\ncxt file1.txt file2.py src/\n```\n\n## Usage Examples\n\n### Basic Usage\n\n```bash\n# Copy a single file to clipboard\ncxt main.rs\n\n# Copy multiple files and directories\ncxt src/ tests/ README.md Cargo.toml\n\n# Print to stdout and copy to clipboard\ncxt -p src/\n\n# Write to a file and copy to clipboard\ncxt -w output.txt src/\n```\n\n### Path Formatting Options\n\n```bash\n# Use relative paths in headers\ncxt -r src/\n\n# Disable path headers entirely\ncxt -n src/\n\n# Include hidden files when walking directories\ncxt --hidden src/\n```\n\n### Combining Options\n\n```bash\n# Print to stdout with relative paths and copy to clipboard\ncxt -p -r src/ tests/\n\n# Write to file with no path headers\ncxt -w output.txt -n src/\n\n# Ignore a directory while copying a project\ncxt -i bin src/\n```\n\n## Interactive TUI Mode\n\nThe Terminal User Interface (TUI) provides an intuitive way to browse and select files:\n\n### Navigation\n- **Arrow keys** or **hjkl**: Move cursor\n- **Space**: Select/unselect file or directory\n- **Enter** or **l** or **→**: Open directory\n- **Backspace** or **h** or **←**: Go to parent directory\n- **c**: Confirm selection and exit\n- **q/Ctrl-c**: Quit without selection\n\n### Search Mode\n- **/** (forward slash): Enter search mode to find files across the current directory and subdirectories\n- **Esc**: Exit search mode and return to normal navigation\n- **Enter/Arrow keys**: Switch between search input and result navigation\n- **Real-time filtering**: Results update as you type, showing partial matches\n- **Smart sorting**: Directories first, then by shortest match length\n- **Preserved state**: Search query and results persist when navigating between directories\n\n### TUI Features\n- **Visual selection**: Selected items are highlighted\n- **Directory expansion**: Selecting a directory includes all files within it\n- **Path toggles**: Press `r` to toggle relative paths, `n` to toggle no path headers\n\n## Command Line Options\n\n### Output Options\n- `-p, --print`: Print content to stdout (also copies to clipboard)\n- `-w, --write \u003cFILE\u003e`: Write content to specified file\n- `-t, --tui`: Launch interactive TUI file selector\n\n### Path Formatting\n- `-r, --relative`: Use relative paths in headers\n- `-n, --no-path`: Disable file path headers\n- `--hidden`: Include hidden files when walking directories\n- `-i, --ignore \u003cPATH\u003e`: Ignore a file or directory (only one allowed)\n\n### Examples\n\n```bash\n# Interactive selection\ncxt --tui\n\n# Print with relative paths\ncxt -p -r src/\n\n# Write to file, no path headers\ncxt -w context.txt -n src/ tests/\n\n# Include hidden files\ncxt --hidden src/\n```\n\n## Output Format\n\nBy default, `cxt` adds path headers to distinguish between files:\n\n```\n--- File: /path/to/file1.txt ---\nContent of file1.txt\n\n--- File: /path/to/file2.py ---\nContent of file2.py\n```\n\nWith `--relative`, paths are shown relative to current directory:\n\n```\n--- File: file1.txt ---\nContent of file1.txt\n\n--- File: src/file2.py ---\nContent of file2.py\n```\n\nWith `--no-path`, only raw content is included:\n\n```\nContent of file1.txt\nContent of file2.py\n```\n\n## Use Cases\n\nPerfect for providing project context to AI assistants and sharing code snippets with colleagues:\n\n```bash\n# Quick project overview\ncxt --tui\n\n# Specific files for debugging\ncxt -r main.rs error.log\n\n# Full project structure\ncxt -r src/ tests/ README.md\n```\n\n## License\n\nMIT License - see LICENSE file for details. \n\n## Uninstall\n\nTo uninstall `cxt`, you can run the command:\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/vaibhav-mattoo/cxt/main/uninstall.sh | sh\n```\n\nIf you installed the software using a package manager, remove it using the package manager's uninstall command.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhav-mattoo%2Fcxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaibhav-mattoo%2Fcxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhav-mattoo%2Fcxt/lists"}