$git clone https://github.com/yigitkonur/cli-repo-to-prompt> Gather project context for LLMs — intelligently scan repositories and format for AI consumption.
| 1 | # cli-repo-to-prompt |
| 2 | |
| 3 | > Gather project context for LLMs — intelligently scan repositories and format for AI consumption. |
| 4 | |
| 5 | [](https://www.npmjs.com/package/@yigitkonur/cli-repo-to-prompt) |
| 6 | [](https://opensource.org/licenses/MIT) |
| 7 | |
| 8 | ## Why? |
| 9 | |
| 10 | When working with AI coding assistants, you often need to share your project's context. Manually copying files is tedious and error-prone. **cli-repo-to-prompt** intelligently scans your codebase, respects `.gitignore`, filters out noise, and formats everything into clean Markdown ready for LLMs. |
| 11 | |
| 12 | ## Features |
| 13 | |
| 14 | - 📁 **Smart Scanning** — Respects `.gitignore`, skips binaries, build artifacts, and node_modules |
| 15 | - 🐙 **GitHub Support** — Clone and scan any public repository directly |
| 16 | - 📋 **Clipboard Ready** — Copies to clipboard by default, ready to paste |
| 17 | - 🌲 **Tree Visualization** — Beautiful project structure display |
| 18 | - 🔍 **Tech Detection** — Automatically detects your stack |
| 19 | - ⚡ **Fast** — Built on native ESM with fast-glob |
| 20 | |
| 21 | ## Installation |
| 22 | |
| 23 | ```bash |
| 24 | # Run instantly with npx (no install) |
| 25 | npx @yigitkonur/cli-repo-to-prompt |
| 26 | |
| 27 | # Or install globally |
| 28 | pnpm add -g @yigitkonur/cli-repo-to-prompt |
| 29 | ``` |
| 30 | |
| 31 | After global install, use any of these aliases: |
| 32 | ```bash |
| 33 | cli-repo-to-prompt . |
| 34 | repo-to-prompt . |
| 35 | context . |
| 36 | llmcontext . |
| 37 | repocp . |
| 38 | ``` |
| 39 | |
| 40 | ## Quick Start |
| 41 | |
| 42 | ```bash |
| 43 | # Scan current directory → clipboard |
| 44 | npx @yigitkonur/cli-repo-to-prompt |
| 45 | |
| 46 | # Scan specific folder |
| 47 | npx @yigitkonur/cli-repo-to-prompt ./src |
| 48 | |
| 49 | # Scan GitHub repo |
| 50 | npx @yigitkonur/cli-repo-to-prompt owner/repo |
| 51 | |
| 52 | # Write to file |
| 53 | npx @yigitkonur/cli-repo-to-prompt -o context.md |
| 54 | |
| 55 | # Preview what will be included |
| 56 | npx @yigitkonur/cli-repo-to-prompt --preview |
| 57 | ``` |
| 58 | |
| 59 | ## Usage Examples |
| 60 | |
| 61 | ### Basic |
| 62 | |
| 63 | ```bash |
| 64 | # Current directory to clipboard |
| 65 | cli-repo-to-prompt |
| 66 | |
| 67 | # Specific directory |
| 68 | cli-repo-to-prompt ./backend |
| 69 | |
| 70 | # Output to file |
| 71 | cli-repo-to-prompt -o output.md |
| 72 | |
| 73 | # Print to stdout |
| 74 | cli-repo-to-prompt --stdout |
| 75 | ``` |
| 76 | |
| 77 | ### GitHub Repositories |
| 78 | |
| 79 | ```bash |
| 80 | # Clone and scan |
| 81 | cli-repo-to-prompt facebook/react |
| 82 | |
| 83 | # Specific branch |
| 84 | cli-repo-to-prompt vercel/next.js@canary |
| 85 | |
| 86 | # Full URL |
| 87 | cli-repo-to-prompt https://github.com/microsoft/typescript |
| 88 | ``` |
| 89 | |
| 90 | ### Filtering |
| 91 | |
| 92 | ```bash |
| 93 | # Include only Python files |
| 94 | cli-repo-to-prompt --include "*.py" --include-only |
| 95 | |
| 96 | # Exclude test files |
| 97 | cli-repo-to-prompt --exclude "*.test.ts" --exclude "*.spec.ts" |
| 98 | |
| 99 | # Include data files (off by default) |
| 100 | cli-repo-to-prompt --include-json --include-yaml --include-markdown |
| 101 | |
| 102 | # Limit depth |
| 103 | cli-repo-to-prompt --max-depth 3 |
| 104 | ``` |
| 105 | |
| 106 | ### Output Control |
| 107 | |
| 108 | ```bash |
| 109 | # Preview files (no content) |
| 110 | cli-repo-to-prompt --preview |
| 111 | |
| 112 | # Dry run (stats only) |
| 113 | cli-repo-to-prompt --dry-run |
| 114 | |
| 115 | # JSON format |
| 116 | cli-repo-to-prompt --format json |
| 117 | |
| 118 | # Show stats with output |
| 119 | cli-repo-to-prompt --show-stats |
| 120 | ``` |
| 121 | |
| 122 | ## Options |
| 123 | |
| 124 | ### Output |
| 125 | | Option | Description | |
| 126 | |--------|-------------| |
| 127 | | `-o, --output <file>` | Write to file | |
| 128 | | `--stdout` | Print to stdout | |
| 129 | | `--no-clipboard` | Don't copy to clipboard | |
| 130 | | `--format <type>` | `markdown` (default) or `json` | |
| 131 | |
| 132 | ### Filtering |
| 133 | | Option | Description | |
| 134 | |--------|-------------| |
| 135 | | `--include <pattern>` | Include glob pattern | |
| 136 | | `--exclude <pattern>` | Exclude glob pattern | |
| 137 | | `--include-only` | Only include matching patterns | |
| 138 | | `--max-size <size>` | Max file size (default: `2M`) | |
| 139 | | `--max-depth <n>` | Max directory depth | |
| 140 | | `--include-binary` | Include binary files | |
| 141 | |
| 142 | ### File Types |
| 143 | | Option | Description | |
| 144 | |--------|-------------| |
| 145 | | `--include-json` | Include JSON files | |
| 146 | | `--include-yaml` | Include YAML/YML files | |
| 147 | | `--include-markdown` | Include Markdown files | |
| 148 | | `--include-html` | Include HTML files | |
| 149 | | `--include-css` | Include CSS files | |
| 150 | | `--include-sql` | Include SQL files | |
| 151 | | `--include-csv` | Include CSV files | |
| 152 | | `--include-xml` | Include XML files | |
| 153 | |
| 154 | ### Git |
| 155 | | Option | Description | |
| 156 | |--------|-------------| |
| 157 | | `--no-gitignore` | Ignore .gitignore | |
| 158 | | `--use-git` | Only inc |