├── LICENSE ├── README.md └── search.cmd /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 ScriptTiger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://docs.google.com/forms/d/e/1FAIpQLSfBEe5B_zo69OBk19l3hzvBmz3cOV6ol1ufjh0ER1q3-xd2Rg/viewform) 2 | 3 | # Repo Search 4 | Tool to instantly search all or specific files in any repo for keywords or phrases natively on Windows extremely easily, with an option to output results to a file. 5 | 6 | This script is nice for programmers trying to find all the references to something quickly. If you're a gamer, however, and play any open-source games, this script is even nicer when used to transform the source code of your open source game into a complete offline knowledgebase or even Easter egg hunting engine. 7 | 8 | You can easily make a shortcut to search a specific repo with one click by sending the root and files to search as parameters in a short one-line script: 9 | @search.cmd "c:\blah\blah\myrepo" "*.txt *.c *.h" 10 | 11 | You can download this repo from the below link to get started: 12 | https://github.com/ScriptTiger/Repo-Search/archive/master.zip 13 | 14 | # More About ScriptTiger 15 | 16 | For more ScriptTiger scripts and goodies, check out ScriptTiger's GitHub Pages website: 17 | https://scripttiger.github.io/ 18 | -------------------------------------------------------------------------------- /search.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ===== 4 | rem For more information on ScriptTiger and more ScriptTiger scripts visit the following URL: 5 | rem https://scripttiger.github.io/ 6 | rem Or visit the following URL for the latest information on this ScriptTiger script: 7 | rem https://github.com/ScriptTiger/Repo-Search 8 | rem ===== 9 | 10 | rem ===== 11 | rem Remember current directory for file output 12 | rem ===== 13 | 14 | set DIR=%~dp0 15 | 16 | rem ===== 17 | rem Change the current directory to the source directory to search 18 | rem ===== 19 | 20 | if "%~1"=="" ( 21 | set /p INPUT=Root directory to search? 22 | ) else ( 23 | set INPUT=%~1) 24 | cd "%INPUT%" 25 | 26 | rem ===== 27 | rem File types to search for 28 | rem ===== 29 | 30 | if "%~2"=="" ( 31 | set /p TYPES=Search which source files ^(i.e. "*.txt *.md" to search all txt and md files^)? 32 | ) else ( 33 | set TYPES=%~2) 34 | 35 | rem ===== 36 | rem Begin main script 37 | rem ===== 38 | 39 | :0 40 | 41 | rem ===== 42 | rem Set options for search and execute 43 | rem ===== 44 | 45 | choice /m "Use regular expressions?" 46 | if %ERRORLEVEL%==1 (set FIND=findstr /r /s /i ) else (set FIND=findstr /s /i /c:) 47 | set /p INPUT=Search for: || exit /b 48 | set FIND=%FIND%"%INPUT%" %TYPES%^|more 49 | %FIND% 50 | 51 | rem ===== 52 | rem Give option to output search results to a file in the current directory 53 | rem ===== 54 | 55 | choice /m "Output results to file?" 56 | if %ERRORLEVEL%==1 ( 57 | set /p INPUT=Name of file to export results to? && %FIND%>"%DIR%%INPUT%.txt" 58 | ) 59 | 60 | rem ===== 61 | rem Give option to open any source files of interest 62 | rem ===== 63 | 64 | :1 65 | set /P INPUT=Open file: || goto 0 66 | write "%INPUT%" 67 | goto 1 --------------------------------------------------------------------------------