-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Snack Stash supports multiple named stashes. The active stash is used by all snippet commands (list, search, unpack, pack).
-
SNACK_STASHenvironment variable (overrides everything) - Active stash in
~/.snackstashrc - Error — nothing is configured
Use snack stash create to register stashes. This is the standard workflow and requires no manual config editing.
# Create your first stash (auto-activated)
snack stash create default ~/snack-stash
# Add a second stash without switching to it
snack stash create work ~/work-stash --no-activate
# See what's configured
snack stash list
# default /Users/you/snack-stash ← active
# work /Users/you/work-stashThis writes ~/.snackstashrc in INI format:
[config]
active = default
[stash.default]
path = /Users/you/snack-stash
[stash.work]
path = /Users/you/work-stashYou can edit this file by hand if needed.
Set SNACK_STASH to override the config file entirely. Useful for scripts, CI, or quickly switching context.
export SNACK_STASH=~/snack-stashAdd to ~/.zshrc or ~/.bashrc to make it permanent:
echo 'export SNACK_STASH=~/snack-stash' >> ~/.zshrcWhen SNACK_STASH is set, named stashes in the config file are ignored for all snippet commands. snack stash list will still display configured stashes but will note the override.
A stash is a plain directory of .py files, organized into subdirectories by category. No special files or metadata are required.
~/snack-stash/
├── auth/
│ ├── google_oauth_fastapi.py
│ ├── google_oauth_flask.py
│ └── jwt_helpers.py
├── forms/
│ ├── contact_form.py
│ └── newsletter_signup.py
└── email/
└── smtp_sender.py
The directory can be managed with Git, Dropbox, or any other sync mechanism independently of this tool. Syncing is outside the scope of snack — it only copies files in and out.
To change which named stash is active, create a new one with --activate or edit ~/.snackstashrc directly and update the active key under [config].
snack stash list # see all stashes and which is active
snack list # confirm the active stash has snippetsSee Error-Reference for help with configuration errors.