
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@johnlindquist/ghx
Advanced tools
A CLI tool for searching GitHub code and viewing results in your editor.
This tool requires the GitHub CLI (gh
) to be:
Without these requirements, the tool will fail to work due to GitHub API rate limiting.
Install GitHub CLI:
brew install gh
Authenticate with GitHub:
gh auth login
Follow the prompts to complete authentication.
Install ghx:
pnpm add -g @johnlindquist/ghx
ghx "your search query" [options]
--pipe
- Output results directly to stdout--debug
- Output code fence contents for testing--limit, -L <n>
- Maximum number of results to fetch (default: 50)--context, -c <n>
- Number of context lines around matches (default: 20)--max-filename, -f <n>
- Maximum length of generated filenames (default: 50)You can use either CLI flags or GitHub's search qualifiers:
CLI Flags:
--filename <name>
- Search in files with a specific name--extension <ext>
- Search files with specific extension--language <lang>
- Search in a specific programming language--repo <owner/repo>
- Search in a specific repository--path <path>
- Search in a specific file path--size <n>
- Files that are n bytes in size--fork
- Include or exclude forked repositoriesExamples:
# Search for TypeScript config files
ghx --filename tsconfig.json "strict"
# Find React components
ghx --language typescript --extension tsx "useState"
# Search in specific repo
ghx --repo facebook/react "useState"
# Search and pipe results to stdout
ghx --pipe --filename tsconfig.json "strict"
# Pipe results to a file
ghx --pipe --language typescript "useState" > results.md
# Get more results
ghx --limit 100 --filename package.json "dependencies"
# Show more context around matches
ghx --context 50 --language typescript "useState"
# Allow longer filenames
ghx --max-filename 100 --filename package.json "devDependencies"
# Combine options
ghx -L 100 -c 30 -f 75 --repo facebook/react "hooks"
Results are saved as markdown files in your system's config directory:
~/Library/Preferences/johnlindquist/ghx-nodejs/searches/
~/.config/johnlindquist/ghx-nodejs/searches/
%APPDATA%/johnlindquist/ghx-nodejs/searches/
On first run, ghx will prompt you to:
You can change these settings by editing the config file in:
~/Library/Preferences/johnlindquist/ghx-nodejs/config.json
~/.config/johnlindquist/ghx-nodejs/config.json
%APPDATA%/johnlindquist/ghx-nodejs/config.json
If you get authentication errors:
gh --version
gh auth status
gh auth login
# Clone the repo
git clone https://github.com/johnlindquist/ghx.git
# Install dependencies
pnpm install
# Run in development
pnpm dev
# Build
pnpm build
ISC
FAQs
GitHub search and examples CLI tool
We found that @johnlindquist/ghx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.