Skip to content

Allow override from config rather than flags - #14

Merged
didvc merged 2 commits into
didvc:masterfrom
Lenbok:allow-config-for-flags
Oct 20, 2026
Merged

didvc merged 2 commits into
didvc:masterfrom
Lenbok:allow-config-for-flags

Conversation

@Lenbok

@Lenbok Lenbok commented Oct 16, 2026

Copy link
Copy Markdown

What & why

Coming from an earlier version of ai-brwap, I mostly don't want to have to change my ide to invoke ai-bwrap differently depending on the project.

Rather than requiring the user to supply flags for --overlay / --no-net / --git-rw / --branch / --dry-run etc, let's allow these to be set in the config file.

Even though for couple like dry-run it probably never makes sense to set from config, it's better to have the vars initialized the same place.

Checklist

  • shellcheck ai-bwrap is clean
  • --help text and README updated together (if the CLI surface changed)
  • Verified with --dry-run (paste relevant output below if helpful)

Notes

For context, my pattern is to use mise to set a project specific config like:

[env]
AI_BWRAP_CONFIG = "{{ env.HOME }}/.config/ai-bwrap/configs{{ config_root }}/config.sh"

(config_root is basically the project path)

And that config inherits my per-user defaults like:

#!/bin/bash
# My project specific config for ai-bwrap

# Include default config where I've put configuration shared across all projects
_default_config="$HOME/.config/ai-bwrap/config.sh"
if [[ -f "$_default_config" ]]; then
    source "$_default_config"
fi

# Now the actual project specific binds etc [...]

My ide just starts ai-bwrap opencode -- acp regardless of the project.

Lenbok and others added 2 commits October 16, 2026 16:18
Rather than requiring the user to supply flags for --overlay / --no-net /
--git-rw / --branch / --dry-run etc, allow these to be set in the config
file.

Even though for couple like dry-run it probably never makes sense to set from
config, it's better to have the vars initialized the same place.
The defaults are now assigned before the config layers are sourced, so a
config file can set them. Nothing guarded that, and moving the block back
restores the old behaviour silently.

Assert that config can set GIT_RW and SHARE_NET, and that a command line
flag still beats a config that disagrees.
@didvc
didvc merged commit 5455cdd into didvc:master Oct 20, 2026
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.

2 participants