Skip to main content

Module format

Module format 

Source
Expand description

{placeholder} substitution for --format and --tooltip-format.

Same surface as claudebar (claudebar:625-667): placeholders are surrounded by {}, unknown placeholders are left untouched (matching bash parameter expansion’s default behavior — claudebar uses ${text//\{x\}/$val} which is a no-op for unknown keys).

Built on a Map<&str, String> so each vendor can register its own placeholder set and the rendering code doesn’t need to know what they are.

Functions§

local_time_hm
local_time_hms
money
A monetary amount, with the sign outside the symbol. format!("${v:.2}") puts it inside — $-5.71 — which reads as a typo rather than as debt, and several providers let a balance go negative: OpenRouter overruns its credits, Moonshot carries an explicit cash_balance debt.
placeholders
Convenience: build a placeholder map from (&str, impl Into<String>) pairs.
substitute
Substitute every {key} in template with values[key]. Unknown keys are left as-is.
updated_at_hm
updated_at_hms
usd
money for the providers that only ever bill in dollars.