{"id":20502358,"url":"https://github.com/sonph/stash","last_synced_at":"2025-07-06T16:32:35.135Z","repository":{"id":25676675,"uuid":"29112592","full_name":"sonph/stash","owner":"sonph","description":"Persistent shell variables and values across sessions.","archived":false,"fork":false,"pushed_at":"2015-01-12T03:04:34.000Z","size":132,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T11:04:55.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T01:04:56.000Z","updated_at":"2015-01-12T18:55:23.000Z","dependencies_parsed_at":"2022-08-06T07:00:17.001Z","dependency_job_id":null,"html_url":"https://github.com/sonph/stash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sonph/stash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonph%2Fstash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonph%2Fstash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonph%2Fstash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonph%2Fstash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonph","download_url":"https://codeload.github.com/sonph/stash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonph%2Fstash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263934890,"owners_count":23532219,"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","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":[],"created_at":"2024-11-15T19:21:36.350Z","updated_at":"2025-07-06T16:32:35.119Z","avatar_url":"https://github.com/sonph.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What\n`stash` is a simple Python script used to quickly save and access values in the shell across different sessions.\n\n# Why\nA lot of times I need to use some values over and over again such as a server's IP address or a path.\n\nFor example:\n\n    scp -R somepath 69.59.69.59:~/\n    ssh 69.59.69.59\n\nSaving these into environment variables is a viable solution but they do not persist across different shell session, so you'll have to redefine the value in new sessions.\n\nStoring them into dotfiles is simple, just `echo VAR=value \u003e\u003e ~/.zshenv`, but what if you want to change them or \"refresh\" in existing sessions (or maybe in different `tmux` tabs)? `source ~/.zshenv` everytime is surely too much of a hassle.\n\n# How\n* `stash \u003ckey\u003e \u003cvalue\u003e` to save a value\n* or `\u003ccmd\u003e | stash \u003ckey\u003e --stdin` to save a value\n* `` `stash \u003ckey\u003e` `` or `$(stash \u003ckey\u003e)` to acess a value\n\nOr better yet, if you are using `zsh` (this can't be done in `bash` AFAIK), alias `$` to `stash` with `echo \"alias \\$='\u003cpath-to-stash\u003e'\" \u003e\u003e ~/.zshrc` so you can do\n\n* `$ \u003ckey\u003e \u003cvalue\u003e` to save\n* `` `$ \u003ckey\u003e` `` to access a value\n\nWith this, now you can do:\n\n    $ AWS 69.59.69.59\n    scp -R somepath `$ AWS`:~/\n    # and in another shell\n    ssh `$ AWS`\n\nas it is possible to save and access from anywhere you have access to `stash` without ever having to reload.\n\n# Install\nIn `zsh`:\n\n    wget -O $HOME/.stash https://raw.githubusercontent.com/sonph/stash/master/stash \u0026\u0026 chmod u+x $HOME/.stash \u0026\u0026 echo \"alias \\$='$HOME/.stash'\" \u003e\u003e $HOME/.zshrc\n\nIn `bash`:\n\n    wget -O $HOME/.stash https://raw.githubusercontent.com/sonph/stash/master/stash \u0026\u0026 chmod u+x $HOME/.stash \u0026\u0026 echo \"alias stash='$HOME/.stash'\" \u003e\u003e $HOME/.bashrc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonph%2Fstash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonph%2Fstash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonph%2Fstash/lists"}