{"id":18980514,"url":"https://github.com/tmslnz/shellrc","last_synced_at":"2025-11-11T08:02:21.836Z","repository":{"id":227904874,"uuid":"772685093","full_name":"tmslnz/shellrc","owner":"tmslnz","description":"Shell configuration","archived":false,"fork":false,"pushed_at":"2024-04-13T21:17:02.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T12:02:53.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmslnz.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null}},"created_at":"2024-03-15T17:22:48.000Z","updated_at":"2024-04-15T12:07:06.704Z","dependencies_parsed_at":"2024-03-15T18:43:38.105Z","dependency_job_id":"5f75303d-bd98-4f59-aba0-01b64d9bdeaf","html_url":"https://github.com/tmslnz/shellrc","commit_stats":null,"previous_names":["tmslnz/shellrc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmslnz%2Fshellrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmslnz%2Fshellrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmslnz%2Fshellrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmslnz%2Fshellrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmslnz","download_url":"https://codeload.github.com/tmslnz/shellrc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985731,"owners_count":19729515,"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-08T16:07:00.530Z","updated_at":"2025-11-11T08:02:16.818Z","avatar_url":"https://github.com/tmslnz.png","language":"Shell","readme":"# ~/.shellrc\nComprehesive and portable environment configuration in a single file.\n\n- [Install](#install)\n- [Update](#update)\n- [Conventions](#conventions)\n- [Supported Tools](#supported-tools)\n- [Utility Functions](#utility-functions)\n\n## Overview\nThe goal of this script to **safely(1)** and **predictably(2)** store and update CLI and other app configurations from a single source, without using symlinks, Git or other more complex tools.\n\nA single `source ~/.shellrc` *should* configure the shell environment and any supported (and installed) tools.\n\n**(1) Safely:**\nConfiguration values coming from `.shellrc` are either appended or prepended to existing config files, in such a way that pre-existing user settings are preserved.\n\n`.shellrc`'s `main()` runs only under interactive shells and with `set -euf` for additional safety. These values are restored to `set +euf` on success.\n\n**(2) Predictably:**\nConfigurations are only written for the tools that are already present in the system to minimise clobbering the `~/` and `~/.config` dirs.\n\n## Install\n```\ncurl -fsSL https://raw.githubusercontent.com/tmslnz/shellrc/main/shellrc -o ~/.shellrc\n. ~/.shellrc\n```\n\n## Update\n`.shellrc` automatically checks for updates.\n\nThe last snapshot can be restored using:\n```\nshellrc revert\n```\n\nUpdates can be manually requested using:\n```\nshellrc update\n```\n\nThe updater saves previous versions in `~/.config/shellrc/snapshots`\n\n## Conventions\n\nAll code in the script is wrapped in funsctions.\n\nThere are two classes of functions in the script:\n- `_shellrc_*`: persistent in the session. These are utilities called throughout the script.\n- `configure_*`: called once, then `unset -f` to remove them from the symbols list.\n\nThe execution flow is controlled in `main()`.\n\nThe script writes all configurations conditionally (i.e: `x in PATH`, `OS == Darwin`) and only within \"fenced\" sections (e.g. `BEGIN_SHELLRC [...] END_SHELLRC`).\nLocal changes _outside_ of a fenced section are never over-written.\nLocal changes _within_ a fenced section are also not overwritten if the edits are more recent than the `~/.shellrc` file's last updated timestamp.\n\n## Supported Tools\n\n### Bash\nhttps://www.gnu.org/software/bash/\n\n### Bash Completion\nhttps://github.com/scop/bash-completion\n\n### Z shell\nhttps://www.zsh.org\n\n### ssh\nhttps://github.com/sharkdp/fd\n\n### grep\nhttps://en.wikipedia.org/wiki/Grep\n\n### Emacs\nhttps://www.gnu.org/software/emacs/\n\n### Vim\nhttps://www.vim.org/\n\n### Nano\nhttps://www.nano-editor.org\n\n### NPM\nhttps://www.npmjs.com\n\n### Git\nhttps://git-scm.com\n\n### Wget\nhttps://www.gnu.org/software/wget/\n\n### fd\nhttps://github.com/sharkdp/fd\n\n### fzf\nhttps://github.com/junegunn/fzf\n\n### Zoxide\nhttps://github.com/ajeetdsouza/zoxide\n\n### Perlbrew\nhttps://perlbrew.pl\n\n### SDKMAN!\nhttps://sdkman.io\n\n### pyenv\nhttps://github.com/pyenv/pyenv\n\n### python\nhttps://www.python.org\n\n### python argcomplete\nhttps://kislyuk.github.io/argcomplete/\n\n### direnv\nhttps://direnv.net\n\n### broot\nhttps://dystroy.org/broot/\n\n### ncdu - NCurses Disk Usage\nhttps://dev.yorhel.nl/ncdu\n\n### automysqlbackup\nhttps://sourceforge.net/projects/automysqlbackup/\n\n### GoAccess\nhttps://goaccess.io\n\n### Composer\nhttps://getcomposer.org\n\n### shdotenv\nhttps://github.com/ko1nksm/shdotenv\n\n## Utility Functions\n\n#### `get_user_home \u003cusername\u003e`\n\n#### `remove_host_key_at_line \u003cline\u003e`\n\n#### `list_all_binaries`\n\n#### `zap \u003cdir\u003e`\n\n#### `git_lf \u003cdir\u003e`\n\n#### `git_freeze_submodule \u003cpath\u003e`\n\n#### `configure_nebula`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmslnz%2Fshellrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmslnz%2Fshellrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmslnz%2Fshellrc/lists"}