cfgit: A clean tool for dirty workflows. Git for database config.
For the config rows your app and agents change in MongoDB or Postgres.
A 10-second demo. Nothing to set up.
How cfgit handles a row edited outside it
provider.model "gpt-4.1", retry.max 2provider.model "gemini-2.5-pro", retry.max 4edited straight in the databasecfg impact --llmexplains what it touches and how to roll back, before you write Claude · OpenAI · Geminicfg commitrefused, it would overwrite the editcfg adoptrecords the edit as @2cfg restore @1puts the row backcfg promoteships it from dev to prod and posts it to Slack
cfgit with a coding agent: drift, rollback, preview, branch review and promotion
Catch a drifted edit
Look at the drift, then fold it into history (adopt) or throw it away (restore), then retry.
raw
⎿ {
"status": "dirty",
"code": 2,
"message": "",
"data": {
"state": "changed_outside_cfgit",
"live_oid": "b1d66d1b0da9…",
"head_oid": "c2a93a020293…"
},
"state": "changed_outside_cfgit",
"next": {
"why": "The live record differs from what cfgit last recorded \u2026",
"remedy": "Look at the drift, then fold it into history (adopt) or throw it away (restore), then retry.",
"commands": [
"cfg diff agent_configs:planner =HEAD =live",
"cfg adopt agent_configs:planner -m 'adopt out-of-band change'",
"cfg restore agent_configs:planner =HEAD -m 'discard drift'"
],
"docs": "SKILL.md#reconcile-drift"
… +2 lines (ctrl+o to expand)| path | before | after |
|---|---|---|
| provider.model | 'gpt-4.1' | 'gemini-2.5-pro' |
| retry.max | 2 | 4 |
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"changes": [
{
"path": "provider.model",
"op": "change",
… +15 lines (ctrl+o to expand)The commit was refused. Someone changed the planner outside cfgit: model gpt-4.1 to gemini-2.5-pro, retry.max 2 to 4. I won't write over that.
Want me to adopt their change first, then set retry.max to 3 on top?
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "adopted",
"oid": "b1d66d1b0da9…",
"seq": 2
… +4 lines (ctrl+o to expand)raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "committed",
"oid": "20e35401ca10…",
"seq": 3
… +4 lines (ctrl+o to expand)Done. The planner is at @3 with retry.max 3, on top of @2, the adopted model switch.
If 3 is wrong, cfg restore agent_configs:planner @2 puts it back.
Roll back a change
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "restored",
"oid": "b1d66d1b0da9…",
"seq": 4
… +4 lines (ctrl+o to expand)| @4 | restore | b1d66d1b0da9 | put retry max back to 4 |
| @3 | commit | 20e35401ca10 | raise planner retry max to 3 |
| @2 | adopt | b1d66d1b0da9 | adopt out-of-band model switch |
| @1 | import | c2a93a020293 | initial import |
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": [
{
"collection": "agent_configs",
"record_id": "planner",
"env": "dev",
"seq": 4,
"oid": "b1d66d1b0da9…",
"parent_oid": "20e35401ca10…",
"message": "put retry max back to 4",
… +173 lines (ctrl+o to expand)- agent_configs:plannerclean@4
- agent_configs:refund_resolutionclean@1
- agent_configs:support_orchestratorclean@1
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": [
{
"collection": "agent_configs",
"record_id": "planner",
"state": "clean",
"live_oid": "b1d66d1b0da9…",
"head_oid": "b1d66d1b0da9…",
"head_seq": 4,
… +24 lines (ctrl+o to expand)Rolled back. The planner is at @4, the same content as @2, and every record is clean. @3 is still in history if you want it again.
Preview before writing
| path | before | after |
|---|---|---|
| auto_approve_under_usd | 50 | 100 |
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "would_commit",
"type_changes": [],
"validation_problems": [],
"changes": [
{
"path": "auto_approve_under_usd",
"op": "change",
"before": 50,
"after": 100
}
],
… +13 lines (ctrl+o to expand)One field changes: auto_approve_under_usd goes from 50 to 100. Nothing is written yet. Go ahead?
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "committed",
"oid": "94f5d3977ef2…",
"seq": 2
… +4 lines (ctrl+o to expand)Written as @2. The diff you saw is exactly what landed.
Review on a branch
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"type": "branch",
"id": "orchestrator-gpt-4.1",
"name": "orchestrator-gpt-4.1",
"base_branch": "main",
… +11 lines (ctrl+o to expand)raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "committed",
"branch": "orchestrator-gpt-4.1",
"commit_id": "bc_33c49a6b6c5f408a",
"collection": "agent_configs",
"record_id": "support_orchestrator",
"oid": "e7c667aa541a…",
"runtime_mutated": false
},
… +3 lines (ctrl+o to expand)- agent_configs:support_orchestrator1 change
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"type": "pr",
"id": "pr_fe4d17890978",
"status": "open",
"base_branch": "main",
"head_branch": "orchestrator-gpt-4.1",
"head_commit_id": "bc_33c49a6b6c5f408a",
… +20 lines (ctrl+o to expand)pr_fe4d17890978 is open. Live still runs gpt-4.1-mini; nothing changes until it merges.
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"state": "merged",
"pr": "pr_fe4d17890978",
"results": [
{
… +15 lines (ctrl+o to expand)Merged. The orchestrator runs gpt-4.1 now, recorded as @2.
Promote dev to prod
| path | before | after |
|---|---|---|
| provider.model | 'gpt-4.1' | 'gemini-2.5-pro' |
| retry.max | 2 | 3 |
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"collection": "agent_configs",
"record_id": "planner",
"state": "would_commit",
"type_changes": [],
"validation_problems": [],
"changes": [
{
"path": "provider.model",
"op": "change",
… +34 lines (ctrl+o to expand)Two fields change in prod: provider.model gpt-4.1 to gemini-2.5-pro, and retry.max 2 to 3. provider.base_url is not copied, so prod keeps its own gateway. Ship it?
raw
⎿ {
"status": "ok",
"code": 0,
"message": "",
"data": {
"collection": "agent_configs",
"record_id": "planner",
"state": "committed",
"oid": "59c0ab5e0c73…",
… +16 lines (ctrl+o to expand)agent_configs:planner @2provider.model, retry.max
dev → prod
raw
⎿ {
"text": "planner promoted to prod by agent@demo.dev: ship planner gemini change",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "planner promoted to prod",
"emoji": false
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
… +32 lines (ctrl+o to expand)Live in prod as @2, with where it came from recorded in history. Your team saw it land in Slack.