Skip to content

feat(cli): add .hancerc.json config file for persistent defaults#36

Open
RichardBray wants to merge 2 commits into
mainfrom
feat/config-file
Open

feat(cli): add .hancerc.json config file for persistent defaults#36
RichardBray wants to merge 2 commits into
mainfrom
feat/config-file

Conversation

@RichardBray
Copy link
Copy Markdown
Member

Summary

  • Adds .hancerc.json config file support so users can set default CLI flags per-project instead of repeating them every run
  • Searches from cwd upward for a local config, falls back to ~/.config/hance/config.json for global defaults
  • CLI flags always override config values; --no-config skips config loading entirely

Test plan

  • Create .hancerc.json with flags like {"codec": "prores", "grain-amount": 0.5} and verify they apply
  • Verify CLI flags override config values
  • Verify --no-config ignores the config file
  • Verify global config at ~/.config/hance/config.json works as fallback

🤖 Generated with Claude Code

Richard Oliver Bray and others added 2 commits May 15, 2026 11:36
Loads project-local .hancerc.json (walks up from cwd) or global
~/.config/hance/config.json so users don't have to repeat CLI flags.
Config values are overridden by explicit CLI flags. --no-config skips
config loading entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace require() with Bun.file().json() for config loading
- Add --no-config to KNOWN_FLAGS/BOOLEAN_FLAGS for robustness
- Add loadConfig/findLocalConfig tests (directory walk, invalid JSON)
- Make parseArgs async to support async config loading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant