REPL Prompt - Dark-Alex-17/coyote GitHub Wiki
The prompt you see when you start the Coyote REPL can be customized to your liking. This is achieved via the left_prompt
and right_prompt settings in the global Coyote configuration file:
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.cyan}{?reasoning_effort [{reasoning_effort}] }{color.purple}{?last_cache_read_tokens ⚡{last_cache_read_tokens} }{?total_cost ${total_cost} }{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}'Note
The default right_prompt includes a ⚡{last_cache_read_tokens} segment that appears whenever the most recent
API call read tokens from Anthropic's prompt cache (see the token usage variables below). Because
{?variable ...} treats 0 as falsy, the indicator stays hidden on cold-cache calls.
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:
coyote --info | grep '^config_file' | awk '{print $2}'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 ofvariable -
{?variable <template>}- Evaluate the<template>whenvariableis evaluated totrue -
{!variable <template>}- Evaluate the<template>whenvariableis evaluated tofalse
Where a <template> is another expression consisting of plain text and/or more special computations inside {...}.
Variables are evaluated to also be "truthy"; that is, if a variable is undefined, it is considered to be the exact same
as if that variable's value was false.
Example 1: Simple Boolean Usage
For the prompt {?variable yay}{!variable boo}, if variable=true, then the output will be
yay
And if variable=false:
boo
Example 2: Nested Expressions
For the prompt {?variable {!variable2 yay}>}, and assuming
variable=true-
variable2=falsethe output will be
yay>
If variable2=true, the output will be empty.
If variable=false, the output will be empty.
The following variables and output modifiers are available to you when you're creating your prompts:
# Model Variables
model: openai:gpt-4 # The active model's full name
client_name: openai # The name of the client serving the active model
model_name: gpt-4 # The aliased name of the active model
max_input_tokens: 4096 # The maximum number of input tokens for the active model
# Configuration Variables
temperature: 1.0 # The temperature for the active model
top_p: 0.9 # The top_p for the active model
reasoning_effort: high # The reasoning effort level for the active model;
# only set when the model supports configurable reasoning (see `reasoning_levels` in the
# [Clients documentation](https://github.com/Dark-Alex-17/coyote/wiki/Clients))
dry_run: true # Whether the given command is flagged to be a dry run
stream: false # Whether streaming responses are enabled
save: true # Whether shell history is saved
wrap: 120 # The number of characters to allow before wrapping around output to the next line
# Role Variables
role: code # The active role
# Session Variables
session: temp # The name of the active session
dirty: false # Whether the session settings have been updated but not persisted
consume_tokens: 200 # The number of tokens consumed
consume_percent: 1% # The percentage of tokens consumed to the maximum input tokens
user_messages_len: 0 # The total number of sent user messages
# Token Usage Variables
# Real, API-reported token usage. Currently populated by the Anthropic-protocol clients (claude, bedrock with
# Anthropic models, and vertexai with Claude models); other providers leave these unset, so always guard them
# with {?variable ...}. Reminder: {?variable} treats 0 as falsy, so a cold cache (0 tokens read) hides the segment.
last_input_tokens: 1200 # Input tokens billed for the most recent API call
last_output_tokens: 340 # Output tokens generated by the most recent API call
last_cache_read_tokens: 900 # Prompt-cache tokens read (cache hits) on the most recent API call
last_cache_creation_tokens: 0 # Prompt-cache tokens written on the most recent API call
total_input_tokens: 5400 # Cumulative input tokens for the active session (requires an active session)
total_output_tokens: 1800 # Cumulative output tokens for the active session
total_cache_read_tokens: 4100 # Cumulative cache-read tokens for the active session
total_cache_creation_tokens: 1200 # Cumulative cache-write tokens for the active session
last_cost: 0.0142 # USD cost of the most recent API call (real usage × the model's catalog prices);
# only set when every billed component has a known price, and hidden until it
# renders as a nonzero 4-decimal amount
total_cost: 0.3982 # Cumulative USD cost for the active session, accumulated per API call with the
# prices of the model that served each call (accurate across mid-session model switches)
# RAG Variables
rag: temp # The name of the active RAG
# Agent Variables
agent: todo-sh # The name of the active agent
# ANSI COLORS
color.reset:
color.black:
color.dark_gray:
color.red:
color.light_red:
color.green:
color.light_green:
color.yellow:
color.light_yellow:
color.blue:
color.light_blue:
color.purple:
color.light_purple:
color.magenta:
color.light_magenta:
color.cyan:
color.light_cyan:
color.white:
color.light_gray: