diff --git a/docs/REPL-PROMPT.md b/docs/REPL-PROMPT.md new file mode 100644 index 0000000..d0ba268 --- /dev/null +++ b/docs/REPL-PROMPT.md @@ -0,0 +1,118 @@ +# Customize REPL Prompt + +[//]: # (TODO link to this doc from the main README) +The prompt you see when you start the Loki REPL can be customized to your liking. This is achieved via the `left_prompt` +and `right_prompt` settings in the global Loki configuration file: + +```yaml +left_prompt: '{color.red}{model}){color.green}{?session {?agent {agent}>}{session}{?role /}}{!session {?agent {agent}>}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} ' +right_prompt: '{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}' +``` + +The location of the global configuration file differs between systems, so you can use the following command to find your +global configuration file's location: + +```shell +loki --info | grep 'config_file' | awk '{print $2}' +``` + +## Quick Links + +- [Syntax](#syntax) +- [Variables](#variables) + + +## Syntax +The syntax for the prompts consists of plain text and templates contained in `{...}`. The plain text is +printed exactly as given. + +The syntax for the templates `{...}` is as follows: + +* `{variable}` - Replaced with the value of `variable` +* `{?variable