Metadata-Version: 2.4
Name: saarthi-cli
Version: 0.1.0
Summary: Your AI copilot in the terminal - a LangGraph-powered CLI chatbot with long-term memory
Author-email: Snehangshu Bhuin <snehangshu.dev@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/snehangshu2002/saarthi-cli
Project-URL: Repository, https://github.com/snehangshu2002/saarthi-cli
Project-URL: Documentation, https://github.com/snehangshu2002/saarthi-cli#readme
Project-URL: Issues, https://github.com/snehangshu2002/saarthi-cli/issues
Keywords: ai,chatbot,cli,langgraph,terminal
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: aiosqlite>=0.22.1
Requires-Dist: arxiv>=4.0.0
Requires-Dist: ddgs>=9.14.4
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: langchain>=1.2.18
Requires-Dist: langchain-community>=0.4.1
Requires-Dist: langchain-mcp-adapters>=0.2.2
Requires-Dist: langchain-openai>=1.2.1
Requires-Dist: langchain-google-genai>=4.2.2
Requires-Dist: langchain-tavily>=0.2.18
Requires-Dist: langgraph>=1.1.10
Requires-Dist: langgraph-checkpoint-sqlite>=3.1.0
Requires-Dist: mcp>=1.27.1
Requires-Dist: prompt-toolkit>=3.0.52
Requires-Dist: pyfiglet>=1.0.4
Requires-Dist: rich>=15.0.0
Requires-Dist: wikipedia>=1.4.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"

# Saarthi CLI

**AI copilot for the terminal.**
Saarthi is a LangGraph-powered CLI chatbot with persistent memory, real-time token streaming, MCP integration, and multi-provider support. It runs entirely inside the terminal with a custom TUI built using `prompt-toolkit`.

No browser. No Electron. No cloud dashboard.

> Current release: `0.1.0`

[![PyPI version](https://badge.fury.io/py/saarthi-cli.svg)](https://pypi.org/project/saarthi-cli/)
[![Python](https://img.shields.io/pypi/pyversions/saarthi-cli.svg)](https://pypi.org/project/saarthi-cli/)
[![GitHub](https://img.shields.io/github/v/release/snehangshu2002/saarthi-cli?label=github)](https://github.com/snehangshu2002/saarthi-cli)

---

## Features

* Short-term and long-term memory support
* Local SQLite-backed conversation persistence
* Named chat sessions with resume support
* Real-time token streaming
* Live tool-call visualisation
* MCP (Model Context Protocol) server support
* Interactive terminal UI built with `prompt-toolkit`
* Multi-provider LLM support
* Local-first architecture
* Built-in developer tools

---

## Supported providers

* OpenAI
* Google Gemini
* Mistral AI

More providers and local model support are planned.

---

## Built-in tools

| Tool         | Description                                |
| ------------ | ------------------------------------------ |
| `bash`       | Execute shell commands and Python snippets |
| `calculator` | Evaluate mathematical expressions          |
| `ddg_tool`   | DuckDuckGo web search                      |
| `wiki_tool`  | Wikipedia lookup                           |
| `arxiv_tool` | arXiv paper search                         |

---

## Installation

### Install using pip

```bash
pip install saarthi-cli
```

Run:

```bash
saarthi
```

---

### Install using uv

```bash
uv tool install saarthi-cli
```

Run:

```bash
saarthi
```

---

### Install from source

```bash
git clone https://github.com/snehangshu2002/saarthi-cli.git
cd saarthi-cli

uv sync
uv run python main.py
```

---

### Linux/macOS install script

```bash
curl -fsSL https://raw.githubusercontent.com/snehangshu2002/saarthi-cli/main/install.sh | bash
```

---

## First-time setup

On first launch, Saarthi will guide you through setup:

1. Choose a username
2. Select an LLM provider
3. Enter your API key

API key input is hidden automatically.

---

## Local storage

All configuration and memory are stored locally.

| Platform      | Storage Path                |
| ------------- | --------------------------- |
| Windows       | `%LOCALAPPDATA%\\saarthi\\` |
| Linux / macOS | `~/.local/share/saarthi/`   |

This directory contains:

* `settings.json`
* `mcp_config.json`
* SQLite memory database

---

## Commands

| Command     | Description                |
| ----------- | -------------------------- |
| `/help`     | Show available commands    |
| `/new`      | Start a new session        |
| `/resume`   | Resume an older session    |
| `/settings` | View current configuration |
| `/mcp`      | Show connected MCP servers |
| `/exit`     | Quit Saarthi               |

---

## MCP support

Saarthi supports MCP-compatible servers over STDIO transport.

Default MCP configuration:

```json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/dir"
      ],
      "transport": "stdio"
    }
  }
}
```

You can connect custom MCP servers for:

* Filesystem access
* Browser automation
* Databases
* Coding agents
* External APIs
* Custom tools

---

## Memory system

Saarthi currently supports:

* **Short-term memory** for active conversations
* **Long-term memory** stored locally in SQLite

Conversation history can also be summarised automatically to reduce context size while preserving important information.

---

## Upcoming features

Planned additions include:

* Human-in-the-loop workflows
* Planning mode
* Auto-toggle / autonomous execution mode
* Skill system support
* Export conversations
* More provider integrations
* Local model support
* Plugin-style custom tools
* Better configuration management
* More CLI-agent style workflows

---

## Project structure

```text
src/chatbot_cli/
├── app.py
├── chatbot.py
├── ui.py
├── streaming.py
├── tool.py
├── memory.py
├── sessions.py
├── providers.py
├── mcp_client.py
├── settings.py
└── clipboard.py
```

---

## License

MIT
