{"id":37201652,"url":"https://github.com/kylewolfe/powerline-go","last_synced_at":"2026-01-14T23:15:20.642Z","repository":{"id":57585620,"uuid":"175712207","full_name":"kylewolfe/powerline-go","owner":"kylewolfe","description":" A beautiful and useful low-latency prompt for your shell, written in go","archived":false,"fork":true,"pushed_at":"2019-03-14T22:56:47.000Z","size":403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T05:05:27.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"justjanne/powerline-go","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylewolfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-14T22:55:02.000Z","updated_at":"2019-03-14T22:55:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kylewolfe/powerline-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylewolfe/powerline-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylewolfe%2Fpowerline-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylewolfe%2Fpowerline-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylewolfe%2Fpowerline-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylewolfe%2Fpowerline-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylewolfe","download_url":"https://codeload.github.com/kylewolfe/powerline-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylewolfe%2Fpowerline-go/sbom","scorecard":{"id":575473,"data":{"date":"2025-08-11","repo":{"name":"github.com/kylewolfe/powerline-go","commit":"6c4f49b348b30166a3f2d95551a29bc8d56f5444"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"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"}}]},"last_synced_at":"2025-08-20T17:35:07.673Z","repository_id":57585620,"created_at":"2025-08-20T17:35:07.674Z","updated_at":"2025-08-20T17:35:07.674Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T23:15:19.837Z","updated_at":"2026-01-14T23:15:20.587Z","avatar_url":"https://github.com/kylewolfe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Powerline style prompt for your shell\n\nA [Powerline](https://github.com/Lokaltog/vim-powerline) like prompt for Bash,\nZSH and Fish. Based on [Powerline-Shell](https://github.com/banga/powerline-shell) by @banga.\nPorted to golang by @justjanne.\n\n![Solarized+Powerline](https://raw.github.com/justjanne/powerline-go/master/preview.png)\n\n- Shows some important details about the git/hg branch (see below)\n- Changes color if the last command exited with a failure code\n- If you're too deep into a directory tree, shortens the displayed path with an ellipsis\n- Shows the current Python [virtualenv](http://www.virtualenv.org/) environment\n- Shows if you are in a [nix](https://nixos.org/) shell\n- It's easy to customize and extend. See below for details.\n\n**Table of Contents**\n\n- [Version Control](#version-control)\n- [Installation](#installation)\n  - [Precompiled Binaries](#precompiled-binaries)\n  - [Other Platforms](#other-platforms)\n  - [Bash](#bash)\n  - [ZSH](#zsh)\n  - [Fish](#fish)\n  - [Nix](#nix)\n- [Customization](#customization)\n- [License](#license)\n\n## Version Control\n\nAll of the version control systems supported by powerline shell give you a\nquick look into the state of your repo:\n\n- The current branch is displayed and changes background color when the\n  branch is dirty.\n- When the local branch differs from the remote, the difference in number\n  of commits is shown along with `⇡` or `⇣` indicating whether a git push\n  or pull is pending\n\nIn addition, git has a few extra symbols:\n\n- `✎` -- a file has been modified, but not staged for commit\n- `✔` -- a file is staged for commit\n- `✼` -- a file has conflicts\n- `+` -- untracked files are present\n- `⚑` -- stash is present\n\nEach of these will have a number next to it if more than one file matches.\n\n## Installation\n\n`powerline-go` uses ANSI color codes, these should nowadays work everywhere,\nbut you may have to set your $TERM to `xterm-256color` for it to work.\n\nIf you want to use the \"patched\" mode (which is the default, and provides\nimproved UI), you'll need to install a powerline font, either as fallback,\nor by patching the font you use for your terminal: see\n[powerline-fonts](https://github.com/Lokaltog/powerline-fonts).  \nAlternatively you can use \"compatible\" or \"flat\" mode.\n\n### Precompiled Binaries\n\nI provide precompiled binaries for x64 Linux and macOS in the\n[releases tab](https://github.com/justjanne/powerline-go/releases)\n\n### Other Platforms\n\n- Install (and update) the package with\n\n```bash\ngo get -u github.com/justjanne/powerline-go\n```\n\n- By default it will be in `$GOPATH/bin`, if you want to change that, you can set\n  your `$GOPATH` and/or `$GOBIN`, but will need to change the path in the\n  following scripts, too.\n\n### Bash\n\nAdd the following to your `.bashrc` (or `.profile` on Mac):\n\n```bash\nfunction _update_ps1() {\n    PS1=\"$($GOPATH/bin/powerline-go -error $?)\"\n}\n\nif [ \"$TERM\" != \"linux\" ] \u0026\u0026 [ -f \"$GOPATH/bin/powerline-go\" ]; then\n    PROMPT_COMMAND=\"_update_ps1; $PROMPT_COMMAND\"\nfi\n```\n\n### ZSH\n\nAdd the following to your `.zshrc`:\n\n```bash\nfunction powerline_precmd() {\n    PS1=\"$($GOPATH/bin/powerline-go -error $? -shell zsh)\"\n}\n\nfunction install_powerline_precmd() {\n  for s in \"${precmd_functions[@]}\"; do\n    if [ \"$s\" = \"powerline_precmd\" ]; then\n      return\n    fi\n  done\n  precmd_functions+=(powerline_precmd)\n}\n\nif [ \"$TERM\" != \"linux\" ]; then\n    install_powerline_precmd\nfi\n```\n\n### Fish\n\nRedefine `fish_prompt` in `~/.config/fish/config.fish`:\n\n```bash\nfunction fish_prompt\n    $GOPATH/bin/powerline-go -error $status -shell bare\nend\n```\n### Nix\n\nWhen using `nix-shell --pure`, `powerline-go` will not be accessible, and\nyour prompt will disappear.\n\nTo work around this you can add this snippet to your `.bashrc`,\nwhich should re-enable the prompt in most cases:\n\n```bash\n# Workaround for nix-shell --pure\nif [ \"$IN_NIX_SHELL\" == \"pure\" ]; then\n    if [ -x \"$HOME/.nix-profile/bin/powerline-go\" ]; then\n        alias powerline-go=\"$HOME/.nix-profile/bin/powerline-go\"\n    elif [ -x \"/run/current-system/sw/bin/powerline-go\" ]; then\n        alias powerline-go=\"/run/current-system/sw/bin/powerline-go\"\n    fi\nfi\n```\n\n## Customization\n\nThere are a few optional arguments which can be seen by running\n`powerline-go -help`. These can be used by changing the command you have set\nin your shell’s init file.\n\n```\nUsage of powerline-go:\n  -colorize-hostname\n    \t Colorize the hostname based on a hash of itself\n  -condensed\n    \t Remove spacing between segments\n  -cwd-max-depth int\n    \t Maximum number of directories to show in path\n    \t (default 5)\n  -cwd-max-dir-size int\n    \t Maximum number of letters displayed for each directory in the path\n    \t (default -1)\n  -cwd-mode string\n    \t How to display the current directory\n    \t (valid choices: fancy, plain, dironly)\n    \t (default \"fancy\")\n  -duration string\n    \t The elapsed clock-time of the previous command\n  -east-asian-width\n    \t Use East Asian Ambiguous Widths\n  -error int\n    \t Exit code of previously executed command\n  -eval\n    \t Output prompt in 'eval' format.\n  -ignore-repos string\n    \t A list of git repos to ignore. Separate with ','.\n    \t Repos are identified by their root directory.\n  -max-width int\n    \t Maximum width of the shell that the prompt may use, in percent. Setting this to 0 disables the shrinking subsystem.\n  -mode string\n    \t The characters used to make separators between segments.\n    \t (valid choices: patched, compatible, flat)\n    \t (default \"patched\")\n  -modules string\n    \t The list of modules to load, separated by ','\n    \t (valid choices: aws, cwd, docker, dotenv, duration, exit, git, gitlite, hg, host, jobs, kube, load, newline, nix-shell, node, perlbrew, perms, root, shell-var, ssh, svn, termtitle, terraform-workspace, time, user, venv, vgo)\n    \t (default \"nix-shell,venv,user,host,ssh,cwd,perms,git,hg,jobs,exit,root,vgo\")\n  -modules-right string\n    \t The list of modules to load anchored to the right, for shells that support it, separated by ','\n    \t (valid choices: aws, cwd, docker, dotenv, duration, exit, git, gitlite, hg, host, jobs, kube, load, newline, nix-shell, node, perlbrew, perms, root, shell-var, ssh, svn, termtitle, terraform-workspace, time, user, venv, vgo)\n  -newline\n    \t Show the prompt on a new line\n  -numeric-exit-codes\n    \t Shows numeric exit codes for errors.\n  -path-aliases string\n    \t One or more aliases from a path to a short name. Separate with ','.\n    \t An alias maps a path like foo/bar/baz to a short name like FBB.\n    \t Specify these as key/value pairs like foo/bar/baz=FBB.\n    \t Use '~' for your home dir. You may need to escape this character to avoid shell substitution.\n  -priority string\n    \t Segments sorted by priority, if not enough space exists, the least priorized segments are removed first. Separate with ','\n    \t (valid choices: aws, cwd, docker, dotenv, duration, exit, git, gitlite, hg, host, jobs, kube, load, newline, nix-shell, node, perlbrew, perms, root, shell-var, ssh, svn, termtitle, terraform-workspace, time, user, venv, vgo)\n    \t (default \"root,cwd,user,host,ssh,perms,git-branch,git-status,hg,jobs,exit,cwd-path\")\n  -shell string\n    \t Set this to your shell type\n    \t (valid choices: bare, bash, zsh)\n    \t (default \"bash\")\n  -shell-var string\n    \t A shell variable to add to the segments.\n  -shorten-gke-names\n    \t Shortens names for GKE Kube clusters.\n  -shorten-eks-names\n    \t Shortens names for EKS Kube clusters.\n  -theme string\n    \t Set this to the theme you want to use\n    \t (valid choices: default, low-contrast)\n    \t (default \"default\")\n  -truncate-segment-width int\n    \t Minimum width of a segment, segments longer than this will be shortened if space is limited. Setting this to 0 disables it.\n    \t (default 16)\n```\n### Eval\n\nIf using `eval` and `-modules-right` is desired, the shell setup must be modified slightly, as shown below:\n\n##### Bash\n\nAdd the following to your `.bashrc` (or `.profile` on Mac):\n\n```bash\nfunction _update_ps1() {\n    eval \"$($GOPATH/bin/powerline-go -error $? -eval -modules-right git)\"\n}\n\nif [ \"$TERM\" != \"linux\" ] \u0026\u0026 [ -f \"$GOPATH/bin/powerline-go\" ]; then\n    PROMPT_COMMAND=\"_update_ps1; $PROMPT_COMMAND\"\nfi\n```\n\n##### ZSH\n\nAdd the following to your `.zshrc`:\n\n```bash\nfunction powerline_precmd() {\n    eval \"$($GOPATH/bin/powerline-go -error $? -shell zsh -eval -modules-right git)\"\n}\n\nfunction install_powerline_precmd() {\n  for s in \"${precmd_functions[@]}\"; do\n    if [ \"$s\" = \"powerline_precmd\" ]; then\n      return\n    fi\n  done\n  precmd_functions+=(powerline_precmd)\n}\n\nif [ \"$TERM\" != \"linux\" ]; then\n    install_powerline_precmd\nfi\n```\n\n##### Fish\n\nRedefine `fish_prompt` in `~/.config/fish/config.fish`:\n\n```bash\nfunction fish_prompt\n    eval $GOPATH/bin/powerline-go -error $status -shell bare -eval -modules-right git\nend\n```\n\n### Path Aliases\n\nThe point of the path aliases feature is to allow you to replace long paths\nwith a shorter string that you can understand more quickly. This is useful if\nyou're often in deep path hierarchies that end up consuming most of your\nterminal width, even when some portions are replaced by an ellipsis.\n\nFor example, you might want to replace the string `$GOPATH/src/github.com` with\n`@GOPATH-GH`. When you're in a directory like\n`$GOPATH/src/github.com/justjanne/powerline-go`, you'll instead see `@GOPATH-GH \u003e\njustjanne \u003e powerline-go` in the shell prompt.\n\nAliases are defined as comma-separated key value pairs, like this:\n\n```bash\npowerline-go ... -path-aliases \\$GOPATH/src/github.com=@GOPATH-GH,\\~/work/projects/foo=@FOO,\\~/work/projects/bar=@BAR\n```\n    \nNote that you should use `~` instead of `/home/username` when specifying the\npath. Also make sure to escape the `~` character. Otherwise your shell will\nperform interpolation on it before `powerline-go` can see it!\n\n### Duration\n\nThe duration segment requires some assistance from the shell.  The shell must have a hook that gets executed immediately before the command.\n\n#### Bash\n\nBash 4.4 includes an easy way to get a start-time, using `$PS0`.  However, not all operating systems come with a sufficiently recent version of Bash installed.  This example only has seconds precision.  Add or modify your `.bashrc` file to include the following:\n\n```bash\nINTERACTIVE_BASHPID_TIMER=\"/tmp/${USER}.START.$$\"\n\nPS0='$(echo $SECONDS \u003e \"$INTERACTIVE_BASHPID_TIMER\")'\n\nfunction _update_ps1() {\n  local __ERRCODE=$?\n\n  local __DURATION=0\n  if [ -e $INTERACTIVE_BASHPID_TIMER ]; then\n    local __END=$SECONDS\n    local __START=$(cat \"$INTERACTIVE_BASHPID_TIMER\")\n    __DURATION=\"$(($__END - ${__START:-__END}))\"\n    rm -f \"$INTERACTIVE_BASHPID_TIMER\"\n  fi\n\n  PS1=\"$($GOPATH/bin/powerline-go -modules duration -duration $__DURATION -error $__ERRCODE -shell bash)\"\n}\n\nif [ \"$TERM\" != \"linux\" ] \u0026\u0026 [ -f \"$GOPATH/bin/powerline-go\" ]; then\n  PROMPT_COMMAND=\"_update_ps1; $PROMPT_COMMAND\"\nfi\n```\n\n#### Zsh\n\nUsing `$EPOCHREALTIME` requires loading the 'datetime' module in your `.zshrc` file, for example:\n\n```bash\nzmodload zsh/datetime\n\nfunction preexec() {\n  __TIMER=$EPOCHREALTIME\n}\n\nfunction powerline_precmd() {\n  local __ERRCODE=$?\n  local __DURATION=0\n\n  if [ -n $__TIMER ]; then\n    local __ERT=$EPOCHREALTIME\n    __DURATION=\"$(($__ERT - ${__TIMER:-__ERT}))\"\n  fi\n\n  PS1=\"$(powerline-go -modules duration -duration $__DURATION -error $__ERRCODE -shell zsh)\"\n  unset __TIMER\n}\n```\n\nIf the 'datetime' module is unavailable or unwanted, you may replace `$EPOCHREALTIME` with `$SECONDS`, at the loss of precision.\n\n#### Fish\n\nThe fish prompt, in `~/.config/fish/config.fish`, will require a minimum of changes, as Fish automatically provides `$CMD_DURATION`, although with only milliseconds accuracy.\n\n```bash\nfunction fish_prompt\n    set duration (math -s6 \"$CMD_DURATION / 1000\")\n    $GOPATH/bin/powerline-go -modules duration -duration $duration -error $status -shell bare\nend\n```\n\n## License\n\n\u003e This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.  \n\u003e This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.  \n\u003e You should have received a copy of the GNU General Public License along with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylewolfe%2Fpowerline-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylewolfe%2Fpowerline-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylewolfe%2Fpowerline-go/lists"}