feat: allow configurable command name #40
Merged
Merged
Conversation
…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
There was a problem hiding this comment.
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add CommandName field to Config (defaulting to "mcp" for backwards compatibility) and thread it through:
Related Issues
Closes #39
Checklist