{"id":28002940,"url":"https://github.com/galgeri/bash-modules","last_synced_at":"2025-07-04T12:32:19.753Z","repository":{"id":291585255,"uuid":"978003703","full_name":"galgeri/bash-modules","owner":"galgeri","description":"This project provides a modular system for managing Bash aliases, helper functions, and executables.","archived":false,"fork":false,"pushed_at":"2025-05-06T12:27:55.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T19:06:01.756Z","etag":null,"topics":["bash","bash-aliases","bashrc","bashrc-configs"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/galgeri.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-05T10:16:33.000Z","updated_at":"2025-05-06T12:27:58.000Z","dependencies_parsed_at":"2025-05-09T01:45:22.996Z","dependency_job_id":"e512c003-784f-4d13-9de1-ca5e3a61ac0c","html_url":"https://github.com/galgeri/bash-modules","commit_stats":null,"previous_names":["galgeri/bash-modules"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/galgeri/bash-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galgeri%2Fbash-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galgeri%2Fbash-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galgeri%2Fbash-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galgeri%2Fbash-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galgeri","download_url":"https://codeload.github.com/galgeri/bash-modules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galgeri%2Fbash-modules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263541114,"owners_count":23477454,"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":["bash","bash-aliases","bashrc","bashrc-configs"],"created_at":"2025-05-09T01:45:19.901Z","updated_at":"2025-07-04T12:32:19.728Z","avatar_url":"https://github.com/galgeri.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash Modules\n\n## Overview\n\nThis project provides a modular system for managing Bash aliases, helper functions, and executables. Everything is organized within your `~/.bash-modules` directory and loaded automatically when you open a terminal.\n\n## Features\n\n- Automatically loads Bash aliases, helpers, and scripts at shell startup\n- Modular organization for easy management and updates\n- Simple installation with a `Makefile`\n- Automatically adds custom scripts to your PATH\n\n## Directory Structure\n\nBelow is how the project is organized:\n\n```\n    ~/.bash-modules/\n    ├── bash-modules.sh          # Main loader script\n    ├── modules/\n    │   ├── aliases.d/           # Place your .aliases files here\n    │   ├── helpers.d/           # Place your .helper.sh files here\n    │   └── bin/                 # Place your executables here (added to PATH)\n    ├── Makefile                 # For installing\n```\n\n\n## Getting Started\n\n### 1. Clone This Repository\n\n```\ngit clone https://github.com/galgeri/bash-modules.git ~/.bash-modules\n```\n\n### 2. Install\n\nNavigate into the directory and run:\n\n```\ncd ~/.bash-modules\nmake install\n```\n\nThis ensures the loader is hooked into your `~/.bashrc` for automatic loading.\n\n### 3. Reload your shell\n\n```\nsource ~/.bashrc\n```\n\nOr open a new terminal window.\n\n---\n\n## How It Works\n\n- Any `.aliases` files in `modules/aliases.d/` are loaded as aliases\n- Any `.helper.sh` files with functions in `modules/helpers.d/` are loaded as Bash functions\n- Any scripts in `modules/bin/` are added to your `PATH` for easy execution\n\n---\n\n## Adding Your Own Modules\n\n**Add an alias:**\n\n1. Create a file such as `my.aliases` in `modules/aliases.d/`\n2. Add your aliases:\n\n```\nalias gs='git status'\n```\n\n**Add a helper function:**\n\n1. Create a file such as `git.helper.sh` in `modules/helpers.d/`\n2. Add your Bash functions:\n\n```\nmy_func() {\n    echo \"Hello from bash-modules!\"\n}\n```\n\n**Add an executable script:**\n\n1. Place the script in `modules/bin/`\n2. Make sure it is executable:\n\n```\nchmod +x modules/bin/my_script\n```\n\n---\n\n# Managing Your Private or Shared Modules Repository\n\nYou can manage your entire `modules/` directory as a Git repository. This makes it easy to back up, sync, or share all your Bash modules (aliases, helpers, scripts) across systems or with collaborators.\n\n## Initializing a New Modules Repository\n\nTo set up a new, personal or private Git repository containing your modules directory:\n\n- Run `make init-modules-repo`\n- This will initialize a new git repository in the `modules/` directory and prompt you to enter a remote repository URL.\n- After setting the remote, you can commit and push your modules as needed.\n\n## Cloning an Existing Modules Repository\n\nTo use an existing modules repository (for example, from another machine or a shared configuration):\n\n- Run `make clone-modules-repo`\n- You’ll be prompted for the remote repository URL.\n- The command will **remove any existing `modules/` directory** and clone the repository from the given URL into `modules/`.\n- Make sure to back up or commit any local changes before proceeding, as this operation cannot be undone.\n\n## Typical Workflow\n\n- Use `make init-modules-repo` if you want to start tracking your `modules/` directory with a new repository.\n- Use `make clone-modules-repo` to pull down an existing set of modules and replace your current set completely.\n\n---\n\n**Note:**  \nThese commands assume your project is located at `~/.bash-modules` and operate on the `modules/` directory found there.\n\nFor more information about available commands, run `make help`. This will list all available Makefile targets and provide brief usage instructions.\n\n---\n\n## Uninstallation\n\n1. Edit your `~/.bashrc` and remove this line:\n\n```\nsource $HOME/.bash-modules/bash-modules.sh\n```\n\n2. Delete the directory if desired:\n\n```\nrm -rf ~/.bash-modules\n```\n\n---\n\n## Troubleshooting\n\n- Ensure that `~/.bash-modules` is used exactly as the directory name/location.\n- If `make install` raises a path error, move the directory as instructed.\n- Make sure file extensions are correct for aliases and helpers.\n- Scripts in `modules/bin/` must be executable.\n\n---\n\n## License\n\nBash Modules © 2025 by Gergely Gál is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalgeri%2Fbash-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalgeri%2Fbash-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalgeri%2Fbash-modules/lists"}