Skip to main content

Automation Patterns

Gitquarry works well in automation when you treat output and state explicitly.

Pattern: JSON To jq

gitquarry search "rust cli" --format json | jq '.items[].full_name'

Pattern: Compact JSON For Logs

gitquarry search "release automation" --mode discover --format compact --progress off

Pattern: CSV Export

gitquarry search "vector database" --format csv > repos.csv

Pattern: Stateless Env-Token Execution

GITQUARRY_TOKEN="$GITHUB_TOKEN" \
gitquarry inspect rust-lang/rust --format json

Pattern: Isolated Config State

GITQUARRY_CONFIG_DIR="$(mktemp -d)" \
GITQUARRY_ALLOW_INSECURE_STORAGE=1 \
printf '%s' "$GITHUB_TOKEN" | gitquarry auth login --token-stdin
Use this for tests and ephemeral agent runs.

Pattern: Enterprise Host Automation

GITQUARRY_TOKEN_GHE_EXAMPLE_COM="$GITHUB_TOKEN" \
gitquarry --host https://ghe.example.com search "internal platform" --format compact
gitquarry search "rust cli" \
  --mode discover \
  --rank blended \
  --progress off \
  --format compact

What To Avoid

  • parsing pretty output in scripts
  • assuming progress or errors will appear on stdout
  • relying on global persistent config during CI
  • silently turning on discover behavior in wrappers without showing it