$git clone https://github.com/alexferrari88/prompt-scannerEffortlessly find LLM prompts in any codebase—no more hunting for the AI’s “needle in the haystack.”
| 1 | # prompt-scanner 🔎 |
| 2 | |
| 3 | **Effortlessly find LLM prompts in any codebase—no more hunting for the AI’s “needle in the haystack.”** |
| 4 | |
| 5 | `prompt-scanner` is a blazing-fast™, language-aware CLI tool that **automatically surfaces natural-language prompts for LLMs**—even when they’re deeply buried in code, templates, or config files. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Why Use prompt-scanner? |
| 10 | |
| 11 | Modern AI codebases bury prompts in variables, templates, and configs. Manual searching is tedious and unreliable. `prompt-scanner` recursively scans your project to **instantly surface potential prompts**, regardless of where they hide. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Key Features |
| 16 | |
| 17 | * **Language-aware Scanning:** Supports Go (native AST), Python, JavaScript/TypeScript (Tree-sitter), plus config files (JSON, YAML, TOML, `.env`). |
| 18 | * **Configurable Heuristics:** Fine-tune how “strict” or “greedy” detection is, set minimum string length, and customize keyword matching. |
| 19 | * **GitHub Repo Scanning:** Provide a repo URL—`prompt-scanner` clones and scans it automatically. |
| 20 | * **Smart Output:** Display as tabular or JSON, optionally include/exclude file paths and line numbers. |
| 21 | * **.gitignore Respect:** Optionally skip files/directories matched by `.gitignore`. |
| 22 | * **Performance:** Multi-threaded, skips common non-source directories. |
| 23 | * **Verbose Mode:** See detailed logs for debugging and transparency. |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | ## Installation |
| 28 | |
| 29 | Install the latest `prompt-scanner` CLI via Go: |
| 30 | |
| 31 | ```sh |
| 32 | go install github.com/alexferrari88/prompt-scanner@latest |
| 33 | ``` |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## Downloading Prebuilt Binaries |
| 38 | |
| 39 | Prebuilt executables for **macOS (x64/arm64)** and **Linux (x64)** are available on the [Releases page](https://github.com/alexferrari88/prompt-scanner/releases). |
| 40 | |
| 41 | > **Note:** Windows and Linux on ARM64 binaries are not yet provided. If you’re proficient with GitHub Actions and would like to help add these targets, please propose changes to the [release workflow](https://github.com/alexferrari88/prompt-scanner/blob/main/.github/workflows/release.yml) and open a pull request. |
| 42 | |
| 43 | ### Adding the Binary to Your PATH |
| 44 | |
| 45 | Once downloaded, you can place the executable in a directory that’s included in your system’s `PATH` so you can run `prompt-scanner` from anywhere. |
| 46 | |
| 47 | * **Linux & macOS** |
| 48 | |
| 49 | 1. Unpack the archive if necessary (e.g., `tar xzf prompt-scanner_<version>_$(uname | tr '[:upper:]' '[:lower:]')_amd64.tar.gz`). |
| 50 | 2. Move the binary to `/usr/local/bin` (or another directory in your `PATH`): |
| 51 | |
| 52 | ```sh |
| 53 | sudo mv prompt-scanner /usr/local/bin/ |
| 54 | ``` |
| 55 | 3. Ensure `/usr/local/bin` is in your `PATH`: |
| 56 | |
| 57 | ```sh |
| 58 | echo $PATH |
| 59 | ``` |
| 60 | |
| 61 | * **Windows** |
| 62 | |
| 63 | 1. Download and unzip the `.zip` file. |
| 64 | 2. Copy `prompt-scanner.exe` into a directory on your `PATH`, for example: |
| 65 | |
| 66 | * `C:\\Windows\\System32` |
| 67 | * Or create a dedicated tools folder (e.g., `C:\\Tools\\prompt-scanner`) and add it via **System Properties → Environment Variables → Path → Edit**. |
| 68 | |
| 69 | After adding to your `PATH`, open a new terminal or PowerShell window and verify: |
| 70 | |
| 71 | ```sh |
| 72 | prompt-scanner --help |
| 73 | ``` |
| 74 | |
| 75 | --- |
| 76 | |
| 77 | ## Usage |
| 78 | |
| 79 | ```sh |
| 80 | prompt-scanner [options] <local_path_or_github_url> |
| 81 | ``` |
| 82 | |
| 83 | ### Common Options |
| 84 | |
| 85 | * `--json` — Output in JSON format |
| 86 | * `--scan-configs` — Also scan config files (JSON, YAML, TOML, `.env`) |
| 87 | * `--min-len=N` — Minimum prompt string length (default: 30) |
| 88 | * `--var-keywords=...` — Comma-separated variable/key names for prompt detection |
| 89 | * `--content-keywords=...` — Comma-separated keywords to match in content |
| 90 | * `--placeholder-patterns=...` — Comma-separated regexes to detect template placeholders |
| 91 | * `--greedy` — Use more aggressive detection (catches more, more noise) |
| 92 | * `--no-filepath` — Omit file paths in output |
| 93 | * `--no-linenumber` — Omit line numbers in output |
| 94 | * `--use-gitignore` — Respect `.gitignore` (skip matching files/dirs) |
| 95 | * `--verbose` — Print verbose log output to stderr |
| 96 | |
| 97 | ### Example |
| 98 | |
| 99 | ```sh |
| 100 | prompt-scanner --json --scan-configs --greedy ./llm-project |
| 101 | prompt-scanner --scan-configs --use-gitignore --min-len=50 https://github.com/user/repo |
| 102 | ``` |
| 103 | |
| 104 | --- |
| 105 | |
| 106 | ## Sample Output |
| 107 | |
| 108 | **Tex |