{"id":21074791,"url":"https://github.com/dawsbot/pluc","last_synced_at":"2025-07-15T14:17:40.872Z","repository":{"id":57326029,"uuid":"80094425","full_name":"dawsbot/pluc","owner":"dawsbot","description":":ok_hand: Instant terminal aliases","archived":false,"fork":false,"pushed_at":"2018-11-29T16:26:16.000Z","size":73,"stargazers_count":27,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-28T14:59:27.048Z","etag":null,"topics":["alias","developer-tools","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dawsbot.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}},"created_at":"2017-01-26T07:33:03.000Z","updated_at":"2024-05-25T18:26:58.000Z","dependencies_parsed_at":"2022-09-21T01:52:40.326Z","dependency_job_id":null,"html_url":"https://github.com/dawsbot/pluc","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fpluc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fpluc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fpluc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fpluc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawsbot","download_url":"https://codeload.github.com/dawsbot/pluc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225411493,"owners_count":17470246,"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":["alias","developer-tools","shell","terminal"],"created_at":"2024-11-19T19:18:01.048Z","updated_at":"2024-11-19T19:18:02.336Z","avatar_url":"https://github.com/dawsbot.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/logo.png\" alt=\"logo\"/\u003e\n\u003c/p\u003e\n\n\u003e :ok_hand: Create permanent terminal aliases instantly\n\n⚠️Under construction, beware of breaking changes ⚠️\n\n\n\u003cbr/\u003e\n\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n\n## Usage\n\nSave a new alias forever\n\n```sh\n$ pluc \u003calias\u003e \u003ccommand\u003e\n```\n\nLeave out \"`command`\" and pluc will use your last command from shell history.\n\n```sh\n$ pluc \u003calias\u003e\n```\n\n\u003cbr/\u003e\n\nHere's what this could look like:\n\n```sh\n$ pluc serve \"python -m SimpleHTTPServer\"\n\n👌 Aliased \"serve\" to \"python -m SimpleHTTPServer\" 👌\n```\n\nor\n\n```sh\n$ pluc ya \"yarn add\"\n\n👌 Aliased \"ya\" to \"yarn add\" 👌\n\n$ ya react #Your new alias is instantly usable\n\n```\n\n\u003cbr/\u003e\n\n## Install\n\n1. npm install\n\n```sh\n$ npm install --global pluc\n```\n\n2. Source pluc in your shell\n\nNow source the pluc output file in your shell. Paste this in your bash profile (~/.bashrc, ~/.zshrc, ~/.bash_profile, , or ~/.profile).\n\n```sh\nsource \"$(pluc-cli --destinationPath)\" #source pluc aliases on shell startup\nfunction pluc() { #call pluc-cli and source new alias immediatly\n  pluc-cli \"$@\"\n  source \"$(pluc-cli --destinationPath)\"\n}\n```\n\nShould you ignore the above bash code, you'd need to manually resource the pluc shell file per session **and** after adding a new alias.\n\n\u003cbr/\u003e\n\n## Verify Installation\n\n```sh\n$ pluc --sourcePath\n# Should output a json filepath, not an error.\n```\n\nYour bash aliases are generated from that JSON object. You don't need to pay attention to that in most cases. That's covered in depth in the \"About\" section below.\n\n\u003cbr/\u003e\n\n## More Examples\n\nImagine you ssh to this machine often:\n\n```sh\n$ ssh username@username.example.org\n# ssh: Successfully ssh'd to example.org!\n```\n\nBut truly, you do that most days. Why should you type it out?\n\n```sh\n$ pluc sshme\n# 👌 Aliased \"sshme\" to \"ssh username@username.example.org\" 👌\n\n$ sshme\n# ssh: Successfully ssh'd to example.org!\n```\n\nNot only is the alias `sshme` instantly available, it's forever available in any new sessions. The alternative is to save an `alias` in your bash profile. It's not only time consuming to open and edit, but you won't be able to use that alias until you `source` it.\n\n\u003cbr/\u003e\n\nOr let's say you do web development and need a web server often:\n\n```sh\n$ pluc serve \"python -m SimpleHTTPServer\"\n# 👌 Aliased \"serve\" to \"python -m SimpleHTTPServer\" 👌\n\n$ serve\n# Serving HTTP on 0.0.0.0 port 8000 ...\n```\n\nAlthough it's always recommended that you quote the command for safety with bash argument splitting, your second argument **can** contain spaces! Parsing of this is done on your behalf by `pluc`. If your command contains flags though, you must quote it, which is why it's not a good habit.\n\n\u003cbr/\u003e\n\nIf you want to see the full list of commands:\n\n```sh\n$ pluc --help\n```\n\n\u003cbr/\u003e\n\n## About\n\n`pluc` uses a single JSON object to store aliases. Since JSON is already key-value based, it's a perfect data format. To manually edit the JSON source file (**you absolutely will eventually**) enter\n\n```sh\n$ $EDITOR $(pluc --sourcePath)\n```\n\nAfter any new alias is added to `pluc`, the `render` function is called which builds a shell file. The shell output is what you `source`'d at the very beginning. To see it right now, enter\n\n```sh\n$ $EDITOR $(pluc --destinationPath)\n```\n\n:warning: Do not edit the output shell file, it gets deleted on re-render (often) :warning:\n\n\u003cbr/\u003e\n\n## Backup important aliases\n\nAre you saving important aliases or a large amount of them? If so, back these up.\n\n#### Backup to Dropbox\n\nFirst find the path your config file is saved in:\n\n```sh\n$ pluc --sourcePath\n# /Users/dawsonbotsford/Library/Preferences/pluc-nodejs/config.json\n```\n\nThis file needs to be moved into Dropbox and symlinked back to the original location\n\n```sh\nmv /Users/dawsonbotsford/Library/Preferences/pluc-nodejs/config.json ~/Dropbox/\nln -s ~/Dropbox/config.json /Users/dawsonbotsford/Library/Preferences/pluc-nodejs/config.json\n```\n\n#### Backup to git\n\nAlternatively, use git to manually version control.\n\n```sh\n$ pluc --sourcePath\n# /Users/dawsonbotsford/Library/Preferences/pluc-nodejs/config.json\n$ cd /Users/dawsonbotsford/Library/Preferences/pluc-nodejs\n$ git init\n# add remote, and push!\n```\n\n\u003cbr/\u003e\n\n## FAQ\n\n* Why not use the `source` command in my terminal?\n  * `source` is only available within your current shell. As soon as you start a new session, your alias is gone.\n\n* How can I edit my aliases?\n  * `$ $EDITOR $(pluc --sourcePath)`\n\n\n* Why store the data as a JSON object?\n  * If JSON objects are used as the source of truth, a variety of render methods can be used. This means that **any** output format (`vimrc`, sublime snippets, etc.) which is key-value based can be generated using `pluc`.\n\n* What's one of these \"pluc JSON objects\" actually look like?\n\n```json\n{\n  \"gi\": \"git init\",\n  \"ga\": \"git add\"\n}\n```\n\n* The history inferred by `pluc \u003calias\u003e` alone is not accurate.\n  * History is obtained with [@dawsbot/shell-history](https://github.com/dawsbot/shell-history). Please open an issue there.\n\n\u003c!-- * How can I add a new render method?\n  1. Create and test a render function as a standalone module. (Fork [build-shell-fn](https://github.com/dawsbot/build-shell-fn))\n  2. Add a transpile method in [index.js](./src/index.js). (Copy `transpileJSON()`)\n  3. Add a flag for render function within [cli.js](./src/cli.js)\n  4. Document the new render method in the `--help` in `src/cli.js`\n  5. PR!\n --\u003e\n## Compatibility Issues\n\n* `pluc` will not create valid aliases on Windows. Windows does not save terminal history.\n\n* `pluc` will not work with `fish` shell. It likely will not work for shells beyond bash or zsh. This is because of the `parse` function in [`@dawsbot/shell-history`](https:///github.com/dawsbot/shell-history) package. PR's welcome.\n\n## License\n\nMIT © [Dawson Botsford](http://dawsonbotsford.com)\n\n[npm-image]: https://badge.fury.io/js/pluc.svg\n[npm-url]: https://npmjs.org/package/pluc\n[travis-image]: https://travis-ci.org/dawsbot/pluc.svg?branch=master\n[travis-url]: https://travis-ci.org/dawsbot/pluc\n[xo-image]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg\n[xo-url]: https://github.com/sindresorhus/xo\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Fpluc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawsbot%2Fpluc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Fpluc/lists"}