ConfigHub · Durable config for coding agents
Docs / examples/walkthroughs/starter-web.md Source on GitHub →

A small web service: deploy it, update it, undo it, move it, delete it

You run a small service from a .env file. Try a settings change in staging, check what production still holds, then approve it and undo it. At the end, copy the setup to your team so the next change can start there.

Quick start

You need: the local hub, unpacked, with starters switched on.

By handAsk your agent
Connect the appcub repo adopt menu"Deploy my menu service: keep its settings in a staging and a production copy, and production should change only when I approve."
Change a settingEdit menu/.env, then cub repo upload menu --change-desc "Warnings alone hide what customers do""Production should log at info, not warn. Make that change for menu."
Approve productioncub inbox approve menu (step 5)You approve it yourself.
Undocub repo rollback menu --reason "Info logs show customer emails""Undo that log level change in production; info logs show customer emails."

Staging keeps its own log level, production changes only when you approve, and cub secret pull writes production's approved settings to the file your service reads.

Without ConfigHub: your agent changes the .env file directly, production included, and the next session has no record of why.

Deeper dive

The rest of this page is the full version: every command, the move to your team's shared hub, what an agent leaves to you, and how this was tested.

Show the full walkthrough

Human

For a person following along in a terminal.

What you need

The local hub, unpacked as installing the local hub shows (steps 1 to 5). The local hub runs a hub, which is a ConfigHub server that keeps your app's settings, on your own computer. cub is ConfigHub's command-line tool, and the package includes it. For step 7 you also need an organization on a shared hub on confighub.com, the shared hub your team signs in to.

Steps

  1. Start a hub, with the starters switched on. MINI is the folder of the unpacked package. A starter gives a new app of one kind its usual settings, each with a reason (starters).
    export MINI=/absolute/path/to/unpacked-confighub-mini
    export PATH="$MINI/bin:$PATH" CUB_MINI_STARTERS="$MINI/starters"
    cub plugin install "$MINI" >/dev/null
    cub local start --use
    export LAPTOP=$(cub context get -o jq=.name)
  2. Make the app: a folder menu with its settings, and its own log level for staging.
    mkdir menu
    printf 'PORT=5000\nLOG_LEVEL=warn\nMENU_SOURCE=kitchen.json\n' > menu/.env
    printf 'LOG_LEVEL=debug\n' > menu/.env.staging
  3. Deploy it, part one: connect it. ConfigHub makes three copies of its settings: the base, staging, and live, which is production. The web starter adds three settings and leaves yours alone. Your files are not changed.
    cub repo adopt menu
    Starter: web (version 1, web.yaml): A small web service whose settings are in a .env, app.env or compose file, made from adopt's starter pattern.
    …
      Sets REPLICAS=2, as a setting: Two instances, so that one can restart without the service going down.
    …
      Leaves PORT alone: it is set already, PORT=5000, by you, in .env.
    …
      Production takes the shared settings only after you approve them. To see them and approve them, in a terminal of your own: ~/.confighub/mini/cub inbox approve menu-live
  4. Deploy it, part two: approve production's first settings, and write them where the service reads them. cub secret pull writes live's settings as menu-running/app.env; start the service from that file as you do now.
    cub inbox approve menu-base/adopt --note "First settings for production" --yes
    cub secret pull menu --variant live --dir menu-running
    …
    Approved menu-base/adopt.
    …
    app.env written: revision 3: menu's settings, from .env, with .env.staging for staging
  5. Update it: production should log more. Change the file and upload it with your reason. The commands save the exact order printed by the upload. Staging keeps debug. Read the production diff in cub inbox list before you proceed.
    printf 'PORT=5000\nLOG_LEVEL=info\nMENU_SOURCE=kitchen.json\n' > menu/.env
    UPDATE=$(cub repo upload menu --change-desc "Warnings alone hide what customers do")
    printf '%s\n' "$UPDATE"
    UPDATE_ORDER=$(printf '%s\n' "$UPDATE" | sed -nE 's/^.*mini approve (menu-base\/upload-[a-z0-9-]+)[[:space:]]*$/\1/p')
    test -n "$UPDATE_ORDER"
    cub inbox list

    If the order shows warn → info and you want that change, approve it and pull the approved settings:

    cub inbox approve "${UPDATE_ORDER:?Review the update first}" --yes --note "Info logs are fine in production"
    cub secret pull menu --variant live --dir menu-running
  6. Undo the update in production. cub repo rollback sets back only what the update changed and creates a new order. Read that order before you proceed.
    ROLLBACK=$(cub repo rollback menu-live --change-order "${UPDATE_ORDER:?Run the update first}" --reason "Info logs show customer emails")
    printf '%s\n' "$ROLLBACK"
    ROLLBACK_ORDER=$(printf '%s\n' "$ROLLBACK" | sed -nE 's/^.*mini approve (menu-base\/upload-[a-z0-9-]+)[[:space:]]*$/\1/p')
    test -n "$ROLLBACK_ORDER"
    cub inbox list

    If the rollback shows info → warn and you want that change, approve it and pull the restored settings:

    cub inbox approve "${ROLLBACK_ORDER:?Review the rollback first}" --yes --note "Back to warnings"
    cub secret pull menu --variant live --dir menu-running
  7. Move it to your team's shared hub. Sign in once (auth login opens a browser). The app's name there, TEAM_APP, starts with your user name, so it does not clash with a teammate's.
    cub context create shared --server https://hub.confighub.com
    cub --context shared auth login
    export PREFIX="${WALKTHROUGH_PREFIX:-$USER-}"
    export TEAM_APP="${PREFIX}menu"
  8. Copy the app there. The copy keeps every value and its reason, and keeps production behind your approval: it makes the change workflow, which says a change to live waits for you (approvals explains it).
    cub --context shared mini copy --from-context "$LAPTOP" menu --name "$TEAM_APP"
    cub --context shared unit data app --space "$TEAM_APP-live"
    …
    LOG_LEVEL=warn
  9. Check that production in the shared hub waits for you, without changing anything there: the app takes a change only through its change workflow (the first true), and that workflow's production stage needs an approval (the second).
    cub --context shared component get "$TEAM_APP" -o jq=.Component.RequireChangeWorkflow
    cub --context shared changeworkflow get --space workflows "$TEAM_APP-live-approval" -o jq='.ChangeWorkflow.Stages[] | select(.Name == "live") | .Prerequisites | length > 0'
    true
    true
  10. Delete the app from your own hub, now that the shared hub holds it. There is no single command for this yet: delete its Spaces, its Component, then its approval rules. Your files stay.
    cub space delete --space menu-live,menu-staging,menu-base,menu-file-proposals --recursive
    cub component delete menu
    cub changeworkflow delete --space workflows menu-live-approval
    cub changeworkflow delete --space workflows menu-file-review

