npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zemerik/gemini-assist

v1.1.2

Published

AI Assistant CLI tool powered by Google Gemini API (50% JS, 50% Rust)

Readme

Gemini Assist v1.1.1-Beta

AI Assistant CLI tool powered by Google Gemini API. Interact with Google's Gemini AI model directly from your terminal.

🚀 Hybrid Architecture: 50% JavaScript, 50% Rust
This project uses Rust for core API operations and JavaScript for the CLI interface, providing the best of both worlds: Rust's performance and JavaScript's flexibility.

Features

  • 🤖 Interactive Chat Mode - Have conversations with Gemini AI
  • 💬 Single Query Mode - Quick one-off questions
  • 🎨 Beautiful CLI Interface - Colorful, user-friendly terminal experience
  • ⚙️ Configurable - Customize model, temperature, and more
  • 📦 Easy Installation - Simple npm package installation
  • 🔑 Secure API Key Management - Support for environment variables

Installation

Prerequisites

  • Node.js >= 14.0.0
  • For Rust build: Rust toolchain (optional, JS fallback available)

Global Installation (Recommended)

npm install -g gemini-assist

Building Rust Components

The package includes Rust bindings for better performance. To build them:

npm install -g @napi-rs/cli
npm run build

If Rust bindings aren't available, the CLI automatically falls back to a JavaScript implementation. See README_RUST.md for details.

Local Installation

npm install gemini-assist

Getting Started

1. Get Your Gemini API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new API key
  4. Copy your API key

2. Set Your API Key

Option A: Environment Variable (Recommended)

export GEMINI_API_KEY=your_api_key_here

Option B: Command Line Flag

gemini-assist --api-key your_api_key_here "Your question here"

Option C: .env File (Recommended for Local Development)

Create a .env file in your project directory:

# Copy the example file
cp .env.example .env

# Then edit .env and add your API key
# GEMINI_API_KEY=your_api_key_here

The .env file is automatically loaded by the CLI using the dotenv package.

Usage

Interactive Mode

Start an interactive chat session:

gemini-assist --interactive

Or simply:

gemini-assist

In interactive mode:

  • Type your questions and press Enter
  • Type exit, quit, bye, or q to end the session
  • Type clear to clear the screen
  • Type history or hist to see conversation message count

Single Query Mode

Ask a quick question:

gemini-assist "What is the capital of France?"

Stdin Support (Piping)

Pipe text directly to Gemini Assist for scripting and automation:

# Pipe text
echo "What is AI?" | gemini-assist

# Process file content
cat document.txt | gemini-assist "Summarize this"

# Chain with other commands
curl -s https://api.example.com/data | gemini-assist "Analyze this JSON"

Command Line Options

gemini-assist [options] [query]

Options:
  -V, --version          Show version number
  --version-info         Show detailed version information
  -k, --api-key <key>    Gemini API key (or set GEMINI_API_KEY env variable)
  -m, --model <model>    Gemini model to use (default: gemini-2.5-flash)
  -i, --interactive      Start interactive chat mode
  -t, --temperature <value>  Temperature for response 0-1 (default: 0.7)
  -h, --help             Display help for command

Examples

# Interactive mode with custom model
gemini-assist --interactive --model gemini-1.5-pro

# Single query with custom temperature
gemini-assist -t 0.9 "Write a creative story"

# Using alias
gassist "Explain quantum computing"

# Pipe text from stdin
echo "Summarize this text" | gemini-assist

# Show detailed version information
gemini-assist --version-info

Programmatic Usage

You can also use Gemini Assist as a Node.js module:

const { GeminiClient } = require('gemini-assist');

const client = new GeminiClient('your-api-key', {
  model: 'gemini-1.5-flash',
  temperature: 0.7
});

async function chat() {
  const response = await client.chat('Hello, how are you?');
  console.log(response);
}

chat();

Available Models

  • gemini-2.5-flash (default) - Latest fast and efficient model
  • gemini-1.5-flash - Fast and efficient, previous version
  • gemini-1.5-pro - More capable model for complex tasks
  • gemini-pro - Legacy model (may be deprecated)

Note: Model availability depends on your API key's access level. If a model doesn't work, try another one.

Configuration

Environment Variables

  • GEMINI_API_KEY - Your Gemini API key (required)
  • DEBUG - Set to true for detailed error messages

Troubleshooting

API Key Issues

If you get an "Invalid API key" error:

  1. Verify your API key at Google AI Studio
  2. Make sure there are no extra spaces when copying the key
  3. Check that the GEMINI_API_KEY environment variable is set correctly

Rate Limits

If you encounter rate limit errors:

  • Wait a few moments before trying again
  • Check your API quota at Google AI Studio
  • Consider upgrading your API plan if needed

Safety Filters

If content is blocked by safety filters:

  • Rephrase your query
  • Avoid potentially harmful or inappropriate content
  • Check Google's content policy

Requirements

  • Node.js >= 14.0.0
  • npm or yarn
  • Valid Gemini API key

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or feature requests, please open an issue on the project repository.


Version: 1.1.1-Beta
Powered by: Google Gemini API