OpenParable
Skip to content
← Back to skills

Ghq Lookup

Research
ghq-lookup

Ghq Lookup is an Agent Skill for research published in the terlar/nix-config repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use when you need to read, explore, or reference source code from any Git repository. Use before cloning manually or asking the user for a path.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/terlar/nix-config/blob/HEAD/modules/home/profiles/user/terje/programs/opencode/skills/ghq-lookup/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ghq-lookup, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

ghq Lookup

ghq manages remote repository clones under a single root, organized as <root>/<host>/<org>/<repo>. Use it to find and fetch source code instead of cloning manually.

When to Use

  • You need to read or explore source code of a dependency, library, or tool
  • The user references a repo by org/name without providing a path
  • You need the local path to an already-cloned repo
  • Do not use ghq for repos that must live at a specific non-ghq path

Procedure

  1. Check first: ghq list -p <query> — partial match, prints full paths. Use that path directly if found.
  2. Fetch if missing:
    ghq get <host>/<org>/<repo>       # e.g. ghq get github.com/org/repo
    ghq get <org>/<repo>              # defaults to github.com
    ghq get -p <org>/<repo>           # clone via SSH
    ghq get --shallow <org>/<repo>    # shallow clone for large repos
    
    Then use ghq list -p <query> to get the full path.

Quick Reference

TaskCommand
Check if repo exists / get pathghq list -p <query>
Fetch a repoghq get <host>/<org>/<repo>
Fetch via SSHghq get -p <org>/<repo>
Shallow cloneghq get --shallow <org>/<repo>
Update existing repoghq get -u <org>/<repo>