A small OpenCode plugin that replaces case-insensitive occurrences of opencode with a configurable word (default: Renamer) across OpenCode outputs.
This is mainly useful for privacy/safety: it helps reduce accidental disclosure of the platform name in logs, screenshots, demos, shared transcripts, or tool output.
- Safer sharing: reduces chance your pasted output reveals “opencode”.
- Cleaner demos and screenshots: consistent wording in public materials.
- Non-invasive: avoids changing URLs, file paths, and code blocks so you don’t break commands, stack traces, or links.
The plugin runs on multiple OpenCode hooks, including chat messages, system prompts, tool output, and session titles.
It does not replace inside:
- URLs (example:
https://opencode.ai/docs/plugins) - file paths (example:
.opencode/...,/usr/local/...,C:\Users\...) - inline code and fenced code blocks (anything inside backticks)
- Install the plugin in your project:
bun add -d @sillybit/renamer-opencode-plugin- Add the plugin to your OpenCode config (
opencode.jsonoropencode.jsonc):
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@sillybit/renamer-opencode-plugin"]
}- Restart OpenCode.
OpenCode installs npm plugins automatically at startup (cached under ~/.cache/opencode/node_modules/), so the manual install step is optional.
If the plugin is installed in your project devDependencies, update it with Bun:
bun update -d @sillybit/renamer-opencode-pluginTo force the latest published version:
bun add -d @sillybit/renamer-opencode-plugin@latestAfter updating, restart OpenCode so it reloads the plugin.
If you only reference the plugin in opencode.json/opencode.jsonc (without adding it to your project dependencies), restarting OpenCode is usually enough for it to fetch the newest cached-compatible version.
Config is optional. If you don’t configure anything, the plugin is enabled and replaces opencode → Renamer.
Config files are JSON and loaded from both locations:
- Global:
~/.config/opencode/renamer-config.json - Project:
.opencode/renamer-config.json
Project config overrides global config.
Example:
{
"enabled": true,
"replacement": "Renamer",
"hooks": {
"chatMessage": true,
"system": true,
"messageHistory": true,
"textComplete": true,
"toolOutput": true
},
"caseVariants": false
}OPENCODE_RENAMER_REPLACE_ENABLED(true/false, also supports1/0,yes/no,on/off)OPENCODE_RENAMER_REPLACE_TEXT(non-empty string)
By default, all hooks are enabled. You can selectively disable specific hooks using the hooks configuration:
{
"enabled": true,
"replacement": "Renamer",
"hooks": {
"chatMessage": false, // Disable replacement in chat messages
"system": true, // Keep replacement in system prompts
"messageHistory": true, // Keep replacement in message history
"textComplete": true, // Keep replacement in text completions
"toolOutput": true // Keep replacement in tool outputs
}
}Available hook toggles:
chatMessage- Controls replacement in chat messagessystem- Controls replacement in system promptsmessageHistory- Controls replacement in message historytextComplete- Controls replacement in text completionstoolOutput- Controls replacement in tool outputs
Note: Session title replacement (the event handler) is always active when enabled: true and cannot be disabled via hooks configuration.
By default, the plugin only matches opencode (case-insensitive). You can enable matching of case variants using the caseVariants option:
{
"enabled": true,
"replacement": "Renamer",
"caseVariants": true
}When caseVariants: true, the plugin matches and replaces these 7 variants:
- camelCase:
openCode→Renamer - PascalCase:
OpenCode→Renamer - kebab-case:
open-code→Renamer - snake_case:
open_code→Renamer - SCREAMING_SNAKE:
OPEN_CODE→Renamer - SCREAMING_KEBAB:
OPEN-CODE→Renamer - dot.case:
open.code→Renamer
Important notes:
- Replacement is always the literal
replacementstring (not case-aware) - Variants respect protected ranges (URLs, paths, code blocks)
- Default is
falsefor backward compatibility
Example:
Input:
Use open-code or open_code in your project
Visit https://open-code.dev for docs
Output (with caseVariants: true):
Use Renamer or Renamer in your project
Visit https://open-code.dev for docs
The URL is protected, but the text variants are replaced.
Input:
I’m using opencode for this task
Output (default):
I’m using Renamer for this task
https://opencode.ai/docs/plugins stays unchanged.
Inline code: `opencode` stays unchanged.
Fenced code blocks stay unchanged:
echo "opencode"- Match is case-insensitive:
OpenCode,OPENCODE,opencodeall become yourreplacement. - Case variant matching: When
caseVariants: trueis enabled, variants likeopen-codeoropen_codeare also matched and replaced. - Replacement target is intentionally fixed to
opencode(not configurable).
bun install
bun run buildThis project follows Conventional Commits specification.
Format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks (dependencies, build config, etc.)
Examples:
feat: add support for custom replacement patterns
fix: exclude URLs from text replacement
docs: update installation instructions
chore: update dependencies
Breaking Changes:
Use ! after the type/scope to indicate breaking changes:
feat!: change default replacement from "Renamer" to "Custom"
MIT