gmn offers a lightweight, non-interactive CLI for Gemini, reimplementing the official tool's features in Go for improved speed and compatibility. Achieving 37x faster startup times, this tool makes scripting and automation seamless while providing full access to Google authentication, allowing for efficient command execution and interaction.
gmn is a lightweight, non-interactive CLI tool designed for efficient interaction with the Gemini Protocol, crafted with Go as a tribute to Google's Gemini CLI. It enhances automation and scripting capabilities by delivering a 37x faster startup compared to the official Node.js-based version, ensuring a seamless user experience.
Key Features
- Speed: Experience significantly faster execution times. For example, issuing the command:
takes just 0.02 seconds compared to 0.94 seconds for the official CLI.
$ time gmn "hi" > /dev/null - Simplicity: Utilize a straightforward prompt system for quick command execution.
- Extensibility: Easily integrate file contexts and JSON output for advanced use cases.
Usage Examples
To get started with gmn, consider the following commands:
# Prompt without context
gmn "Explain quantum computing"
# Include file context
gmn "Review this code" -f main.go
# Pipe input from a file
cat error.log | gmn "What's wrong?"
# Output in JSON format
gmn "List 3 colors" -o json
# Specify a model
gmn "Write a poem" -m gemini-2.5-pro
MCP (Model Context Protocol) Support
gmn includes support for MCP servers, allowing users to set up servers via a configuration file:
{
"mcpServers": {
"my-server": {
"command": "/path/to/mcp-server"
}
}
}
Commands for MCP usage include listing available tools and executing them as needed:
# List available tools
gmn mcp list
# Call a specific tool
gmn mcp call my-server tool-name arg=value
System Requirements
Authentication through the official Gemini CLI is required before using gmn. First, install the official Gemini CLI with:
npm install -g @google/gemini-cli
gemini # Follow the prompts to log in with Google
After that, gmn will utilize the same credentials automatically.
With a compact binary size of just 5.6MB, gmn is suitable for efficient, resource-conscious environments. For users looking for a more robust CLI experience without the overhead of a Node.js runtime, gmn presents an ideal solution.
No comments yet.
Sign in to be the first to comment.