y-cli
by: luohy15
A Tiny Terminal Chat App for AI Models with MCP Client Support
📌Overview
Purpose:
Provide a lightweight, terminal-based chat interface for interacting with AI models, supporting flexible bot and storage configurations.
Overview:
y-cli is a compact command-line chat application that enables users to converse with AI models directly from the terminal. It supports a variety of storage backends (local and cloud) and multiple AI platforms, offering adaptable workflows, integration with external tools via MCP, and developer-friendly configuration options for bots and prompts.
Key Features:
-
Flexible Storage Options:
Store conversations locally in JSONL files or use Cloudflare KV/R2 for cloud-based storage and backup, ensuring data accessibility and redundancy. -
Multi-Bot and API Integration:
Support for multiple bot configurations, enabling connections to various AI services (OpenAI, Dify, Deepseek, etc.) with customizable endpoints and streaming formats for diverse conversational experiences.
y-cli 🚀
A tiny command-line AI chat application that brings conversational AI to your terminal.
For a web-based version, check out y-gui.
Features
- Flexible storage options:
- Local JSONL files
- Cloudflare KV and R2 cloud sync/backups
- Interactive chat interface with tool execution visualization
- Multiple bot configurations (base_url/api_key/model combo), supporting:
- Reasoning model support:
- Deepseek-r1 reasoning_content output
- OpenAI o3-mini reasoning_effort configuration
- MCP (Model Context Protocol) integration:
- Support for multiple client/server configs (stdio/SSE)
- Persistent daemon
- Custom prompt configs
- Simple "Deep Research" mode by prompt configuration (demo)
Demo
Multiple bot configurations
➜ ~ y-cli bot list
Name API Key API Type Base URL Model Print Speed Description OpenRouter Config MCP Servers Reasoning Effort
----------- ----------- ---------- ----------------------------------- ----------------------------------- ------------- ------------- ------------------- ------------- ------------------
default sk-or-v1... N/A https://gateway.ai.cloudflare.co... google/gemini-2.0-flash-001 None N/A Yes No N/A
claude sk-or-v1... N/A https://gateway.ai.cloudflare.co... anthropic/claude-3.7-sonnet:beta None N/A Yes todo N/A
o3-mini sk-or-v1... N/A https://gateway.ai.cloudflare.co... openai/o3-mini None N/A Yes No low
ds-chat sk-or-v1... N/A https://gateway.ai.cloudflare.co... deepseek/deepseek-chat-v3-0324:free None N/A Yes tavily N/A
dify-bot app-2drF... dify https://api.dify.ai/v1 None N/A No No N/A
Multiple MCP servers
➜ ~ y-cli mcp list
Name Type Command/URL Arguments/Token Environment Auto-Confirm
-------------- ------ ------------------- ----------------- -------------- --------------
brave-search sse https://router.m... brave_web_s...
todo stdio uvx mcp-todo
exa-mcp-server stdio npx exa-mcp-server EXA_API_KEY...
Quick Start
Prerequisites
- uv (for Python management and running the CLI)
- OpenRouter API key (get one here)
Setup
- Install uv: uv installation guide
- Obtain and save your OpenRouter API key.
Running
Without installation:
uvx y-cli
With installation:
uv tool install y-cli
Initialization
y-cli init
Start Chat
y-cli chat
Usage
y-cli [OPTIONS] COMMAND [ARGS]...
Main Commands
chat
: Start or continue a chat conversationlist
: List chat conversations (with filtering)share
: Generate a shareable chat linkbot
: Manage bot configurationsadd
,list
,delete
mcp
: Manage MCP server configurationsadd
,list
,delete
daemon
: Manage the MCP daemonstart
,stop
,status
,log
,restart
prompt
: Manage prompt configurationsadd
,list
,delete
Options
--help
: Show help message and exit
Documentation
See the deepwiki page for full documentation and guides.