{"id":27801,"library":"gh-search","title":"gh-search","description":"A command-line tool for searching GitHub repositories, code, issues, and more. Current version 0.9.2, requires Python >=3.12. Released sporadically; latest updates focus on maintenance and bug fixes.","status":"active","version":"0.9.2","language":"python","source_language":"en","source_url":"https://github.com/janeklb/gh-search","tags":["github","search","cli","tool"],"install":[{"cmd":"pip install gh-search","lang":"bash","label":"stable"}],"dependencies":[],"imports":[{"note":"gh-search is a CLI tool; the main entry point is the __main__ module. Importing from subpackages is not intended.","symbol":"gh_search","correct":"from gh_search import main"}],"quickstart":{"code":"import os\nimport subprocess\n\n# Ensure GITHUB_TOKEN env var is set (optional for unauthenticated)\nos.environ.setdefault('GITHUB_TOKEN', '')\n\n# Example: search for code containing 'def foo' in Python repos\nresult = subprocess.run([\"gh-search\", \"code\", \"def foo\", \"--language\", \"python\"], capture_output=True, text=True)\nprint(result.stdout)","lang":"python","description":"Run a GitHub code search via the CLI using subprocess. For direct Python usage, invoke the module with sys.argv."},"warnings":[{"fix":"Upgrade Python to >=3.12 or use gh-search <0.9.0 (which supports Python 3.7–3.11).","message":"Python 3.12+ only. Installing on older Python versions will fail.","severity":"breaking","affected_versions":"0.9.0+"},{"fix":"Set environment variable GITHUB_TOKEN to a token with appropriate scopes, or use the --token option.","message":"The tool requires a valid GitHub Personal Access Token for all operations except public searches (rate-limited). Environment variable GITHUB_TOKEN must be set.","severity":"gotcha","affected_versions":"all"},{"fix":"Use --query or --AND instead. See documentation for new search syntax.","message":"The --content-filter and --regex-content-filter options are deprecated as of 0.9.0.","severity":"deprecated","affected_versions":"0.9.0+"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use subprocess.run(['gh-search', ...]) in Python, or run directly from command line.","cause":"Trying to import gh_search as a Python module in code, but it is a CLI tool meant to be run as a script.","error":"ModuleNotFoundError: No module named 'gh_search'"},{"fix":"Run 'gh-search --version' from command line, or check metadata from pip show gh-search.","cause":"The gh_search module does not export __version__; version info is only accessible via --version flag.","error":"AttributeError: module 'gh_search' has no attribute '__version__'"},{"fix":"Set GITHUB_TOKEN environment variable with a valid GitHub personal access token.","cause":"No GITHUB_TOKEN set and rate limit exceeded for unauthenticated requests.","error":"TypeError: 'NoneType' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}