{"id":18006299,"url":"https://github.com/glfmn/glitter","last_synced_at":"2025-09-04T04:20:23.582Z","repository":{"id":39800920,"uuid":"115174357","full_name":"glfmn/glitter","owner":"glfmn","description":"Display git status information in your shell prompt","archived":false,"fork":false,"pushed_at":"2022-10-06T18:59:36.000Z","size":8111,"stargazers_count":53,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T01:18:44.343Z","etag":null,"topics":["bash","cli","fish-shell","git","powershell","pretty-printer","rust","utility","zsh"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glfmn.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-12-23T05:58:03.000Z","updated_at":"2024-11-29T15:26:58.000Z","dependencies_parsed_at":"2022-08-29T10:01:46.479Z","dependency_job_id":null,"html_url":"https://github.com/glfmn/glitter","commit_stats":null,"previous_names":["glfmn/gist"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/glfmn/glitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glfmn%2Fglitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glfmn%2Fglitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glfmn%2Fglitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glfmn%2Fglitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glfmn","download_url":"https://codeload.github.com/glfmn/glitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glfmn%2Fglitter/sbom","scorecard":{"id":429730,"data":{"date":"2025-08-11","repo":{"name":"github.com/glfmn/glitter","commit":"0c8425db5daa07d71758fd3979641a7912ee6e1c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Mozilla Public License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.2 not signed: https://api.github.com/repos/glfmn/glitter/releases/20033093","Warn: release artifact v0.2.1 not signed: https://api.github.com/repos/glfmn/glitter/releases/19521671","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/glfmn/glitter/releases/19393920","Warn: release artifact v0.2.2 does not have provenance: https://api.github.com/repos/glfmn/glitter/releases/20033093","Warn: release artifact v0.2.1 does not have provenance: https://api.github.com/repos/glfmn/glitter/releases/19521671","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/glfmn/glitter/releases/19393920"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2021-0139","Warn: Project is vulnerable to: RUSTSEC-2021-0145 / GHSA-g98v-hv3f-hcfr","Warn: Project is vulnerable to: RUSTSEC-2024-0375","Warn: Project is vulnerable to: RUSTSEC-2022-0078 / GHSA-f85w-wvc7-crwc","Warn: Project is vulnerable to: RUSTSEC-2023-0003 / GHSA-m4ch-rfv5-x5g3","Warn: Project is vulnerable to: RUSTSEC-2024-0421 / GHSA-h97m-ww89-6jmq","Warn: Project is vulnerable to: RUSTSEC-2024-0384","Warn: Project is vulnerable to: GHSA-2326-pfpj-vx3h","Warn: Project is vulnerable to: RUSTSEC-2023-0086","Warn: Project is vulnerable to: RUSTSEC-2024-0013 / GHSA-22q8-ghmq-63vf","Warn: Project is vulnerable to: RUSTSEC-2023-0018 / GHSA-mc8h-8q98-g5hr","Warn: Project is vulnerable to: RUSTSEC-2021-0127"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:03:17.010Z","repository_id":39800920,"created_at":"2025-08-19T03:03:17.010Z","updated_at":"2025-08-19T03:03:17.010Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273549658,"owners_count":25125343,"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-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["bash","cli","fish-shell","git","powershell","pretty-printer","rust","utility","zsh"],"created_at":"2024-10-30T01:07:37.831Z","updated_at":"2025-09-04T04:20:23.557Z","avatar_url":"https://github.com/glfmn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ✨ glitter\n\n![Glit is an informative shell prompt](img/glit-demo.gif)\n\n**Git status summary with custom formats, perfect for your shell prompt**\n\n[![Crates.io](https://img.shields.io/crates/v/glit.svg)](https://crates.io/crates/glit)[![Build Status](https://travis-ci.org/glfmn/glitter.svg?branch=master)](https://travis-ci.org/glfmn/glitter)\n\nGlitter is a cross-platform command-line tool and format language for making informative git prompts.  Glitter's interpreter, `glit` will:\n\n- Read status information from your git repository through the git api\n- Parse and Interpret the provided format\n- Output your format with the requested information to `stdout`\n\nGlitter is a binary tool which affords blazing speed, offers maximum flexibility, and painless installation.  This makes Glitter an ideal alternative to alternative to tools like [`bash-git-prompt`](https://github.com/magicmonty/bash-git-prompt), [`zsh-git-prompt`](https://github.com/olivierverdier/zsh-git-prompt), and [`posh-git`](https://github.com/dahlbyk/posh-git).\n\nGlitter has been tested on Windows, Mac, and Ubuntu; it works in Powershell, zsh, bash, and theoretically any shell environment that supports a prompt command.\n\n# Installation\n\nGo to the [release](https://github.com/glfmn/glitter/releases) page and download a binary for your platform.\n\nTo make sure Glitter is installed:\n\n```\n$ glit \"'hello from git'\" -e \"'hello'\"\n```\n\nIt will output `hello from git` if the current directory is in a git repository and `hello` if it is not.\n\n### Build from source\n\nInstall the [rust toolchain](https://rustup.rs), `cmake` and `openssl` first, and then:\n\n```\n$ cargo install glit\n```\n\n## Setting up your shell\n\nOnce Glitter is installed, you need to set it to update your prompt.\n\n### Bash\n\nAdd the following snippet to your `~/.bashrc` or just paste the snippet in your shell to try it without doing anything permanent.\n\n```bash\n# Format to use inside of git repositories or their sub-folders\nexport GIT_FMT=\"#g*(b)..#r(B)[+('↑')-('↓'), #~(#g(MARD):#r(maud)), h(#m('@'))]:#b*('\\w')'\\n\\$ '\"\n\n# Format to use outside of git repositories\nexport PS1_FMT=\"#g(#*('\\u')@'\\h'):#b*('\\w')'\\$ '\"\n\n__set_prompt() {\n    PS1=\"$(glit \"$GIT_FMT\" -b -e \"$PS1_FMT\")\"\n}\n\nexport PROMPT_COMMAND=__set_prompt\n```\n\n### Powershell\n\nAdd the following snippet to your `$PROFILE` or just paste the snippet in your shell to try it without doing anything permanent.\n\n```powershell\n# Format to use inside of git repositories\n$GIT_FMT=\":#y([#c*(b) #c(B):#~(+,-) | #~(#g(MARD):#r(maud):#m(h('@')))])\"\n\nfunction prompt {\n    $path = $(get-location)\n    glit \"'$path'$GIT_FMT'\u003e '\" -e \"'$path\u003e '\"\n}\n```\n\n### zsh\n\nAdd the following snippet to your `~/.zshrc` file or just paste the snippet in your shell to try it without doing anything permanent.\n\n```zsh\n# Format used in a git repository\nexport GIT_FMT=\"#g*(b)..#r(B)[+('↑')-('↓'), #~(#g(MARD):#r(maud)), h(#m('@'))] #b*('%~')\"\n\n# Fallback format used outside of git repositories\nexport PS1_FMT=\"#g*('%m')#b*('%~')\"\n\nprecmd() { print -rP \"$(glit \"$GIT_FMT\" -b -e \"$PS1_FMT\")\" }\nPROMPT=\"%# \"\n```\n\n### fish\n\n\nReplace your `~/.config/fish/functions/fish_prompt.fish` file with or just paste the snippet in your shell to try it without doing anything permanent.\n\n```fish\nfunction fish_prompt\n    set -l path (prompt_pwd)\n    # format used in git repositories\n    set git \"#g*(b)..#r(B)[+('↑')-('↓'), #~(#g(MARD):#r(maud)), h(#m('@'))] #y('$path')'\\n\u003e '\"\n    # fallback format used outside of git repositories\n    set ps1 \"#y('$path ')'\u003e '\"\n\n    echo -e (glit $git -e $ps1)\nend\n```\n\n# Customizing your format\n\n\nGlitter provides a flexible expression language which is easy to use and easy to prototype with.\n\n![`glit` is easy to experiment with.](img/glit-command.gif)\n\n| Colorless Example                |\n| :------------------------------- |\n| ![example-3](img/example-3.png)  |\n| `\"b..B({+-}) [MARD] \\(maud) h\"`  |\n\n| Compact Example                                          |\n|:---------------------------------------------------------|\n| ![example-1](img/example-1.png)                          |\n| `\"[#c*(b)@#c(B):{+,-} \\| #~(#g(MARD):#r(maud):h('@'))]\"` |\n\n| Friendly for git Beginners                                                                      |\n|:------------------------------------------------------------------------------------------------|\n| ![example-2](img/example-2.png)                                                                 |\n| `\"#g*(b)..#r(B)[#g(+(#~('ahead '))), #r(-(#~('behind '))), #~(#g(MARD)#r(maud)), h('stash ')]\"` |\n| Closely matches the information in `git status -sb`                                             |\n\nA glitter format is made of 4 types of expressions:\n\n- Informational expressions\n- Group expressions\n- Strings\n- Separators\n- Format expressions\n\n### Git Information\n\n| Formatter | Meaning                        | Example         |\n|:----------|:-------------------------------|:----------------|\n| `b`       | branch name or head commit id  | `master`        |\n| `B`       | tracking branch with remote    | `origin/master` |\n| `+`       | # of commits ahead remote      | `+1`            |\n| `-`       | # of commits behind remote     | `-1`            |\n| `m`       | # of unstaged modified files   | `M1`            |\n| `a`       | # of untracked files           | `?1`            |\n| `d`       | # of unstaged deleted files    | `D1`            |\n| `u`       | # of merge conflicts           | `U1`            |\n| `M`       | # of staged modified files     | `M1`            |\n| `A`       | # of added files               | `A1`            |\n| `R`       | # of renamed files             | `R1`            |\n| `D`       | # of staged deleted files      | `D1`            |\n| `h`       | # of stashed changes           | `H1`            |\n\nYou can provide other expressions as arguments to expressions which replace the default prefix which appears before the result or file count.  For example, `\\h('@')` will output `@3`\ninstead of `H3` if your repository has 3 stashes.  You can provide an arbitrary number of valid expressions as arguments to any of these expressions.\n\n```\n$ glit \"b\"\nmaster\n$ glit \"b('on branch ')\"\non branch master\n```\n\nExpressions generally only render any output if their corresponding values aren't empty; in other words, if there are no added files, `glit` will not produce `A0` as the output of `\\A`, but instead will output an empty string.\n\n### Grouping\n\nGlitter will surround grouped expressions with parentheses or brackets, and will print nothing if the group is empty.\n\n| Macro     | Result                          |\n|:----------|:--------------------------------|\n| `[]`      | empty                           |\n| `\\(a)`    | `(?1)`; note the preceeding `\\` |\n| `\u003c\u003e`      | empty                           |\n| `{}`      | empty                           |\n| `{b}`     | `{master}`                      |\n| `\u003c+-\u003e`    | `\u003c+1-1\u003e`                        |\n| `[MAR]`   | `[M1A3]` where `R` is 0         |\n| `[r\\(a)]` | empty, when `r`, `a` are 0      |\n\n```\n$ glit \"b\u003cM\u003e\"\n```\n\n### Strings\n\nAny characters between single quotes are strings. Strings appear untouched in the output; for example, `'exact'` outputs `exact`.\n\n```\n$ glit \"'hello world'\"\nhello world\n$ glit \"'\\n\\w\\n\\u'\"\n\\n\\w\\n\\u\n$ glit \"'separate' 'words'\"\nseparate words\n```\n\n### Separators\n\nSeparators appear between expressions to help differentiate or group them. Supported separators are:\n\n| Separator  | Symbol |\n|------------|--------|\n| Space      | ` `    |\n| Bar/Pipe   | `\\|`   |\n| At         | `@`    |\n| Underscore | `_`    |\n| Colon      | `:`    |\n| Semicolon  | `;`    |\n| Comma      | `,`    |\n| Dot        | `.`    |\n\nAny number of separators can be used between two expressions\n\n```\n$ glit \"'hello', 'world'\"\nhello, world\n$ glit \"b@B::'git'\"\nmaster::git                 # there is no tracking branch (B)\nmaster@origin/master::git   # there is a tracking branch (B)\n$ glit \"b[+] | B\"\nmaster[+1] | origin/master  # ahead 1 commit of tracking branch\nmaster | origin/master      # no difference between master and tracking\n```\n\nSeparators will always print if _any_ expression in the group has printed before it, and if the expression _immediately_ after prints anything.\n\n```\nglit \"b [..B..]\"            # [..B..] is a separate group\nmaster [origin/master]      # nothing prints before or after B\n```\n\nThis can lead to unexpected behavior like the following:\n\n```\n$ glit \"b MA\"\nmaster M1A1                 # 1 staged change, 1 new file\nmasterA1                    # no staged changes, 1 new file\n```\n\nThe solution is to group the expressions that follow somehow:\n\n```\n$ glit \"b [MA]\"\nmaster [A1]\n$ glit \"b #~(MA)\"           # tip: use reset style\nmaster A1                   # notice no extra output\n```\n\n### Formatting text\n\nGlitter expressions support ANSI terminal formatting through the following styles:\n\n| Format                | Meaning                       |\n| :-------------------- | :---------------------------- |\n| `#~('...')`           | reset                         |\n| `#_('...')`           | underline                     |\n| `#i('...')`           | italic text                   |\n| `#*('...')`           | bold text                     |\n| `#r('...')`           | red text                      |\n| `#g('...')`           | green text                    |\n| `#b('...')`           | blue text                     |\n| `#m('...')`           | magenta/purple text           |\n| `#y('...')`           | yellow text                   |\n| `#w('...')`           | white text                    |\n| `#k('...')`           | bright black text             |\n| `#[01,02,03]('...')`  | 24 bit RGB text color         |\n| `#R('...')`           | red background                |\n| `#G('...')`           | green background              |\n| `#B('...')`           | blue background               |\n| `#M('...')`           | magenta/purple background     |\n| `#Y('...')`           | yellow background             |\n| `#W('...')`           | white background              |\n| `#K('...')`           | bright black background       |\n| `#{01,02,03}('...')`  | 24 bit RGB background color   |\n\nFormat styles can be combined in a single expression by just combining them:\n\n| Format             | Meaning                        |\n|:-------------------|:-------------------------------|\n| `#wK('...')`   | white text, black background   |\n| `#r*('...')`   | red bold text                  |\n| `#g_('...')`   | green underline text           |\n| `#~_*('...')`  | underline bold text with the reset color |\n\n```\n$ glit \"#r*('hello world')\"\n$ glit \"#g*(b)\"\n$ glit \"#[255,175,52]('orange text')\"\n$ glit \"#G('green background')\"\n```\n\n`glit` can understand and respects complicated nested styles, providing maximum flexibility.\n\n```\n$ glit \"#g('green text with some '#*('bold')' green text')\"\n$ glit \"#g*(b(#~('on branch ')))\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglfmn%2Fglitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglfmn%2Fglitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglfmn%2Fglitter/lists"}