Build & deploy your first app (with staging, preview, and gated production)
Build a new app with your coding agent without juggling fiddly .env files, worrying about agents breaking live settings, or locking yourself into one host. Start with the app you want: ask “Build a small Node app for my neighborhood market listening on 127.0.0.1. Give it a heading I can change in .env, run it locally and give me the link.” Open the page. When you want to compare two headings, ask for a preview you can reopen tomorrow. ConfigHub keeps that preview, helps a fresh chat find it, lets your agent build and stage while you approve and deliver to any service in your terminal, and makes it easy to go back anytime (Learn step by step · Try a running preview).
If you want staging and production from the start
Install the plugin (README) and open a fresh
claudesession in an empty Git folder:mkdir greeter && cd greeter && git init -q && claudeAsk for your app with “using ConfigHub”:
Build me a small web service using ConfigHub, with a health endpoint, a configurable greeting, and a staging and a production setup.- Review the starting settings when you want production to use them. Paste the exact approval command Claude gives you into your own terminal, check the values and decide. You can try the preview while the order waits.
- Commit your app along with
.confighub-app.
From the next session onward, you don’t need to say “using ConfigHub”, sessions in this folder automatically run on the app’s scoped agent key (how ordinary requests work).
Try a preview & change settings later
Changing the app later
Ask Claude for changes in plain words:
Test in a running preview first:
Try a warmer greeting in preview and show me what the running app serves.stagingandlivestay untouched while you inspect the local preview URL.Promote to staging & propose for production: Ask Claude to make the change the shared default (or edit files normally, Claude uploads via
cub mini upload).stagingtakes shared changes immediately (unless.env.stagingoverrides that key).live(production) waits until you runcub mini approvein your own terminal (cub mini waitinglists pending orders).- Overrides win: Any key set explicitly in
.env.productionstays production’s own unless.env.productionitself is updated. - Refusals are remembered:
cub mini refuse APP-base/ORDER --reason "WHY"blocks the change and warns future agent sessions why that value was rejected.
A second app from the first
You choose a greeting to share. Your agent makes it the shared default, then checks what both apps serve in staging. Your colleague can also fork your app the exact same way, customizing their own overrides with reasons while still taking your future updates without losing their changes (Colleague fork walkthrough). In the greeter session, ask “Make the preview greeting our shared default for welcoming visitors. Put it in staging and show me what the greeter serves there.”
From the folder that contains the greeter repo, create a sibling folder and start a fresh Claude Code session:
mkdir catalog && cd catalog && git init -q && claudeAsk “Build a small catalog service using greeter’s ConfigHub setup. Let it inherit the greeting. Run catalog with its staging settings and show me the response.” Look for the same greeting the greeter served.
- Claude runs
cub mini adopt catalog --pattern greeter. cataloginheritsgreeter’s shared settings and reasons immediately in staging, keeps its own app-specific settings separate, and requires its own production approval.- Later improvements on
greetercan flow tocatalogviacub mini upgrade greeter-base/app(walkthrough with every command).
If you already have the catalog app and a settings file such as .env, open that folder in Claude Code and use /confighub:start-from greeter to link it. In an empty folder, use the request above to build the app first.
Deploy to any service easily (and go back anytime)
Once your app works locally, connect a real host target, no clicking through fiddly env-variable screens on every cloud dashboard, and you can migrate across services later keeping your config:
- Vercel: Next.js on Vercel · Vercel walkthrough
- Fly.io: Rails on Fly
- Heroku (or moving off Heroku): An app on Heroku · Heroku walkthrough
- Unikraft Cloud: Unikraft walkthrough
- Kubernetes / Argo CD / Flux: GitOps app guide
Need to go back? Run confighub mini undo to revert only config edits while leaving your code untouched, refuse any pending production change with cub mini refuse, or export plain files and remove ConfigHub anytime (Going back).
What it takes & what you have
- Download & permissions: First use downloads the local hub (~300 MB on disk, ~70 MB RAM; details) into
~/.confighub/miniand runs ConfigHub + PostgreSQL on127.0.0.1only (no Docker, no account). Setup writes.claude/settings.local.json(auto-excluded from Git) to bind the staging-only key, enable Claude Code’s sandbox (autoAllowBashIfSandboxed: true), and deny agent reads of~/.confighub/keys. - Files vs. hub after approval: Your repo’s
.envstays untouched when you approve production changes; usecub mini pullif you want to write the approved hub copy back to files. Both approval (cub mini approve BASE/ORDER) and delivery (cub mini deliver) to Vercel, Fly, Heroku, or Unikraft are person steps in your own terminal, and rolling back production is also approval-gated. - Connecting real deployment: Local setup prepares hub copies and local runs; connect delivery when deploying to a cloud host, VM, or cluster (where the app runs · verify live state).
Inspect anytime:
- In Claude Code:
/confighub:why GREETING(every change, prompt, and agent rationale). - In Terminal:
cub mini receipts APP-live(who changed, why, who approved) orcub mini receipts APP --setup.
Next steps: Your first hour · cub mini tour · Add Postgres/Redis/S3 · Live secrets agents can't read · Move to a shared team hub · Going back / recovery · Glossary.
Under the hood: what the agent runs during Step 2
- Writes the app and
.env(shared),.env.staging, and.env.production. - Runs
confighub mini getif no local hub is running (verifies release checksums, starts the hub on loopback, signscubin; auto-start in other folders stays off unless you enable it). - Runs
cub mini adopt, creatingAPP-base,APP-staging, andAPP-liveplus baselinepattern-webrules (such as rejecting secret-shaped values in plain settings; separate from optional starters). - Runs
cub mini require-approval APP --variant live --agent APP-agent --try preview, creating the preview slot and scoping the folder's agent key. - Prints the exact
cub mini approve APP-base/adoptcommand for your terminal. Until you approve,cub mini pull,pull-key, anddeploy-from-hubrefuse production delivery.
Troubleshooting (cub: command not found, restarts, secrets, Linux)
cub: command not found: Paste the full binary path printed by the agent, or add it to your shell:export PATH="$HOME/.confighub/mini/confighub-mini-VERSION-OS-ARCH/bin:$PATH".- Hub stopped after reboot: Type
/confighub:stagingin Claude Code in the app folder (or ask the agent to start the hub); all data and pending orders persist. - Agent wrote a bash setup script or asked for login: Confirm the plugin is active with
claude plugin list, start a fresh session, and include"using ConfigHub"in your prompt. reads no settings adopt can find: Ask the agent to move configurable values into.env(or rename custom env files likeapi.envto.env).- Missing value in
live: Shared.envvalues reachliveonly aftercub mini approve APP-base/adopt(checkcub mini waiting). - Passwords / tokens skipped: Use
cub mini secret set APP KEY --variant live --change-desc "WHY"in your own terminal. - Alpine Linux: Requires glibc; Alpine (
musl) is unsupported (install details).