Problem
A stash registered in one terminal environment is not reliably available in others. For example, a stash created in a zsh session may not be found when switching to bash, a different user profile, or a Python venv — particularly when the user has configured their stash via the SNACK_STASH environment variable rather than snack stash create.
The SNACK_STASH env var is shell-specific: set in .zshrc, it won't exist in a bash session or a subprocess that doesn't inherit it. The ~/.snackstashrc config file is already shell-agnostic (any process on the machine can read it), but users who set up via the env var miss this.
Proposed solution
Introduce a snack init command that writes the stash configuration to ~/.snackstashrc once, regardless of how the user's shell is configured, so the stash is discoverable in every environment without requiring env var setup.
snack init ~/snack-stash
# Writes ~/.snackstashrc, no shell profile changes needed
Additionally, when SNACK_STASH is set but no ~/.snackstashrc exists, proactively suggest the user run snack stash create or snack init to make their config environment-independent:
Note: your stash is configured via SNACK_STASH but not registered in ~/.snackstashrc.
Run `snack stash create default $SNACK_STASH` to make it available in all environments.
Scope for BonBon
Notes
The ~/.snackstashrc config file is already cross-environment — this feature is about guiding users toward it as the primary setup method and providing a frictionless path to get there.
SNACK_STASH remains supported as a high-priority override for scripts and CI where explicit env vars are appropriate.
Problem
A stash registered in one terminal environment is not reliably available in others. For example, a stash created in a
zshsession may not be found when switching tobash, a different user profile, or a Pythonvenv— particularly when the user has configured their stash via theSNACK_STASHenvironment variable rather thansnack stash create.The
SNACK_STASHenv var is shell-specific: set in.zshrc, it won't exist in abashsession or a subprocess that doesn't inherit it. The~/.snackstashrcconfig file is already shell-agnostic (any process on the machine can read it), but users who set up via the env var miss this.Proposed solution
Introduce a
snack initcommand that writes the stash configuration to~/.snackstashrconce, regardless of how the user's shell is configured, so the stash is discoverable in every environment without requiring env var setup.Additionally, when
SNACK_STASHis set but no~/.snackstashrcexists, proactively suggest the user runsnack stash createorsnack initto make their config environment-independent:Scope for BonBon
snack init <path>command — registers a default stash in~/.snackstashrcand confirms the path worksSNACK_STASHis set but no~/.snackstashrcexistssnack stash create/snack initover the env var for persistent setupssnack initand the hint behaviourNotes
The
~/.snackstashrcconfig file is already cross-environment — this feature is about guiding users toward it as the primary setup method and providing a frictionless path to get there.SNACK_STASHremains supported as a high-priority override for scripts and CI where explicit env vars are appropriate.