opencode-currency
v1.0.1
Published
OpenCode plugin that converts USD amounts in AI responses into your local currency (server + TUI)
Maintainers
Readme
opencode-currency
An OpenCode plugin that converts USD amounts in AI responses into your local currency. It ships two halves:
- Server plugin — rewrites
$100/100 USDin AI output to$100 (375.00 AED). - TUI plugin — adds a
currency.setpalette command to pick your currency interactively. The choice is stored in.opencode/currency.jsonand shared with the server plugin.
Install
Add the package to opencode.json (server half):
{
"$schema": "https://opencode.ai/config.json",
"plugin": [["opencode-currency", { "currency": "EUR" }]]
}And to tui.json (TUI half):
{
"plugin": ["opencode-currency"]
}If you don't need the palette command, you can skip the tui.json entry.
Usage
Set the target currency with the currency option (ISO 4217 code, e.g. EUR, AED, JPY), or pick one in the TUI via the currency.set palette command. If no currency is configured, responses are left untouched.
Options (server)
| Option | Default | Description |
| ----------- | -------- | -------------------------------------------------- |
| currency | (none) | Target ISO 4217 code, e.g. EUR. |
| base | USD | Source currency to convert from. |
| decimals | 2 | Decimal places in the converted amount. |
| refreshMs | 3600000| How often to refetch the exchange rate. |
| symbol | — | Custom label next to the converted amount. |
| endpoints | 3 public FX APIs | Fallback list of JSON endpoints returning { rates }. |
Development
bun install
bun run build # emits dist/server.js + dist/tui.js
npm publish # after logging inLicense
MIT
