cfgit is designed for humans and AI coding agents to use the same operation surface.
Do not write directly to the database when cfgit can perform the mutation. Use cfgit so drift, history, and rollback remain coherent.
Recommended agent flow:
cfg_statuscfg_diffif there is drift or a planned editcfg_impactbefore committing behavior-affecting recordscfg_commit,cfg_bulk_commit, orcfg_adoptcfg_statusagain
If status is changed_outside_cfgit, do not commit over it. Diff it, explain it,
then ask whether to adopt it or merge manually.
For coupled multi-record edits, prefer one cfg_bulk_commit call over several
independent cfg_commit calls. It preflights every target first, so a known drift
or secret-policy failure blocks the whole batch before any record is written.
If it returns blocked, nothing was applied. If it returns partial, inspect
results, failed, and pending before continuing.
For branch review flows, remember that branch commits and PR creation write only
cfgit refs. cfg_pr_merge is the runtime mutation. For multi-record PRs it
preflights every touched record, requires adapter batch atomicity, and commits or
rolls back all runtime records, canonical heads/history, and the PR status
together. If the MCP envelope returns stale, changed_outside_cfgit, or
atomicity_unavailable, stop and inspect the reported drift, main-head movement,
or adapter capability before retrying.
In authenticated or enforced environments, run the agent process with its own
private token:
export CFGIT_IDENTITY_TOKEN='agent-private-string'
cfg whoamiConfigure only the token hash in .cfg.toml, mapped to an agent author such as
codex-agent@example.com. The MCP author argument is only a hint in verified
modes; cfgit refuses it if it does not match the token or DB principal identity.
For real human or agent setup secrets, prefer local hashing:
printf '%s' 'agent-private-string' | cfg identity-hash --stdinThe MCP server also exposes cfg_identity_hash for setup convenience, but tool
inputs may be visible to the MCP client. Do not send real production identity
tokens through MCP unless that client/session is trusted for secrets.
Install the MCP extra:
pip install 'cfgit[mcp]'Run:
cfg-mcpThe MCP tools return a uniform envelope:
{
"status": "ok",
"code": 0,
"message": "",
"data": {}
}Tool list:
cfg_whoamicfg_initcfg_statuscfg_importcfg_diffcfg_impactcfg_commitcfg_bulk_commitcfg_branch_listcfg_branch_createcfg_branch_deletecfg_branch_diffcfg_branch_logcfg_pr_createcfg_pr_listcfg_pr_showcfg_pr_closecfg_pr_mergecfg_recent_historycfg_logcfg_showcfg_adoptcfg_restorecfg_tagcfg_fsckcfg_identity_hash
cfg_impact accepts against as either a list of collection:id strings or a
comma/space-separated string when narration should be scoped to selected records.
cfg_bulk_commit accepts items as either a structured list
([{record, doc}]), a mapping ({"collection:id": doc}), or a JSON string in
either shape.
If cfg_log, cfg_show, or a diff/impact path returns bad_config saying
history exists under another env, the same history store has been opened under a
different env name. Switch to the env named in the message or fix .cfg.toml
before mutating anything.
The skill file is:
skills/cfgit/SKILL.md
It is intentionally plain. It tells a coding agent how to inspect first, branch on drift, avoid raw database writes, use JSON output, and treat verified identity as token/DB-principal based rather than author-string based.
Install:
pip install cfgit-impactDeterministic impact:
cfg impact agent_configs:agent_planner --jsonLLM narration:
cfg impact agent_configs:agent_planner --llm --jsonScoped narration:
cfg impact agent_configs:agent_planner --against agent_configs:critic --llm --jsonProvider config:
[connections]
ai_provider = "claude"Supported providers:
claude, usingANTHROPIC_API_KEYopenai, usingOPENAI_API_KEYgemini, usingGEMINI_API_KEYorGOOGLE_API_KEY
The impact engine calls a provider-agnostic narrate() or complete() method.
Provider selection is done by cfg_impact.providers.factory.ImpactProviderFactory.
No vendor provider code lives in src/cfg/core.