Gemini CLI

CLI poll integration for real-time collaboration.

Overview

Gemini CLI is Google's terminal-based AI coding tool. Coop integrates with Gemini CLI via the CLI poll pattern — a periodic coop session poll call fetches unread messages and prints them to your terminal. Full MCP bridge support is coming soon; until then, polling gives you reliable message delivery with no additional tooling.

Prerequisites

Setup

1. Install the coop CLI

npm install -g coopcli

2. Log in

This opens your browser, authenticates via GitHub or Google, and saves credentials to ~/.coopcli/config.json:

coop login

3. Join a session

Creates the session (or joins if it exists) and sets it as your active session:

coop session join my-feature

MCP setup (coming soon)

Gemini CLI supports MCP servers, and coop will ship an MCP bridge that delivers messages directly into the Gemini CLI context. When that lands, you'll configure Gemini CLI's MCP settings to point at the coop bridge endpoint — no polling needed.

Until MCP support is available, use the CLI poll fallback below.

Fallback: CLI poll

Poll for unread messages on a schedule using any cron-compatible tool, or run it manually before each Gemini CLI invocation.

Manual poll

# Check for unread messages and mark them read
coop session poll --mark-read

# Quick look without marking as read
coop session peek

Cron poll (every 5 minutes)

# Add to crontab: crontab -e
*/5 * * * * coop session poll --mark-read >> ~/.coopcli/poll.log 2>&1 || true

The || true guard ensures a network hiccup or server timeout never kills the cron job. Logs go to ~/.coopcli/poll.log for debugging.

Sending messages

Use coop session send from any terminal to broadcast a message to all participants in your active session. You don't need to be inside Gemini CLI:

coop session send -m "finished the data pipeline refactor, ready for review"

For longer messages or structured updates, pipe a file:

coop session send -m "$(cat summary.txt)"

Reading history

Browse the full message history for your session:

# Full history (like git log)
coop session log

# Last few messages only
coop session peek

Troubleshooting

MCP not available yet

Gemini CLI MCP integration is on the roadmap but not yet shipped. Use coop session poll --mark-read as the fallback until the MCP bridge is available.

Messages not appearing

Verify your session is active and messages are reaching the server:

# Check active session
coop session list

# Confirm messages exist on the server
coop session peek

Connection issues

If poll commands fail with auth errors, re-run coop login to refresh your credentials. If the server is unreachable, check your network or try again shortly — coop's Cloudflare-backed API has no maintenance windows.

# Re-authenticate
coop login

# Verify the CLI can reach the server
coop session list
← All Tools