Skip to content

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

Merged
RichardBray merged 2 commits into
mainfrom
feat/config-file
May 19, 2026
Merged

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

Conversation

@RichardBray
Copy link
Copy Markdown
Member

@RichardBray RichardBray commented May 15, 2026

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 19, 2026 18:00
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>
@RichardBray RichardBray merged commit 2653ddc into main May 19, 2026
@RichardBray RichardBray deleted the feat/config-file branch May 19, 2026 17:30
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