Problem
The same flags get retyped on nearly every invocation, e.g.
onton --repo . --backend codex
onton --gameplan <path> --backend codex --mode auto
There's no way to say "for me, --backend codex --mode auto are always the defaults."
Proposal
Extend the existing user config at ~/.config/onton/<owner>/<repo>/config.json (already loaded in bin/main.ml:4103 via lib_core/repo_config.ml) with an optional defaults block that supplies fallback values for CLI flags:
{
"defaults": {
"backend": "codex",
"mode": "auto",
"model": "...",
"pollInterval": 30,
"maxConcurrency": 5,
"mainBranch": "main"
},
"routing": { ... },
"reviewBackends": [ ... ]
}
Resolution precedence:
CLI flag > env var > per-repo user config > hardcoded default
Optionally also load a user-global ~/.config/onton/config.json between the per-repo file and the hardcoded defaults, so "codex everywhere" works without duplicating the file per repo.
Out of scope (for now)
- Repo-scoped
.onton/config.json checked into the repo for team-wide defaults. Worth doing eventually, but skip for v1 — start with user-scoped.
--gameplan — per-invocation, would invite stale defaults.
--token — already env-driven via GITHUB_TOKEN; don't tempt people to commit secrets.
Implementation sketch
- Add a
defaults record to lib_core/repo_config.ml (all fields optional).
- In
bin/main.ml flag resolution, change each Arg.value (... ~default:hardcoded) to consult the loaded config first.
- Tests: a property that CLI flags still win over config; that missing config keys fall back to the existing hardcoded defaults.
Problem
The same flags get retyped on nearly every invocation, e.g.
There's no way to say "for me,
--backend codex --mode autoare always the defaults."Proposal
Extend the existing user config at
~/.config/onton/<owner>/<repo>/config.json(already loaded inbin/main.ml:4103vialib_core/repo_config.ml) with an optionaldefaultsblock that supplies fallback values for CLI flags:{ "defaults": { "backend": "codex", "mode": "auto", "model": "...", "pollInterval": 30, "maxConcurrency": 5, "mainBranch": "main" }, "routing": { ... }, "reviewBackends": [ ... ] }Resolution precedence:
CLI flag > env var > per-repo user config > hardcoded default
Optionally also load a user-global
~/.config/onton/config.jsonbetween the per-repo file and the hardcoded defaults, so "codex everywhere" works without duplicating the file per repo.Out of scope (for now)
.onton/config.jsonchecked into the repo for team-wide defaults. Worth doing eventually, but skip for v1 — start with user-scoped.--gameplan— per-invocation, would invite stale defaults.--token— already env-driven viaGITHUB_TOKEN; don't tempt people to commit secrets.Implementation sketch
defaultsrecord tolib_core/repo_config.ml(all fields optional).bin/main.mlflag resolution, change eachArg.value (... ~default:hardcoded)to consult the loaded config first.