{"id":21185814,"url":"https://github.com/erikjuhani/shm","last_synced_at":"2025-07-23T13:35:57.750Z","repository":{"id":113575837,"uuid":"589717786","full_name":"erikjuhani/shm","owner":"erikjuhani","description":"A simple script manager for shell scripts","archived":false,"fork":false,"pushed_at":"2024-08-24T20:39:23.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T20:16:35.699Z","etag":null,"topics":["posix","script-manager","shell","shell-script"],"latest_commit_sha":null,"homepage":"","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/erikjuhani.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,"publiccode":null,"codemeta":null}},"created_at":"2023-01-16T19:17:18.000Z","updated_at":"2024-08-24T20:39:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"b428fdbb-5672-4f48-98f2-1373626a4bb9","html_url":"https://github.com/erikjuhani/shm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erikjuhani/shm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikjuhani%2Fshm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikjuhani%2Fshm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikjuhani%2Fshm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikjuhani%2Fshm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikjuhani","download_url":"https://codeload.github.com/erikjuhani/shm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikjuhani%2Fshm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266689371,"owners_count":23969142,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["posix","script-manager","shell","shell-script"],"created_at":"2024-11-20T18:19:08.113Z","updated_at":"2025-07-23T13:35:57.693Z","avatar_url":"https://github.com/erikjuhani.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shm\n\nA simple script manager for shell scripts\n\n## Installation\n\nEasiest way to install `shm` is with one of the below oneliners. You can also\njust download `shm.sh` and place it in `$HOME/.shm` directory.\n\ncurl:\n\n```sh\ncurl -sSL https://raw.githubusercontent.com/erikjuhani/shm/main/shm.sh | sh\n```\n\nwget:\n\n```sh\nwget -qO- https://raw.githubusercontent.com/erikjuhani/shm/main/shm.sh | sh\n```\n\nThe initial setup handles setting `SHM_DIR` to `$PATH`. `shm` uses `.profile`\nfile. The instructions are printed for the user in the installation logs that\nare output to stdout.\n\n`shm` assumes that `SHM_DIR` exists for it to perform any regular actions,\notherwise it `shm` will try to install itself and initialize `SHM_DIR`.\n\n## Usage\n\n```sh\nshm [\u003ccommand\u003e] [\u003cargs\u003e] [-h | --help]\n```\n\n### Get\n\nTo download and install shell scripts use `get` command. Get command fetches\nthe script from github repository, when given `\u003cowner\u003e/\u003crepository\u003e` string as\nthe argument.\n\n```sh\nshm get erikjuhani/datef\n```\n\nThe script is then dowloaded to appropriate directory under `SHM_DIR`. The file\nis saved under following tree: `.shm/\u003cscriptname\u003e.d/\u003cscriptname\u003e[@\u003ccommit_sha\u003e]`,\nthen the script is symlinked to root of `.shm` folder.\n\n#### Gists\n\nWhen given `-g | --gist` flag, get command fetches a `\u003cgist\u003e` with given\n`\u003cgist_id\u003e` instead of `\u003cowner\u003e/\u003crepository\u003e`.\n\n```sh\nshm get -g baa58da5c3dd1f69fae9\n=\u003e fetching gist info\n   + found gist\n=\u003e downloading jwtRS256.sh\n   + jwtRS256.sh\n=\u003e creating symlink\n   + /Users/erik/.shm/jwtRS256.d/jwtRS256@HEAD -\u003e /Users/erik/.shm/jwtRS256\n```\n\n#### Binaries\n\nWhen given `-b | --bin` flag, get command fetches a binary file associated with\nthe given repository. The binary file is fetched from github releases and\nmatched with the users operating system and architecture.\n\n```sh\nshm get --bin cli/cli\n=\u003e downloading binary\n   + gh_2.39.2_macOS_arm64.zip\n=\u003e unpacking archive\n   + unpacked gh_2.39.2_macOS_arm64.zip\n=\u003e copying binary\n   + gh -\u003e /Users/erik/.shm/gh\n```\n\n### List\n\nLists all installed symlinked scripts in SHM_DIR.\n\n```sh\nshm ls\n```\n\n### Remove\n\nRemove installed symlinked script from SHM_DIR.\n\n```sh\nshm rm \u003cscript_name\u003e\n```\n\n### Add\n\nAdds a script to shm from local path. All local scripts will be interpreted as\nHEAD, which means only one version is ever kept of the local script file.\n\n```sh\nshm.sh add local_script.sh\n=\u003e copying file /Users/erik/local_script.sh\n=\u003e creating symlink\n   + /Users/erik/.shm/local_script.d/local_script@HEAD -\u003e /Users/erik/.shm/local_script\n```\n\nAny existing script can also be overwritten with the `-f` or `--force` flag.\n\n```sh\nshm.sh add -f local_script.sh\n=\u003e copying file /Users/erik/local_script.sh\n=\u003e creating symlink\n   + /Users/erik/.shm/local_script.d/local_script@HEAD -\u003e /Users/erik/.shm/local_script\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikjuhani%2Fshm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikjuhani%2Fshm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikjuhani%2Fshm/lists"}