{"id":17151929,"url":"https://github.com/dancardin/sauce","last_synced_at":"2025-09-09T05:43:22.137Z","repository":{"id":39707069,"uuid":"323898949","full_name":"DanCardin/sauce","owner":"DanCardin","description":"A tool to help manage context/project specific shell-things like environment variables.","archived":false,"fork":false,"pushed_at":"2023-06-14T20:22:07.000Z","size":249,"stargazers_count":46,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-21T03:19:22.169Z","etag":null,"topics":["environment","fish","hacktoberfest","rust","shell","zsh"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanCardin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-12-23T12:40:36.000Z","updated_at":"2024-10-03T09:31:43.000Z","dependencies_parsed_at":"2023-12-16T12:06:48.797Z","dependency_job_id":"2a81c1be-3ded-44e1-be36-611ddffaed39","html_url":"https://github.com/DanCardin/sauce","commit_stats":{"total_commits":80,"total_committers":3,"mean_commits":"26.666666666666668","dds":"0.025000000000000022","last_synced_commit":"e21a28b011f50e281ac784219a842d5c488c26c8"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/DanCardin/sauce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanCardin%2Fsauce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanCardin%2Fsauce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanCardin%2Fsauce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanCardin%2Fsauce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanCardin","download_url":"https://codeload.github.com/DanCardin/sauce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanCardin%2Fsauce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274250465,"owners_count":25249396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["environment","fish","hacktoberfest","rust","shell","zsh"],"created_at":"2024-10-14T21:42:24.770Z","updated_at":"2025-09-09T05:43:22.118Z","avatar_url":"https://github.com/DanCardin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sauce\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/crates/l/sauce.svg\" alt=\"license\"\u003e\n\u003ca href=\"https://crates.io/crates/sauce\"\u003e\n\u003cimg src=\"https://img.shields.io/crates/v/sauce.svg?colorB=319e8c\" alt=\"Version info\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/DanCardin/sauce/actions?query=workflow%3ATest\"\u003e\n\u003cimg src=\"https://github.com/DanCardin/sauce/workflows/Test/badge.svg\" alt=\"Build Status\"\u003e\n\u003c/a\u003e \u003ca href=\"https://codecov.io/gh/DanCardin/sauce\"\u003e\n\u003cimg src=\"https://codecov.io/gh/DanCardin/sauce/branch/main/graph/badge.svg?token=U7NQIWXWKW\"/\u003e\n\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n\u003e The central truth is the central truth, and nothing that I care about\n\u003e is relative\n\nA tool to help manage context/project specific shell-things like\nenvironment variables.\n\n## Table of Contents\n\n- [Docs](./doc)\n\n  - [Configuration Reference](./doc/config.md)\n  - [Flag and Subcommand Reference](./doc/options.md)\n  - [Comparison to other tools\n    (i.e. direnv/dotenv)](./doc/comparison.md)\n\n- [Example Workflow](#example-workflow)\n\n- [Setup](#setup)\n\n  - [Install](#install)\n  - [Shell Hook](#shell-hook)\n\n- [Targets](#targets)\n\n- [Features](#features)\n\n  - [sauce](#sauce)\n  - [Central Storage](#central-storage)\n  - [Cascaded Loading](#cascaded-loading)\n  - [Autoloading](#autoloading)\n\n- [Local Development](#local-development)\n\n## Example Workflow\n\n``` bash\n# Suppose you've got some directory structure\n❯ mkdir -p projects/foo\n❯ cd projects\n\n# In \"projects\", you want some shorthand for quickly pushing your branches\n❯ sauce new\nCreated /Users/danc/.local/share/sauce/projects.toml\n\n❯ sauce set alias push='git push origin \"$(git rev-parse --abbrev-ref HEAD)\"'\nSetting push = git push origin \"$(git rev-parse --abbrev-ref HEAD)\"\n\n# Your project is, naturally, using 12-factor methodology, so you've got some\n# project specific environment variables you need to load!\n❯ cd foo\n❯ sauce set env foo=bar AWS_PROFILE=meow\nSetting foo = bar\nSetting AWS_PROFILE = meow\n\n# The core purpose!\n❯ sauce\nSourced ~/.local/share/sauce/projects/foo.toml\n\n❯ env\n...\nAWS_PROFILE=meow\nfoo=bar\n\n# Note the cascaded loading of upstream values!\n❯ push\n```\n\n## Setup\n\n### Install\n\n#### With Cargo\n\n- `cargo install sauce`\n\n#### Download Release\n\n- Download Linux/Mac binary from\n  [Releases](https://github.com/DanCardin/sauce/releases)\n\n### Shell Hook\n\nCurrently explicitly supported shells include: `zsh`, `bash`, and\n`fish`. The scaffolding exists to support other shells, which should\nmake supporting other common shells that might require `\"$SHELL\"`\nspecific behavior.\n\nLoading things into the environment requires a minimal amount of shell\ncode to be executed, so after installing the binary (suggestion below),\nyou will need to add add a hook to your bashrc/zshrc/config.fish, etc.\n\n- bash `eval \"$(sauce --shell bash shell init)\"`\n- zsh `eval \"$(sauce --shell zsh shell init)\"`\n- fish `sauce --shell fish shell init | source`\n\nDepending on the level of similarity to the above shells, you may be\nable to get away with using one of the above `shell init` hooks until\nexplicit support is added\n\n## Targets\n\nA thing which `sauce` can load/unload is called a “target”.\n\nCurrently supported targets include:\n\n- environment variables\n\n  ``` bash\n  sauce set env FOO=bar\n  ```\n\n- aliases\n\n  ``` bash\n  sauce set alias g=git\n  ```\n\n- functions\n\n  ``` bash\n  sauce set function add 'echo $(expr $1 + $2)'\n  ```\n\n## Features\n\n### `sauce` command\n\nThis is primary usecase is the `sauce` command, no subcommand, no\narguments. This loads the current shell with all sauce targets (env\nvars, aliases, and function) which apply to the current directory.\n\nThere are also a bunch of [options](./doc/options.md) to allow you to\ncustomize the behavior of `sauce`, for example `sauce --glob DATABASE*`,\n`sauce --filter env:AWS_PROFILE`, or `sauce --path ~`.\n\n### Central Storage\n\nThe original motivation for central storage was due to getting a new\ncomputer and needing to comb through \\~50 repos to find all the random\n`.env` files and gitignored notes and whatnot littered all over the\nplace to make sure nothing got left behind.\n\nHowever just generally, colocating the sauce data with the actual folder\nintroduces a number of technical, security, and usability issues that\nare circumvented through central storage.\n\n### Cascaded loading\n\nA key feature of `sauce` is that values are loaded in a cascading\nfashion relative to the home directory.\n\nThis makes it easier to compose targets (env vars, aliases, and shell\nfunctions) among various locations, likely by utilizing the natural\ndirectory structure you might already have.\n\nGiven a directory structure\n\n    ~/\n      work/\n        project/\n          repo/\n          repo2/\n            src/\n        otherproject/\n\nSupport you run `sauce` at any folder level/depth, say\n`~/work/project/repo/`. The values saved for the folders: `~`, `~/work`,\n`~/work/project`, and `~/work/project/repo` will all be loaded.\n\nThe more specific/deep folder’s values will take precedence over the\nvalues of more general/shallow folders.\n\nAll saucefiles are located in the `$XDG_DATA_HOME/sauce` folder, after\nwhich the folder structure mirrors that of the folders who’s values are\nbeing tracked. Given the above example, if every folder had a saucefile,\nyou might see:\n\n    ~/.local/share/\n      sauce.toml\n      sauce/\n        project.toml\n        project/\n          repo.toml\n          repo2.toml\n          repo2/\n            src.toml\n        otherproject.toml\n\n### Autoloading\n\nSee the [Configuration Reference](./doc/config.md) on `autoload-hook`\nand `autoload`.\n\n## Local development\n\nFor local development, it can be useful to enable the `--feature dev`.\nThis alters the behavior so that the shell hook(s) point to the absolute\nlocation of the debug build.\n\nAn example alias that might be helpful could be:\n\n``` toml\n[alias]\nbuild = 'cargo build --features dev \u0026\u0026 eval \"$(./target/debug/sauce shell init)\"'\n```\n\nAt which point, you’re a quick `build` away from being able to `cd`\naround to test `sauce`, while always pointing at your project version of\n`sauce` for the current shell.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancardin%2Fsauce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdancardin%2Fsauce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancardin%2Fsauce/lists"}