Undo it

In the shared hub: cub --context shared space delete --space "$TEAM_APP-live,$TEAM_APP-staging,$TEAM_APP-base" --recursive, then cub --context shared component delete "$TEAM_APP" and cub --context shared changeworkflow delete --space workflows "$TEAM_APP-live-approval". To remove your own hub with everything in it: cub local uninstall --delete-data.

What you have now

Your menu folder, unchanged by ConfigHub; menu-running/app.env, production's settings as last approved; and your team's shared hub holding the app, with production there changing only when you approve.

Agent

For an AI agent doing these jobs for a person: run the Human steps' commands, adjusted to their app.

  • Deploy: cub repo adopt FOLDER. End your message with one sentence on what the person has now, in their words (for example, that production cannot change without them), and the exact BASE/ORDER from cub inbox list; tell the person to review that order and use cub inbox approve BASE/ORDER. Never use the no-order shorthand.
  • Update: change the app's file, then cub repo upload FOLDER --change-desc "WHY". End the same way, with the exact BASE/ORDER printed for the reviewed upload, then have the person use cub inbox approve BASE/ORDER.
  • Undo: put the file back as it was and upload it again, with the reason. End the same way with the exact order ID and diff-specific approval command.
  • Move: run step 8 with the shared hub's context, then read live back, and step 9, which only reads, to see that production waits; never make a change there to test it. If it does not, say so plainly.
  • Delete: step 10, only once the shared hub holds the app. Never delete the person's files.

Approving production is the person's, so give them the one command and nothing beside it. Never put a password or token in a setting. You are done when cub unit data app --space APP-live shows what the person asked for, or, for a change that waits, when cub inbox list shows it.

Testing

A fresh-profile run on the published local hub package on 15 November caught two breaks: a stale output quote and a literal ORDER placeholder. After the fix, all scripted steps passed in 71 seconds, including update and rollback. The shared-hub step used a second disposable local hub for this run. Each task below is given to an agent in the folder that holds menu, after the steps before it. When a change waits for production, the person approves it.

Deploy my menu service: keep its settings in a staging and a production copy, and production should change only when I approve.

Production should log at info, not warn. Make that change for menu.

Undo that log level change in production; info logs show customer emails.

Copy menu to our team's shared hub, whose context is called shared. The app's name there is in TEAM_APP, and production there should change only when I approve.

Remove menu from this computer's hub; the team's hub keeps it. Keep my files.

This proves: the settings were stored in the hub, on the local hub and on a shared hub on confighub.com, with production there waiting for approval, and production's approved revision was written to the file a service reads, with cub secret pull. No service is started, and no controller is used. The page aims to win one next step: that the person keeps the starter on for their next app.

The checks can be run by hand, from the folder that holds menu:

cub unit data app --space menu-live      # PORT=5000; LOG_LEVEL=info after the update, warn after the undo
cub --context shared unit data app --space "$TEAM_APP-live"
Test results

