{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "sinholms-setup-gateway--roll-back-broken-tool-config",
 "repo": "Sinholms/setup-gateway",
 "repo_url": "https://github.com/Sinholms/setup-gateway",
 "repo_slug": "sinholms-setup-gateway",
 "title": "Restore the last working config after a bad gateway change",
 "page_title": "How to restore the last working config after a bad gateway change with Setup Gateway",
 "summary": "Bring back the most recent backup of Claude Code, OpenCode, or Codex config with one command.",
 "who": "A developer whose AI coding tool stopped working after a gateway, key, or model change and needs the previous config back quickly.",
 "problem": "A wrong base URL or model in a config file blocks the tool, and manual recovery means finding the right file and hand-editing it.",
 "outcome": "The previous config is restored, a backup of the broken state is kept, and the tool can run again.",
 "steps": [
  "Run `node setup-gateway.mjs status` to see which base URL and model are active.",
  "Run `node setup-gateway.mjs restore codex` to restore Codex, or replace codex with claude or opencode for the other tools.",
  "In a terminal, pick the backup from the menu, or add --yes to take the newest one.",
  "Run `node setup-gateway.mjs status` again to confirm the restored values."
 ],
 "agent_prompt": "In the repo Sinholms/setup-gateway, run `node setup-gateway.mjs restore <TOOL>` where <TOOL> is claude, opencode, or codex, adding --yes for the newest backup. Expect a message that the config was restored and that a backup of the previous state was made first. Verify by running `node setup-gateway.mjs status` and confirming the values match the backup.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "Restore does not touch ~/.claude.json, so any approval suffix added there by an earlier setup stays in place.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "javascript",
 "requirements": [
  "Node.js 18 or newer installed",
  "A gateway base URL that exposes /v1 and an API key for it",
  "A model id the gateway serves, or access to GET /v1/models so the picker can list them",
  "For Codex: a gateway that serves the Responses API (/v1/responses)"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/sinholms-setup-gateway/roll-back-broken-tool-config/",
 "md": "https://dedupedai.com/use-cases/sinholms-setup-gateway/roll-back-broken-tool-config/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/sinholms-setup-gateway--roll-back-broken-tool-config.json",
 "api_version": "v1"
}
