Skip to content

feat: Add Tools mode with !! prefix for direct tool execution - #90

Merged
edenreich merged 6 commits into
mainfrom
claude/issue-88-20250820-2155
Aug 20, 2025
Merged

edenreich merged 6 commits into
mainfrom
claude/issue-88-20250820-2155

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

This PR implements the Tools mode feature requested in issue #88.

Summary

  • Adds !! prefix detection for Tools mode in chat interface
  • Implements direct tool execution with syntax: !!ToolName(arg="value")
  • Extends autocompletion to suggest available tools
  • Maintains backward compatibility with existing ! bash mode
  • Includes comprehensive tests and documentation updates

Test plan

  • Unit tests for tool parsing and autocomplete
  • Integration tests with existing test suite
  • Quality checks (linting, formatting)
  • Manual testing of tool execution

Closes #88

🤖 Generated with Claude Code

claude Bot and others added 6 commits August 20, 2025 22:11
Implements the Tools mode feature requested in issue #88:

## Core Features
- **!! prefix detection**: Added detection for `!!` vs `!` prefixes in input handling
- **Tools mode UI**: Added "TOOLS MODE" indicator with usage examples  
- **Tool command handler**: Added `handleToolCommand` in chat_handler.go
- **Tool call parsing**: Added `parseToolCall` and `parseArguments` methods
- **Direct tool execution**: Tools execute directly using existing ToolService
- **Autocompletion**: Extended autocomplete to suggest available tools with `!!` prefix
- **Help integration**: Added `!!` shortcut to help bar

## Available Tools for Direct Execution
- `!!Read(file_path="/path/to/file")`
- `!!Write(file_path="/path", content="text")`
- `!!WebSearch(query="search term")`
- `!!Bash(command="ls -la")`
- `!!Tree()`
- `!!Grep(pattern="search", path=".")`

## Implementation Details
- **UI Layer**: Modified input_view.go to detect `!!` vs `!` prefixes
- **Handler Layer**: Added tool command parsing and execution methods
- **Autocomplete**: Extended to load and filter tool suggestions dynamically
- **Error Handling**: Proper validation and user-friendly error messages
- **Tool Response Formatting**: Structured display of tool execution results

## Testing & Quality
- **Unit Tests**: Added comprehensive tests for tool parsing and autocomplete
- **Integration Tests**: Verified with existing test suite
- **Quality Checks**: Passed linting, formatting, and static analysis
- **Documentation**: Updated CLAUDE.md with Tools mode usage

## Usage Examples
```
!!WebSearch(query="golang best practices")
!!Read(file_path="README.md")
!!Tree()
!!Bash(command="git status")
```

The feature maintains the existing `!` bash mode while adding the new `!!` 
tools mode with autocompletion support.

Closes #88

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <[email protected]>
@edenreich

Copy link
Copy Markdown
Contributor Author

Much easier to test tools now...

@edenreich
edenreich merged commit 1d56cf2 into main Aug 20, 2025
@edenreich
edenreich deleted the claude/issue-88-20250820-2155 branch August 20, 2025 23:50
inference-gateway-releaser Bot pushed a commit that referenced this pull request Aug 20, 2025
## [0.32.0](v0.31.0...v0.32.0) (2025-08-20)

### 🚀 Features

* Add Tools mode with !! prefix for direct tool execution ([#90](#90)) ([1d56cf2](1d56cf2)), closes [#88](#88) [#88](#88)
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Make it possible to go into Tools mode with !!

1 participant