Results, 14 November 2026, confighub mini 0.11.1-mini.3. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.

  • Scripted run (on confighub mini 0.11.1-mini.3, 14 November 2026): passed, 64 seconds for the steps, within the page's budget of 200; each of the three planted faults (a changed quoted line, a budget of zero seconds, a check that holds on a fresh hub) was caught.
  • Scripted run (on confighub mini 0.11.1-mini.7, 14 November 2026): passed, 62 seconds for the steps, within the page's budget of 200; each of the three planted faults (a changed quoted line, a budget of zero seconds, a check that holds on a fresh hub) was caught.
  • Environment, published confighub mini 0.11.1-mini.3 with its own plugin (0.86.0): A local hub on this computer, with a shared hub on confighub.com (the Kubara organization) for the move to a shared hub; no cluster or service. Approvals were scripted: the test script ran the person's approve commands. After each run the runner removed the hubs it started and everything it made in the shared hub.
  • Agent runs (on confighub mini 0.11.1-mini.3, 14 November 2026): a pilot, 3 runs per arm on each of claude-sonnet-5-5, claude-opus-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading; c is the Claude plugin and the local hub, without this page.
ArmModelChecks passedMedian secondsMedian costCommands left for the person (median)
aclaude-opus-5-56/9 (+6 not applicable)64.4$0.270
bclaude-opus-5-515/15114.5$0.4793
cclaude-opus-5-513/15172.4$0.7264
aclaude-sonnet-5-56/9 (+6 not applicable)43.7$0.1280
bclaude-sonnet-5-515/1590.9$0.2153
cclaude-sonnet-5-57/1584.5$0.294

No agent approved or refused a change to production.

Simulated persons, not people: 10 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Production waited for your yes because the web starter set this app up that way, with a reason for each setting. Your next web service can start the same way; want the web starter kept on for it?"

The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.

ArmModelPersonsOfferedNoticedWant the next step nowLaterIn the way
aclaude-opus-5-5300%100%n/an/a87%
bclaude-opus-5-530100%100%7%80%70%
cclaude-opus-5-53033%100%40%50%83%
aclaude-sonnet-5-5300%100%n/an/a70%
bclaude-sonnet-5-530100%100%27%70%90%
cclaude-sonnet-5-53067%100%25%75%97%
  • Agent runs (on confighub mini 0.11.1-mini.2, 13 November 2026): 20 runs per arm on each of claude-opus-5-5, claude-sonnet-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading.
ArmModelChecks passedMedian secondsMedian costCommands left for the person (median)
aclaude-opus-5-543/60 (+40 not applicable)70.1$0.2760
bclaude-opus-5-5100/100129.9$0.4793
aclaude-sonnet-5-540/60 (+40 not applicable)57.6$0.1340
bclaude-sonnet-5-5100/10093.1$0.2063

No agent approved or refused a change to production.

Simulated persons, not people: 10 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Production waited for your yes because the web starter set this app up that way, with a reason for each setting. Your next web service can start the same way; want the web starter kept on for it?"

The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.

ArmModelPersonsOfferedNoticedWant the next step nowLaterIn the way
aclaude-opus-5-52000%100%n/an/a84%
bclaude-opus-5-5200100%100%28%60%74%
aclaude-sonnet-5-52000%100%n/an/a82%
bclaude-sonnet-5-5200100%100%26%59%89%

Results, 14 November 2026, confighub mini 0.11.1-mini.7. Figures from this page's own test runs, shown here for whoever checks the page; they are not a promise.

  • Environment: checksum-verified published mini.7 for macOS arm64 and the Claude plugin it ships, with Claude Code on this computer. These are agent runs; the earlier scripted runs and planted faults are labelled separately.
  • Agent runs: a pilot, 3 runs per arm on each of claude-sonnet-5-5. Arms: a is ordinary tools only; b is the Claude plugin, the local hub and this page as reading.
ArmModelChecks passedMedian secondsMedian costCommands left for the person (median)
aclaude-sonnet-5-56/9 (+6 not applicable)41.7$0.140
bclaude-sonnet-5-515/1585.0$0.213

No agent approved or refused a change to production.

Simulated persons, not people: 5 per run, each a claude-haiku-5-5 model playing one of ten fixed personas, reading only what a person would see. The next step they were offered: "Production waited for your yes because the web starter set this app up that way, with a reason for each setting. Your next web service can start the same way; want the web starter kept on for it?" It offers more of the tier the person has, not a step up.

The Claude plugin offers it once, after the answer at whose end it showed the moment the offer names ("did not change"). Offered is the share of persons it was shown to; want it now and later are over them.

ArmModelPersonsOfferedNoticedWant the next step nowLaterIn the way
aclaude-sonnet-5-5150%100%n/an/a93%
bclaude-sonnet-5-515100%100%0%93%100%