Skip to content
ConfigHub for coding agents
Reference / docs/journeys/new-app.md Source on GitHub

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

  1. Install the plugin (README) and open a fresh claude session in an empty Git folder:

    mkdir greeter && cd greeter && git init -q && claude
  2. Ask 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.
  3. 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.
  4. 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:

  1. Test in a running preview first:

    Try a warmer greeting in preview and show me what the running app serves.

    staging and live stay untouched while you inspect the local preview URL.

  2. 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).

    • staging takes shared changes immediately (unless .env.staging overrides that key).
    • live (production) waits until you run cub mini approve in your own terminal (cub mini waiting lists pending orders).
    • Overrides win: Any key set explicitly in .env.production stays production’s own unless .env.production itself 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 && claude

Ask “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.
  • catalog inherits greeter’s shared settings and reasons immediately in staging, keeps its own app-specific settings separate, and requires its own production approval.
  • Later improvements on greeter can flow to catalog via cub 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:

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/mini and runs ConfigHub + PostgreSQL on 127.0.0.1 only (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 .env stays untouched when you approve production changes; use cub mini pull if 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) or cub 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
  1. Writes the app and .env (shared), .env.staging, and .env.production.
  2. Runs confighub mini get if no local hub is running (verifies release checksums, starts the hub on loopback, signs cub in; auto-start in other folders stays off unless you enable it).
  3. Runs cub mini adopt, creating APP-base, APP-staging, and APP-live plus baseline pattern-web rules (such as rejecting secret-shaped values in plain settings; separate from optional starters).
  4. Runs cub mini require-approval APP --variant live --agent APP-agent --try preview, creating the preview slot and scoping the folder's agent key.
  5. Prints the exact cub mini approve APP-base/adopt command for your terminal. Until you approve, cub mini pull, pull-key, and deploy-from-hub refuse 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:staging in 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 like api.env to .env).
  • Missing value in live: Shared .env values reach live only after cub mini approve APP-base/adopt (check cub 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).