https://github.com/brandonvfx/go-prompt
A prompt generator
https://github.com/brandonvfx/go-prompt
bash go golang powerline terminal
Last synced: 3 months ago
JSON representation
A prompt generator
- Host: GitHub
- URL: https://github.com/brandonvfx/go-prompt
- Owner: brandonvfx
- License: mit
- Created: 2013-09-04T03:47:22.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-12-06T23:12:59.000Z (over 12 years ago)
- Last Synced: 2025-06-25T16:43:41.688Z (about 1 year ago)
- Topics: bash, go, golang, powerline, terminal
- Language: Go
- Homepage:
- Size: 210 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-prompt
=========
[](http://travis-ci.org/brandonvfx/go-prompt)
A prompt generator (bash only currently) based on [powerline-shell](https://github.com/milkbikis/powerline-shell).

Why?
----
I really like the look and feel of the powerline-shell prompt and when I started to learn Go I wanted my first *real* project to be something I use everyday. So re-writing powerline-shell seemed like a *good* idea.
Install
-------
`go get github.com/brandonvfx/go-prompt`
or
Download the binary from the releases page: https://github.com/brandonvfx/go-prompt/releases
Usage
-----
Add the following to your `.bashrc` (assuming `go-prompt` is in your path):
function _update_ps1() {
export PS1="$(go-prompt $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1"
Config
------
Save the default config to a file (~/.go_prompt)
`go-prompt -write-config`
###Themes:
Config key: `theme`
Type: Hash
###Symbols:
Config key: `symbols`
Type: Hash
###Enabling segments:
Config key: `segments`
Type: Array of Strings
Segments
--------
**CwdSegment** - Shows the current path
**CmdSegment** - Shows the exit status of the last command
**HostSegment** - Shows the current host
**GitSegment** - Shows the current git branch and status.
**ReadOnlySegment** - Shows if the current directory is writable by you.
**RvmSegment** - Shows current rvm gemset
**UserSegment** - Shows current user
**UserHostSegment** - Shows the current user and host.
**VirtualEnvSegment** - Shows the current python virtualenv.
Change Log
----------
###0.1.0
Initial version.
Todo
----
- Add tests
- zsh support
- more segments
[](https://bitdeli.com/free "Bitdeli Badge")