Skip to content

feat: allow configurable command name #40

Merged
njayp merged 6 commits into
njayp:mainfrom
damianoneill:configurable-command-name
Feb 18, 2026
Merged

feat: allow configurable command name #40
njayp merged 6 commits into
njayp:mainfrom
damianoneill:configurable-command-name

Conversation

@damianoneill
Copy link
Copy Markdown
Contributor

What does this PR do?

Add CommandName field to Config (defaulting to "mcp" for backwards compatibility) and thread it through:

  • root.go: use config.commandName() for the command's Use field
  • config.go: cmdFilter uses configured name instead of hardcoded "mcp"
  • utils.go: GetCmdPath accepts commandName parameter
  • claude/cursor/vscode enable commands: pass commandName to GetCmdPath
  • test/tools.go: add GetToolsForCommand/ToolsForCommand for custom names, refactor Tools to delegate to ToolsForCommand

Related Issues

Closes #39

Checklist

  • Tests added or updated
  • Docs added or updated

…ing)

Add CommandName field to Config (defaulting to "mcp" for backwards
compatibility) and thread it through:

- root.go: use config.commandName() for the command's Use field
- config.go: cmdFilter uses configured name instead of hardcoded "mcp"
- utils.go: GetCmdPath accepts commandName parameter
- claude/cursor/vscode enable commands: pass commandName to GetCmdPath
- test/tools.go: add GetToolsForCommand/ToolsForCommand for custom names,
  refactor Tools to delegate to ToolsForCommand

Closes njayp#39
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval: ✅

This PR adds configurable command naming to avoid collisions - clean implementation with excellent test coverage.

What I reviewed:

  • ✅ Architecture: CommandName field with proper defaulting to "mcp"
  • ✅ Threading: commandName properly passed through root, filters, and editor config
  • ✅ Testing: Comprehensive tests in config_test.go and tools_test.go validating both default and custom names
  • ✅ Backwards compatibility: Existing code using Command(nil) continues to work
  • ✅ Documentation: README and docs updated with clear examples

The implementation correctly handles:

  • cmdFilter using configured name to exclude ophis subcommands
  • GetCmdPath accepting commandName parameter
  • Editor integrations (claude/vscode/cursor) passing commandName through
  • Nil receiver support in commandName() method

No significant issues found. Good work!

@njayp njayp merged commit 39b3dc9 into njayp:main Feb 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configurable command name (hardcoded "mcp" prevents renaming)

2 participants