Skip to main content

OpenAI CLI with Function Calling, MCP Support, and Extensible Tools

Project description

janito - an OpenAI CLI with function calling and MCP

📖 Full documentation available at https://ikignosis.org/janito/

Features

  • 🔧 Function Calling - Built-in tools for file operations, web search, and more
  • 📧 Gmail Integration - Read, search, and manage emails
  • ☁️ OneDrive Integration - Browse, upload, download, and share files
  • 🔌 MCP Support - Connect to Model Context Protocol servers
  • 🧩 Skills - Install and use task-specific skills from GitHub
  • 📊 Real-time Progress - Watch tool execution progress as it happens
  • 🚀 Easy Setup - Interactive configuration with --config or quick setup with --set flags
  • 🔗 Any OpenAI-Compatible API - Works with OpenAI, local servers (LM Studio, Ollama), and custom endpoints

Quick Start

# Install
pip install janito

# Configure interactively
janito --config

# Or set options directly (two steps: config, then API key)
janito --set provider=openai --set model=gpt-4
janito --set-api-key="sk-your-key" --provider openai

# Start chatting
janito "Hello!"

Installation

From PyPI

pip install janito

For development setup, see README_DEV.md.

Configuration

Interactive Setup

janito --config

You'll be prompted for:

  • Provider - openai or custom
  • API Key - Masked for security
  • Model - e.g., gpt-4, gpt-3.5-turbo
  • Context Window - Max tokens (default: 65536)

Quick Configuration with --set

Set options directly from the command line:

# Single key-value
janito --set model=gpt-4

You can also use --get, --unset, and --set-secret with multiple values.

View Configuration

janito --show-config

Available Options

Option Description Example
provider Provider name openai, custom
model Model name gpt-4, claude-3-opus
context-window Context window size 65536

For custom endpoints (base-url), see README_LOCAL.md.

Usage

Single Prompt

janito "What is the capital of France?"

Pipe Input

echo "Tell me a joke" | janito

Interactive Chat

janito

Commands in chat mode:

  • exit / quit - End session
  • restart - Clear conversation history
  • Ctrl+D / Ctrl+Z - Exit

Logging

janito --log=info "Your prompt"      # Info level
janito --log=debug "Your prompt"     # Debug level
janito --log=info,debug "Your prompt" # Multiple levels

Examples

OpenAI

# Step 1: Set provider and model
janito --set provider=openai --set model=gpt-4
# Step 2: Store API key
janito --set-api-key="sk-your-key" --provider openai

# Then run any prompt
janito "Explain quantum computing"

Alibaba (Qwen)

# Step 1: Set provider and model
janito --set provider=alibaba --set model=qwen-plus
# Step 2: Store API key
janito --set-api-key="your-dashscope-api-key" --provider alibaba

# Then run any prompt
janito "Explain quantum computing"

Custom Endpoint

janito --set provider=custom --set base-url=http://localhost:8000/v1

Built-in Tools

janito includes tools for common tasks:

Email Integration (Gmail)

# Use Gmail in chat mode
janito --gmail

# Check emails
janito --gmail "Show my unread emails from today"

For full Gmail documentation, see README.gmail.md.

Cloud Storage (OneDrive)

# Authenticate with Microsoft OneDrive
janito --onedrive-auth

# Use OneDrive in chat mode
janito --onedrive

# List files
janito --onedrive "List my files in Documents"

For full OneDrive documentation, see README.onedrive.md.

File Operations

# List files
janito.tools.files.list_files . --recursive --pattern "*.py"

# Read file
janito.tools.files.read_file README.md --max-lines 20

MCP Tools

Connect to MCP servers using the /mcp command inside the interactive shell:

# Add a stdio-based MCP server
/mcp add myserver stdio python -m mcp.server

# Add an HTTP-based MCP server
/mcp add remote http https://api.example.com/mcp

# List configured servers
/mcp list

For full MCP documentation, see README_MCP.md.

Tool Progress Reporting

Tools report progress in real-time:

🔄 Reading files...
📊 Processing: 50/100 files
✅ Completed: 100 files (2.3MB)

Progress messages go to stderr so they don't interfere with tool output.

Error Handling

Exit Code Meaning
0 Success
1 Configuration or runtime error
130 User cancelled (Ctrl+C)

Dependencies

  • Python 3.6+
  • openai>=1.0.0
  • rich>=10.0.0
  • prompt-toolkit>=3.0.0
  • requests (for MCP support)

License

MIT License

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

janito-4.3.0.tar.gz (137.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

janito-4.3.0-py3-none-any.whl (170.7 kB view details)

Uploaded Python 3

File details

Details for the file janito-4.3.0.tar.gz.

File metadata

  • Download URL: janito-4.3.0.tar.gz
  • Upload date:
  • Size: 137.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for janito-4.3.0.tar.gz
Algorithm Hash digest
SHA256 d0f83e9acd713f19a681ef5b739d685c9e8c3fe904e9327388144c16b2be9da3
MD5 c7851bb61e10627cda99bc0521e15113
BLAKE2b-256 92a170bf6e2cc437f00dcb594c15d3d67a2824ee83852f30f0d9905263600c85

See more details on using hashes here.

File details

Details for the file janito-4.3.0-py3-none-any.whl.

File metadata

  • Download URL: janito-4.3.0-py3-none-any.whl
  • Upload date:
  • Size: 170.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for janito-4.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddac01198b66a5708011727a76f74068d6b14a919b76402930d85b244bcf25f5
MD5 338763bab2b4de62441030f32f73a219
BLAKE2b-256 89f0d92c829fb61e18b44692a2e88151c130790fd99d2051d065c1dea8a02fb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page