{"id":13478907,"url":"https://github.com/nathanchapman/bash-functions","last_synced_at":"2025-10-12T05:45:15.641Z","repository":{"id":98102857,"uuid":"153919689","full_name":"nathanchapman/bash-functions","owner":"nathanchapman","description":"🔮 A collection of useful Bash/ZSH functions","archived":false,"fork":false,"pushed_at":"2020-12-23T23:46:54.000Z","size":40,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T18:57:32.686Z","etag":null,"topics":["bash","bash-script","bashrc","functions","oh-my-zsh","zsh","zsh-functions","zshell","zshrc"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/nathanchapman.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}},"created_at":"2018-10-20T15:26:56.000Z","updated_at":"2024-11-01T23:34:29.000Z","dependencies_parsed_at":"2023-05-23T17:30:37.531Z","dependency_job_id":null,"html_url":"https://github.com/nathanchapman/bash-functions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanchapman%2Fbash-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanchapman%2Fbash-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanchapman%2Fbash-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanchapman%2Fbash-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanchapman","download_url":"https://codeload.github.com/nathanchapman/bash-functions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238874256,"owners_count":19545145,"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-script","bashrc","functions","oh-my-zsh","zsh","zsh-functions","zshell","zshrc"],"created_at":"2024-07-31T16:02:05.624Z","updated_at":"2025-10-12T05:45:10.605Z","avatar_url":"https://github.com/nathanchapman.png","language":"Shell","readme":"# 🔮 bash-functions\n\nA collection of useful Bash/ZSH functions. Just drop the functions from [.bashrc](.bashrc) at the end of your `.bashrc` or `.zshrc`. These work great with the [MacBook touch bar](#-iterm2-touch-bar-support) and [iTerm2](https://www.iterm2.com/).\n\n## Usage\n\n### 📦 Open a module on npmjs.com\n\nFrom anywhere:\n\n```bash\nnpmjs # opens npmjs.com\nnpmjs \u003cmodule\u003e # opens npmjs.com for npm module \u003cmodule\u003e\n```\n\nFrom a git repo:\n\n```bash\nnpmjs # opens npmjs.com for npm module \u003cgit-repo\u003e\n```\n\n### 🤖 Clone any repo and 🚚 cd into it\n\nFrom anywhere:\n\n```bash\nclone url # clone a repo from any git URL and cd into it\nclone org repo # clone a repo from GitHub and cd into it\nclone org/repo # clone a repo from GitHub and cd into it\n```\n\n### 🍴 Fork a GitHub repo\n\nFrom anywhere:\n\n```bash\nghfork url # fork a repo from any GitHub URL and cd into it\nghfork org repo # fork from GitHub and cd into it\nghfork org/repo # fork from GitHub and cd into it\n```\n\n### 🐙 Open GitHub\n\nFrom anywhere:\n\n```bash\ngithub # opens GitHub\ngithub org # opens GitHub for org\ngithub org/repo # opens GitHub for org/repo\ngithub org repo # opens GitHub for org/repo\n```\n\nFrom a git repo:\n\n```bash\ngithub # opens this repo in GitHub for current branch\ngithub \u003cbranch\u003e # opens this repo in GitHub for specified branch\n```\n\n### 🔃 Open the pull requests for a repo\n\nFrom anywhere:\n\n```bash\npulls # opens GitHub for all pull requests for user\npulls org repo # opens GitHub for all pull requests for org/repo\n```\n\nFrom a git repo:\n\n```bash\npulls # opens GitHub for all pull requests for this repo\n```\n\n### ✏️ Create a pull request for a repo\n\nFrom anywhere:\n\n```bash\npr \u003corg\u003e \u003crepo\u003e \u003cbase\u003e \u003cbranch\u003e # opens GitHub to draft a pull request in org/repo to merge \u003cbranch\u003e into \u003cbase\u003e\n```\n\nFrom a git repo:\n\n```bash\npr # opens GitHub to draft a pull request in this repo to merge the current branch into master\npr \u003cbase\u003e # opens GitHub to draft a pull request in this repo to merge the current branch into \u003cbase\u003e\npr \u003cbase\u003e \u003cbranch\u003e # opens GitHub to draft a pull request in this repo to merge \u003cbranch\u003e into \u003cbase\u003e\n```\n\n### 🔬 Review and test a pull request for a repo\n\nFrom a git repo:\n\n```bash\nreview \u003cnumber\u003e # checks out PR #\u003cnumber\u003e into a local branch named \u003cnumber\u003e for review/testing\nreview \u003cnumber\u003e \u003cbranch\u003e # checks out PR #\u003cnumber\u003e into a local branch named \u003cbranch\u003e for review/testing\n```\n\n## 💻 iTerm2 Touch Bar Support\n\n![iTerm2 Touch Bar](./assets/iterm2-touch-bar.png)\n\nIn iTerm2, navigate to `Preferences` \u003e `Keys` and `Add Touch Bar Item` for each of the following items. After, navigate to the `View` dropdown \u003e `Customize Touch Bar...` and drag them where you'd like 😎.\n\n### Npm\n\nLabel: `📦`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`npmjs\\r`\n\n### Clone\n\nLabel: `🤖`\n\nAction: `Send Text`\n\n`clone YourOrg `\n\n### VS Code / Atom / Sublime\n\nLabel: `🚧` or `🔭` or `👩‍💻` or `👨‍💻` or `⚛️`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`code .\\r` or `atom .\\r` or `subl .\\r`\n\n### Git Pull\n\nLabel: `👇`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`git pull\\r`\n\n### Git Push\n\nLabel: `👆`\n\nAction: `Send Text`\n\n`git push `\n\n### GitHub\n\nLabel: `🐙`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`github\\r`\n\n### Git Status\n\nLabel: `📟`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`gst\\r`\n\n### Npm Install\n\nLabel: `📀`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`npm i\\r`\n\n### Npm Start\n\nLabel: `⚡️` or `🏁`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`npm start\\r`\n\n### Npm Test\n\nLabel: `🔬`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`npm t\\r`\n\n### Draft PR\n\nLabel: `✏️`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`pr\\r`\n\n### View PRs\n\nLabel: `🔃`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`pulls\\r`\n\n### Spotify Play/Pause\n\nNOTE: Requires [shpotify](https://github.com/hnarayanan/shpotify).\n\nLabel: `🎸` or `🎧` or `🎵` or `🎷`\n\nAction: `Send Text with \"vim\" Special Chars`\n\n`spotify pause\\r`\n\n## Sponsorship 🎗\n\nIf you found this project useful, please consider becoming a [sponsor on GitHub](https://github.com/sponsors/nathanchapman).\n","funding_links":["https://github.com/sponsors/nathanchapman"],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanchapman%2Fbash-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanchapman%2Fbash-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanchapman%2Fbash-functions/lists"}