Hookcode PAT API Debug (Gemini)
Overview
Use the bundled Node.js script to call HookCode backend endpoints with Authorization: Bearer <PAT>.
Keep tokens out of logs and prefer .env or environment variables for secrets.
Quick Start
- Copy
.gemini/skills/hookcode-pat-api-debug/.env.exampleto.gemini/skills/hookcode-pat-api-debug/.envand fill in values. - Run a GET request:
node .gemini/skills/hookcode-pat-api-debug/scripts/pat_request.mjs --path /api/users/me
- Run a write request with JSON:
node .gemini/skills/hookcode-pat-api-debug/scripts/pat_request.mjs \
--method PATCH \
--path /api/users/me \
--body '{"displayName":"Debug Name"}'
CLI Options
--path /api/...Required unless--urlis provided.--url https://host/api/...Full URL override.--method GET|POST|PATCH|PUT|DELETEDefaults toGETorPOSTwhen--bodyis set.--body '{"key":"value"}'Send a request body; prefix with@to read from file.--rawSend body as plain text instead of parsing JSON.--query key=valueRepeat to append query params.--header 'Name: Value'Repeat to add extra headers.--dry-runPrint the request without sending it; PAT is redacted.
Notes
- The script reads
.envfrom the skill root, then falls back to process env. - Required vars:
HOOKCODE_API_BASE_URL,HOOKCODE_PAT. - If a local request fails with
fetch failed, verify the backend is reachable and your execution environment allows local network access. - Avoid copying PATs into chat or logs; rotate tokens after debugging if needed.
Resources
scripts/pat_request.mjs.env.example
Converted and distributed by TomeVault — claim your Tome and manage your conversions.