Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f91e2d3
fix windows spawn
alexx-ftw Jul 23, 2025
dff7a27
Merge pull request #1 from alexx-ftw/codex/implement-changes-from-iss…
alexx-ftw Jul 23, 2025
58b48ba
chore: update deps and tsconfig
alexx-ftw Jul 23, 2025
4f3b451
chore: bump version to 1.1.5 and rebuild
alexx-ftw Jul 23, 2025
4cb53df
Add test for Windows shell option
alexx-ftw Jul 23, 2025
defe46d
Merge pull request #3 from alexx-ftw/codex/update-version-to-1.1.5
alexx-ftw Jul 23, 2025
9394de9
Merge pull request #4 from alexx-ftw/codex/add-test-for-executecomman…
alexx-ftw Jul 23, 2025
7037ed8
Merge branch 'main' into codex/ensure-package-dependencies-and-types-…
alexx-ftw Jul 23, 2025
96148fb
Merge pull request #2 from alexx-ftw/codex/ensure-package-dependencie…
alexx-ftw Jul 23, 2025
606bc8c
fix(package): correct json syntax
alexx-ftw Jul 23, 2025
2d6b031
Merge pull request #5 from alexx-ftw/codex/fix-package.json-json-pars…
alexx-ftw Jul 23, 2025
beb9d60
fix(gemini): quote prompts on windows
alexx-ftw Jul 23, 2025
eb2979d
Merge pull request #6 from alexx-ftw/codex/fix-string-escaping-in-mcp…
alexx-ftw Jul 23, 2025
b435c86
test: cover embedded quotes
alexx-ftw Jul 23, 2025
ccd55c2
Merge branch 'main' into 4ibi2m-codex/fix-string-escaping-in-mcp-gemi…
alexx-ftw Jul 23, 2025
8180fdb
chore: remove dist directory from version control
alexx-ftw Jul 24, 2025
fbca21b
Merge pull request #7 from alexx-ftw/4ibi2m-codex/fix-string-escaping…
alexx-ftw Jul 24, 2025
861745b
Merge pull request #8 from alexx-ftw/codex/remove-dist-files-from-pr
alexx-ftw Jul 24, 2025
54d0c82
docs: fix GitHub npx command
alexx-ftw Jul 24, 2025
7ec99f8
Merge branch 'main' into remove-dist-files-from-pr
alexx-ftw Jul 24, 2025
0e5d5d7
Merge pull request #9 from alexx-ftw/remove-dist-files-from-pr
alexx-ftw Jul 24, 2025
8f516af
test: cover legacy change mode format
alexx-ftw Aug 3, 2025
46c2225
Merge pull request #10 from alexx-ftw/find-and-fix-a-bug-in-codebase
alexx-ftw Aug 3, 2025
7a63961
docs: fix typo in funding docs
alexx-ftw Aug 3, 2025
cf1f479
Apply suggestion from @gemini-code-assist[bot]
alexx-ftw Aug 3, 2025
101ff44
Merge pull request #11 from alexx-ftw/fix-spelling-in-funding.md
alexx-ftw Aug 3, 2025
a0b4916
fix: remove stray plus in no-edits message
alexx-ftw Aug 3, 2025
8253728
docs: clarify brainstorming ideaCount default
alexx-ftw Aug 3, 2025
3271ce6
test: verify command executor progress and errors
alexx-ftw Aug 3, 2025
a36db22
Update src/tools/brainstorm.tool.ts
alexx-ftw Aug 3, 2025
34afd18
Merge pull request #13 from alexx-ftw/update-description-in-brainstor…
alexx-ftw Aug 3, 2025
6dcdf36
refactor: centralize no-edits message
alexx-ftw Aug 3, 2025
ad20e4a
Merge pull request #12 from alexx-ftw/edit-geminiexecutor.ts-to-fix-t…
alexx-ftw Aug 3, 2025
f907ed2
test: refactor command executor tests
alexx-ftw Aug 3, 2025
c5ea4c8
Merge pull request #14 from alexx-ftw/add-tests-for-commandexecutor-f…
alexx-ftw Aug 3, 2025
0b70a0e
docs: fix outdated slash commands
alexx-ftw Aug 3, 2025
f28c8d6
Merge pull request #15 from alexx-ftw/update-documentation-to-reflect…
alexx-ftw Aug 3, 2025
cb1b6fc
docs: expand brainstorming options and clarify prompt usage
alexx-ftw Aug 3, 2025
908d85e
Merge branch 'main' into w3yia8-update-documentation-to-reflect-curre…
alexx-ftw Aug 3, 2025
691343d
Merge pull request #16 from alexx-ftw/w3yia8-update-documentation-to-…
alexx-ftw Aug 3, 2025
234eb59
Add logger tests
alexx-ftw Aug 11, 2025
e7230bd
chore: type tool arguments
alexx-ftw Aug 11, 2025
7ce7bd4
chore: remove unused timeout manager
alexx-ftw Aug 11, 2025
fc1e03d
chore: format source files
alexx-ftw Aug 11, 2025
cb96211
Update src/tools/ask-gemini.tool.ts
alexx-ftw Aug 11, 2025
283ccba
Update src/tools/ask-gemini.tool.ts
alexx-ftw Aug 11, 2025
e927495
Update src/tools/timeout-test.tool.ts
alexx-ftw Aug 11, 2025
36b38d3
refactor: consolidate logger tests
alexx-ftw Aug 11, 2025
6df60d0
Merge pull request #17 from alexx-ftw/update-logger-implementation
alexx-ftw Aug 11, 2025
2e2fbeb
Merge pull request #18 from alexx-ftw/add-typed-definitions-for-tool-…
alexx-ftw Aug 11, 2025
0cdd6f6
Merge pull request #19 from alexx-ftw/evaluate-timeout-management-needs
alexx-ftw Aug 11, 2025
7381cd6
chore: skip docs deploy on forks
alexx-ftw Aug 11, 2025
9e2d7fb
chore: remove placeholder comment from logger
alexx-ftw Aug 11, 2025
9da3147
Remove newline from formatted log messages
alexx-ftw Aug 11, 2025
06f908a
Merge pull request #21 from alexx-ftw/fix-failing-job-in-ci-pipeline
alexx-ftw Aug 11, 2025
816075a
Merge pull request #22 from alexx-ftw/remove-wip-comment-from-logger.ts
alexx-ftw Aug 11, 2025
ca35c78
Merge pull request #23 from alexx-ftw/modify-formatmessage-to-remove-…
alexx-ftw Aug 11, 2025
9fc9f0a
Resolve merge conflicts between formatting (PR #20) and functional im…
alexx-ftw Aug 11, 2025
037c88f
Merge pull request #20 from alexx-ftw/run-formatter-and-commit-changes
alexx-ftw Aug 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ jobs:
path: docs/.vitepress/dist

deploy:
if: github.repository == 'jamubc/gemini-mcp-tool'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
28 changes: 28 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# AGENT Guidance

## Development
- Use TypeScript with an object-oriented approach when adding new features.
- Follow test-driven development. Add or update tests under `tests` and run `npm test`.
- Lint code with `npm run lint` before committing.
- Build with `npm run build` to ensure TypeScript compiles. The compiled output
is written to `dist/`, which is gitignored and should not be committed.
- A `prepare` script builds `dist/` when installing from git, so `npx -y <repo>`
works without committing compiled files.
- Run `ruff` on any Python files with `select = ["ALL"]`. Only ignore rules with a strong justification.
- Keep `@modelcontextprotocol/sdk` and `zod` listed as both peer and dev dependencies. Their versions should match across sections of `package.json`.
- Ensure `@types/node` is installed and referenced via `tsconfig.json` under `compilerOptions.types`.

## Windows Compatibility
- The command executor uses `shell: process.platform === "win32"` to avoid ENOENT errors.
- Documented in `docs/resources/troubleshooting.md`.
- Prompts passed to the Gemini CLI on Windows are automatically quoted and escaped.
- Unit tests verify quoting for multi-line prompts with special characters, including embedded double quotes, on Windows.

## Repository Scripts
- `npm test` – runs the Vitest suite.
- `npm run lint` – checks TypeScript types via `tsc --noEmit`.
- `npm run build` – compiles TypeScript to `dist/`.

## Package.json Integrity
- Ensure `package.json` is valid JSON. Running `npm install` or `npm run lint` will fail fast if syntax errors are present.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

## [1.1.5]
- Bump version to 1.1.5

## [1.1.3]
- "gemini reads, claude edits"
- Added `changeMode` parameter to ask-gemini tool for structured edit responses using claude edit diff.
Expand Down
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ Before using this tool, ensure you have:
claude mcp add gemini-cli -- npx -y gemini-mcp-tool
```

To run the latest development version from GitHub without installing from npm:

```bash
npx -y https://github.com/jamubc/gemini-mcp-tool
```

### Verify Installation

Type `/mcp` inside Claude Code to verify the gemini-cli MCP is active.
Expand Down Expand Up @@ -133,6 +139,16 @@ The sandbox mode allows you to safely test code changes, run scripts, or execute
- `use gemini sandbox to install numpy and create a data visualization`
- `test this code safely: Create a script that makes HTTP requests to an API`

### Brainstorming Sessions

- `brainstorm ways to improve developer onboarding using design-thinking`
- `generate 5 marketing campaign ideas with constraints: budget under $500`

### Handling Large Edit Suggestions

- `ask gemini to refactor @src/**/*.ts changeMode:true`
- `/gemini-cli:fetch-chunk cacheKey=<key> chunkIndex=2`

### Tools (for the AI)

These tools are designed to be used by the AI assistant.
Expand All @@ -141,6 +157,18 @@ These tools are designed to be used by the AI assistant.
- **`prompt`** (required): The analysis request. Use the `@` syntax to include file or directory references (e.g., `@src/main.js explain this code`) or ask general questions (e.g., `Please use a web search to find the latest news stories`).
- **`model`** (optional): The Gemini model to use. Defaults to `gemini-2.5-pro`.
- **`sandbox`** (optional): Set to `true` to run in sandbox mode for safe code execution.
- **`changeMode`** (optional): When `true`, returns structured edit suggestions that can be applied directly. Large change-mode responses can be retrieved in chunks using `fetch-chunk`.
- **`brainstorm`**: Generates structured brainstorming ideas using frameworks like SCAMPER or design thinking.
- **`prompt`** (required): The challenge or question to explore.
- **`methodology`** (optional): The creative framework to use (e.g., `scamper`, `design-thinking`).
- **`domain`** (optional): The subject area for context (e.g., `software`, `marketing`).
- **`constraints`** (optional): Any limitations to consider (e.g., `budget under $500`).
- **`existingContext`** (optional): Background information to build upon.
- **`ideaCount`** (optional): The number of ideas to generate.
- **`includeAnalysis`** (optional): Whether to include analysis for each idea.
- **`fetch-chunk`**: Retrieves cached chunks from a previous `ask-gemini` changeMode response.
- **`cacheKey`** (required): Provided in the initial changeMode response.
- **`chunkIndex`** (required): Which chunk to fetch (1-based index).
- **`sandbox-test`**: Safely executes code or commands in Gemini's sandbox environment. Always runs in sandbox mode.
- **`prompt`** (required): Code testing request (e.g., `Create and run a Python script that...` or `@script.py Run this safely`).
- **`model`** (optional): The Gemini model to use.
Expand All @@ -151,12 +179,17 @@ These tools are designed to be used by the AI assistant.

You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested).

- **/analyze**: Analyzes files or directories using Gemini, or asks general questions.
- **`prompt`** (required): The analysis prompt. Use `@` syntax to include files (e.g., `/analyze prompt:@src/ summarize this directory`) or ask general questions (e.g., `/analyze prompt:Please use a web search to find the latest news stories`).
- **/sandbox**: Safely tests code or scripts in Gemini's sandbox environment.
- **`prompt`** (required): Code testing request (e.g., `/sandbox prompt:Create and run a Python script that processes CSV data` or `/sandbox prompt:@script.py Test this script safely`).
- **/help**: Displays the Gemini CLI help information.
- **/ping**: Tests the connection to the server.
- **/gemini-cli:analyze**: Analyzes files or directories using Gemini, or asks general questions.
- **`prompt`** (required): The analysis request. Use `@` syntax to include files (e.g., `/gemini-cli:analyze @src/ summarize this directory`) or ask general questions (e.g., `/gemini-cli:analyze Please use a web search to find the latest news stories`). Prefixing the request with `prompt:` is optional.
- **`changeMode`** (optional): Returns structured edit suggestions. Large change-mode responses will include a `cacheKey` for use with `/gemini-cli:fetch-chunk`.
- **/gemini-cli:sandbox**: Safely tests code or scripts in Gemini's sandbox environment.
- **`prompt`** (required): Code testing request (e.g., `/gemini-cli:sandbox Create and run a Python script that processes CSV data` or `/gemini-cli:sandbox @script.py Test this script safely`). Prefix with `prompt:` if your client requires it.
- **/gemini-cli:brainstorm**: Generates structured ideas using creative methodologies.
- **`prompt`** (required): The challenge to explore.
- Optional arguments: `methodology`, `domain`, `constraints`, `existingContext`, `ideaCount`, `includeAnalysis`.
- **/gemini-cli:fetch-chunk**: Retrieves additional change-mode edits using a provided `cacheKey` and `chunkIndex`.
- **/gemini-cli:help**: Displays the Gemini CLI help information.
- **/gemini-cli:ping**: Tests the connection to the server.
- **`message`** (optional): A message to echo back.

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>
<template #nav-bar-content-before>
<div class="nav-warning">
🏷️ <span>1.1.4</span>
🏷️ <span>1.1.5</span>
</div>
</template>
<template #sidebar-nav-after>
Expand Down
2 changes: 1 addition & 1 deletion docs/funding.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ layout: funding

<ul>
<li><strong>Docs & Listing:</strong> Updating and maintaining the documentation website & outreach</li>
<li><strong>API Testing Credits:</strong> Funds are used for testing various deployements of gemini-mcp-tool on popular clients.</li>
<li><strong>API Testing Credits:</strong> Funds are used for testing various deployments of `Gemini MCP Tool` on popular clients.</li>
</ul>

<div class="progress-bar">
Expand Down
8 changes: 7 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ features:
details: We dont re-invent the wheel.
- icon: 🤝
title: Claude's new best friend
details: Let Claude use Gemini naturally, because 3 is a party.
details: Let Claude use Gemini naturally, because 3 is a party.
- icon: 🔌
title: MCP Standards
details: |
Expand All @@ -35,6 +35,12 @@ features:
- icon: 🚦
title: Model Selection
details: Choose from Gemini-2.5-Pro and Gemini-2.5-Flash, using natural language.
- icon: 🧠
title: Structured Brainstorming
details: Generate creative ideas with SCAMPER, design thinking, or lateral thinking frameworks.
- icon: 📦
title: Large Edit Handling
details: Change-mode responses can be chunked and retrieved on demand.
---

<div class="explore-hint" style="text-align: center; margin: 32px 0 48px; position: relative;">
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ gemini "Hello"
- **NPX flag issues**: Use `--yes` instead of `-y`
- **Path problems**: Restart terminal after Node.js installation
- **Connection issues**: Ensure Windows Defender isn't blocking Node.js
- **Spawn ENOENT errors**: Upgrade to gemini-mcp-tool >=1.1.5 or ensure the
command executor sets `shell: process.platform === "win32"`

### macOS
- **Permission issues**: Use `sudo` if npm install fails
Expand Down
31 changes: 29 additions & 2 deletions docs/usage/commands.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Commands Reference

Complete list of available commands and their usage.
Expand All @@ -21,6 +22,20 @@ Execute code in a safe environment.
/gemini-cli:sandbox test this function: [code]
```

### `/gemini-cli:brainstorm`
Generate structured ideas using creative methodologies.

```
/gemini-cli:brainstorm prompt:"Improve onboarding flow" methodology:scamper ideaCount:8
```

### `/gemini-cli:fetch-chunk`
Retrieve additional change-mode edits using a cache key and chunk index.

```
/gemini-cli:fetch-chunk cacheKey=<key> chunkIndex=2
```

### `/gemini-cli:help`
Show help information and available tools.

Expand All @@ -43,7 +58,7 @@ Test connectivity with Gemini.
/gemini-cli:<tool> [options] <arguments>
```

- **tool**: The action to perform (analyze, sandbox, help, ping)
- **tool**: The action to perform (analyze, sandbox, brainstorm, fetch-chunk, help, ping)
- **options**: Optional flags (coming soon)
- **arguments**: Input text, files, or questions

Expand Down Expand Up @@ -99,9 +114,21 @@ Instead of slash commands, you can use natural language:
/gemini-cli:analyze @models/user.js generate TypeScript types for this model
```

### Structured Edits and Chunks
```
/gemini-cli:analyze @src/**/*.ts changeMode:true
# Fetch subsequent edits
/gemini-cli:fetch-chunk cacheKey=<key> chunkIndex=2
```

### Brainstorming Ideas
```
/gemini-cli:brainstorm prompt:"New product features" methodology:design-thinking includeAnalysis:false
```

## Tips

1. **Start Simple**: Begin with single files before using patterns
2. **Be Specific**: Clear questions get better answers
3. **Use Context**: Include relevant files for better analysis
4. **Iterate**: Refine your queries based on responses
4. **Iterate**: Refine your queries based on responses
22 changes: 21 additions & 1 deletion docs/usage/examples.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Real-World Examples

Practical examples of using Gemini MCP Tool in development workflows.
Expand Down Expand Up @@ -92,6 +93,13 @@ give me an overview of this project's architecture
@src/auth/*.js does this follow security best practices?
```

## Brainstorming

### Generating Ideas
```
/gemini-cli:brainstorm prompt:"Ways to improve developer onboarding" methodology:design-thinking ideaCount:6
```

## Migration

### Framework Upgrade
Expand Down Expand Up @@ -131,6 +139,18 @@ identify performance bottlenecks in the request pipeline
@src/**/*.js look for potential memory leaks or inefficient patterns
```

## Handling Large Edits

When change mode returns more edits than fit in a single message, Gemini caches the response. Use `fetch-chunk` to continue.

```bash
# Initial request
/gemini-cli:analyze @src/**/*.ts changeMode:true

# Retrieve the next chunk
/gemini-cli:fetch-chunk cacheKey=<key> chunkIndex=2
```

## Real Project Example

### Full Stack Review
Expand Down Expand Up @@ -162,4 +182,4 @@ what critical paths lack test coverage?
2. **Combine Related Files**: Include configs with source code
3. **Ask Follow-up Questions**: Build on previous responses
4. **Use Specific Criteria**: Tell Gemini what to look for
5. **Iterate on Solutions**: Refine based on suggestions
5. **Iterate on Solutions**: Refine based on suggestions
Loading