{"id":15578865,"url":"https://github.com/oleq/nodeprompt","last_synced_at":"2025-04-24T01:27:36.186Z","repository":{"id":16618610,"uuid":"19373552","full_name":"oleq/nodeprompt","owner":"oleq","description":"Pretty Git prompt for Bash","archived":false,"fork":false,"pushed_at":"2022-10-21T17:27:49.000Z","size":1299,"stargazers_count":18,"open_issues_count":10,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T08:50:00.906Z","etag":null,"topics":["bash","bash-prompt","git","nodejs","prompt"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"saltstack-formulas/php-formula","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleq.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":"2014-05-02T11:34:00.000Z","updated_at":"2024-09-04T22:28:58.000Z","dependencies_parsed_at":"2023-01-11T19:23:46.950Z","dependency_job_id":null,"html_url":"https://github.com/oleq/nodeprompt","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleq%2Fnodeprompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleq%2Fnodeprompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleq%2Fnodeprompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleq%2Fnodeprompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleq","download_url":"https://codeload.github.com/oleq/nodeprompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250543166,"owners_count":21447847,"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-prompt","git","nodejs","prompt"],"created_at":"2024-10-02T19:13:12.695Z","updated_at":"2025-04-24T01:27:36.160Z","avatar_url":"https://github.com/oleq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nodeprompt\n==================================================\n\n[![npm version](https://badge.fury.io/js/nodeprompt.svg)](https://www.npmjs.com/package/nodeprompt)\n[![Build Status](https://travis-ci.org/oleq/nodeprompt.svg?branch=master)](https://travis-ci.org/oleq/nodeprompt)\n[![Dependency Status](https://img.shields.io/david/oleq/nodeprompt.svg)](https://david-dm.org/oleq/nodeprompt)\n[![devDependency Status](https://img.shields.io/david/dev/oleq/nodeprompt.svg)](https://david-dm.org/oleq/nodeprompt?type=dev)\n\nA smart Git prompt for your terminal powered by Node.js.\n\n![Staged, unstaged and untracked files](demo/git-various.png?raw=true)\n\n## Requirements\n\n### System\n\n* Bash 3.2.x\n* [Fish](https://fishshell.com/) 2.5.x\n* Zsh 5.3\n* [Node.js](https://nodejs.org/) (tested with 0.10.x, 5.7.x, 6.9.x, 10.x).\n* [Git](https://git-scm.com/) (tested with 1.9.x, 2.7.x, 2.11.x, 2.14.x, 2.25.x).\n\n**Note:** There is a good change Nodeprompt will work with other configurations — just give it a shot and let me know!\n\n### Font\n\n**Since v2.0.0 Nodeprompt requires some special (powerline) symbols to be supported by the terminal font to render properly.**\n\nSome fonts support those symbols (glyphs) out–of–the–box, for instance, [Fira Code](https://github.com/tonsky/FiraCode) used in examples below. Many open–source fonts have been patched and [can be downloaded from GitHub](https://github.com/powerline/fonts). If neither works for you, you can google \"[your font name] powerline\" because it's likely someone patched your favorite font and posted it on–line.\n\n**A note for iTerm 2 users**: Make sure the powerline–compatible font is enabled in both  `Profiles \u003e Text \u003e Font` and `Profiles \u003e Text \u003e Non–ASCII Font`.\n\n## Examples\n\n### A plain folder (no Git)\n\n![A simple folder](demo/no-git.png?raw=true)\n\n### An empty Git repository\n\n![An empty Git repository](demo/git-init.png?raw=true)\n\n### Unstaged changes\n\n![Unstaged changes](demo/git-unstaged.png?raw=true)\n\n### Staged, unstaged and untracked\n\n![Staged, unstaged and untracked files](demo/git-various.png?raw=true)\n\n### Branch ahead of the remote\n\n![Branch ahead](demo/git-ahead.png?raw=true)\n\n### Merge conflict\n\n![Merge conflict](demo/git-merge-conflict.png?raw=true)\n\n## Installation\n\n1. Call `npm install -g nodeprompt` (or `yarn global add nodeprompt`).\n2. Configure your shell:\n\n\t### Bash\n\n\tPut the following line:\n\n\t```bash\n\t. nodeprompt-enable-bash\n\t```\n\n\tin your `~/.bashrc` or `~/.bash_profile` file. Re\u0026ndash;open the terminal window or source the file, e.g. `source ~/.bashrc`.\n\n\t### Zsh\n\n\tPut the following lines:\n\n\t```bash\n\t. nodeprompt-enable-zsh\n\t```\n\n\tin your `~/.zshrc` file. Re\u0026ndash;open the terminal window or `source ~/.zshrc`.\n\n\t### Fish\n\n\tCreate a symbolic link to the `fish_prompt.fish` function file:\n\n\t```bash\n\tln -s /path/to/../nodeprompt/bin/fish_prompt.fish ~/.config/fish/functions/fish_prompt.fish\n\t```\n\n\tRe\u0026ndash;open the terminal window.\n\n1. Enjoy your beautiful prompt!\n\n## Configuration and customization\n\nNodeprompt is configurable and things like the length of the SHA-1 hash or the number of levels displayed in the path can be adjusted. It is also possible to create a new prompt template from scratch, if that's what you want to do tonight.\n\n**Note**: You **don't** have to configure Nodeprompt. By default, it uses [`config.default.js`](https://github.com/oleq/nodeprompt/blob/master/config.default.js).\n\nThe config file is a plain Node.js module. To configure your prompt, create a `~/.nodeprompt/config.user.js` file with `module.exports`:\n\n```js\nmodule.exports = {\n    option: 'value'\n};\n```\n\nor simply copy [the default configuration](https://github.com/oleq/nodeprompt/blob/master/config.default.js) and modify it. Refer to the [documentation](https://github.com/oleq/nodeprompt/blob/master/config.default.js) to learn more.\n\n## Using as a library\n\nNodeprompt can be used as a utility to obtain the status of the Git repository. Use the `model` property to build your own prompt or logger on top of the library:\n\n```js\nconst Nodeprompt = require( './lib/nodeprompt.js' );\nconst prompt = new Nodeprompt();\n\nconsole.log( prompt.model );\n\n\u003e {\n\tpwd: '/Users/oleq/nodeprompt',\n\thome: '/Users/oleq',\n\tgitDir: '.git',\n\tisGit: true,\n\thostname: 'MBP',\n\tusername: 'oleq',\n\tpath: [ '~', 'nodeprompt' ],\n\tnamerev: 'v1.0',\n\thead: 'ref: refs/heads/v1.0',\n\thash: 'b22bb89',\n\tmergeHead: '',\n\tisInit: false,\n\tisBisecting: false,\n\tisDetached: false,\n\tisMerging: false,\n\tmodified: 2,\n\tadded: 0,\n\tuntracked: 0,\n\tahead: 2,\n\tbehind: 0,\n\tbranch: 'v1.0',\n\thasDiverged: false\n}\n```\n\n## Found a bug?\n\nCreate an issue [here](https://github.com/oleq/nodeprompt/issues).\n\n## How to contribute?\n\nClone the repository to `/path/to/nodeprompt` and put `. /path/to/nodeprompt/bin/nodeprompt-bash` in your `~/.bashrc` or `~/.bash_profile` file. Source it or restart the terminal.\n\n## License\n\nMIT/X11. See the [LICENSE](LICENSE) file to know more.\n\n## Misc\n\nKudos to [Leonid Volnitsky](https://github.com/lvv) for [git-prompt](https://github.com/lvv/git-prompt), an inspiration to create this project.\n\n## Tests and development\n\n* Call `npm run test` to run tests.\n* Call `npm run coverage` to run tests with code coverage report in `./coverage`.\n* Call `npm run lint` to run ESLint.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleq%2Fnodeprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleq%2Fnodeprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleq%2Fnodeprompt/lists"}