Skip to content

robotlearning123/code-with-gemini

Repository files navigation

Gemini Chat CLI

An interactive command-line chat client powered by the Google Gemini API. Stream responses in real time from your terminal.

Built for the Code With Gemini hackathon.

Architecture

┌──────────────┐     ┌──────────────────┐     ┌─────────────────┐
│  Terminal UI │────▶│  gemini-client   │────▶│  Gemini API     │
│  (index.ts)  │◀────│  (gemini-client) │◀────│  (GenerativeAI) │
└──────────────┘     └──────────────────┘     └─────────────────┘
        │                     │
        ▼                     ▼
┌──────────────┐     ┌──────────────────┐
│   readline   │     │     config.ts    │
│   (stdio)    │     │  (env + defaults)│
└──────────────┘     └──────────────────┘

Prerequisites

Setup

npm install

Set your Gemini API key:

export GEMINI_API_KEY="your-api-key-here"

Usage

Build and run:

npm run build
npm start

Development mode (watch + auto-rebuild):

npm run dev

The client opens an interactive chat loop. Type your message and press Enter to receive a streamed response from Gemini. Type exit or quit to end the session.

Project Structure

.
├── src/
│   ├── index.ts          # Entry point, interactive chat loop
│   ├── gemini-client.ts  # Gemini API wrapper (streaming)
│   └── config.ts         # Environment configuration
├── tests/                # Test suite (≥5 passing tests)
├── docs/
│   ├── demo.md           # Demo script / walkthrough
│   └── submission.md     # Devpost submission writeup
├── HACKATHON.md          # Hackathon requirements reference
├── package.json
└── README.md

Built With

  • TypeScript — type-safe runtime
  • @google/generative-ai — Google Gemini API SDK
  • Node.js — server-side JavaScript runtime

License

MIT

About

Interactive Gemini chat CLI — Code With Gemini hackathon submission (Devpost #29517)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors