mkprompt is a tool for creating fancy shell prompts. Prompts are configured in a small functional language embedded in JSON.
Building requires Go and asciidoctor for the man page.
make
sudo make install DESTDIR=/usr/localSource the supplied script from ~/.bashrc:
source /usr/local/share/mkprompt/shell/mkprompt.bashThe configuration file lives at ~/.config/mkprompt/mkprompt.json. A default
is created on first run. Here is a minimal example that renders
user@host:path$ :
{
"call": "sequence",
"elements": [
{ "call": "text", "content": { "call": "username" } },
{ "call": "text", "content": "@" },
{ "call": "text", "content": { "call": "hostname" } },
{ "call": "text", "content": ":" },
{ "call": "text", "content": { "call": "abbreviate_path", "path": { "call": "current_directory" } } },
{ "call": "text", "content": "$ " }
]
}See man mkprompt for the full language reference and mkprompt --list-builtins
for a listing of all available built-in functions. Ready-to-use examples are
in the examples/ directory.
MIT. See LICENSE.