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 🙏

© 2025 – Pkg Stats / Ryan Hefner

harshcligemini

v1.0.2

Published

Run Google Gemini from your terminal. Fast CLI with chat mode, Markdown, and config management.

Downloads

20

Readme

Streaming output (token-by-token):

gemini --stream "Write a limerick about cats"

npm-gemini

Run Google Gemini from your terminal. Fast CLI with chat mode, Markdown output, and simple config.

Install

Global install (recommended):

# from the project root
npm install -g .

Or use it locally with npx while developing:

npx --yes . --help

Authenticate

You need a Gemini API key. Get one from:

  • https://aistudio.google.com/app/apikey

Then set it once:

gemini auth YOUR_API_KEY

Alternatively, set an environment variable (takes priority):

export GEMINI_API_KEY=YOUR_API_KEY

Usage

Basic prompt:

gemini "Explain webhooks like I'm five"

Pipe from stdin:

# prompt can be provided as args or omitted when piping
cat README.md | gemini "Summarize this file"
cat README.md | gemini

Choose a model and temperature:

gemini -m gemini-1.5-pro -t 0.4 "Draft a professional email about a shipping delay"

Raw JSON output:

gemini --json "Return a JSON array of 5 startup ideas with fields: name, one_liner"

Disable Markdown rendering:

gemini --no-md "Show raw text only"

Interactive chat:

gemini chat

With a system instruction:

gemini chat --system "You are a concise, senior TypeScript engineer."

Config

View current config:

gemini whoami

Get config JSON:

gemini config --get

Set defaults:

gemini config --set model=gemini-1.5-pro temp=0.4 system="Be terse"

Config is stored at:

  • ~/.config/gemini-cli/config.json

Environment variable GEMINI_API_KEY overrides the stored key.

Programmatic API

You can also import the library methods if you install this package as a dep:

import { generateText } from 'npm-gemini';

const { text } = await generateText({
  apiKey: process.env.GEMINI_API_KEY,
  model: 'gemini-1.5-flash',
  temperature: 0.7,
  prompt: 'Write a haiku about JavaScript',
});
console.log(text);

Notes

  • Requires Node.js 18+.
  • Uses the official @google/generative-ai SDK.
  • Markdown is rendered in the terminal via marked + marked-terminal. Use --no-md to print plain text.
  • For issues or feature requests (e.g., response streaming), open an issue.