Skip to content

About

An opencode plugin that automatically trims leading and trailing spaces from tool names before execution

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

opencode-trim-toolname-plugin

An opencode plugin that automatically trims leading and trailing spaces from tool names before execution.

Problem

Sometimes LLMs call tools with accidental spaces in the tool name (e.g., " read" or "bash "). This plugin sanitizes tool names by trimming whitespace before the tool is executed.

Installation

Copy trim-tool-name.js to your opencode plugins directory:

  • Global: ~/.config/opencode/plugins/
  • Project-level: .opencode/plugins/

Usage

The plugin automatically hooks into tool.execute.before events and trims tool names. No configuration needed.

How it works

  • Uses the tool.execute.before hook to intercept all tool calls
  • Applies trim() to remove leading/trailing whitespace from tool names
  • Logs when trimming occurs for debugging purposes

License

MIT

About

An opencode plugin that automatically trims leading and trailing spaces from tool names before execution

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages