ConfigHub · Durable config for coding agents
Docs / 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 repo upload).

    • staging takes shared changes immediately (unless .env.staging overrides that key).
    • live (production) waits until you run cub inbox approve in your own terminal (cub inbox list 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 inbox 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.

If you already have the catalog app and a settings file such as .env, open that folder and run cub local start-from greeter (or cub repo adopt . --pattern 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 inbox refuse, or export plain files and remove ConfigHub anytime (Going back).

What it takes & what you have

Inspect anytime:

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 repo 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 agent 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 inbox approve APP-base/adopt command for your terminal. Until you approve, cub secret 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 inbox approve APP-base/adopt (check cub inbox list).
  • Passwords / tokens skipped: Use cub secret set APP KEY --variant live --change-desc "WHY" in your own terminal.
  • Alpine Linux: Requires glibc; Alpine (musl) is unsupported (install details).