Skip to main content

Janito4 - an OpenAI CLI with function calling and MCP

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
  • 📊 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 janito4

# Configure interactively
janito4 --config

# Or set options directly
janito4 --set provider=openai --set-api-key="sk-your-key" --set model=gpt-4

# Start chatting
janito4 "Hello!"

Installation

From PyPI

pip install janito4

For development setup, see README_DEV.md.

Configuration

Interactive Setup

janito4 --config

You'll be prompted for:

  • Provider - openai, anthropic, azure, 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:

# Set the provider
janito4 --set provider=openai

# Set your API key
janito4 --set-api-key="sk-your-key-here"

# Set the model
janito4 --set model=gpt-4

# Combine multiple options
janito4 --set provider=openai --set model=gpt-4 --set-api-key="sk-your-key"

View Configuration

janito4 --show-config

Available Options

Option Description Example
provider Provider name openai, anthropic, azure, 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

janito4 "What is the capital of France?"

Pipe Input

echo "Tell me a joke" | janito4

Interactive Chat

janito4

Commands in chat mode:

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

Logging

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

Examples

OpenAI

janito4 --set provider=openai --set-api-key="sk-your-key" --set model=gpt-4 "Explain quantum computing"

Local LLM (LM Studio, Ollama)

janito4 --set provider=openai --set-api-key="not-needed" --set model="local-model" "What is 2+2?"

Azure OpenAI

janito4 --set provider=azure --set-api-key="your-key" --set model="gpt-4" "Hello"

Built-in Tools

Janito4 includes tools for common tasks:

Email Integration (Gmail)

# Authenticate with Gmail
janito4 --gmail-auth

# Use Gmail in chat mode
janito4 --gmail

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

For full Gmail documentation, see janito4/tools/README.gmail.md.

Cloud Storage (OneDrive)

# Authenticate with Microsoft OneDrive
janito4 --onedrive-auth

# Use OneDrive in chat mode
janito4 --onedrive

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

For full OneDrive documentation, see janito4/tools/README.onedrive.md.

File Operations

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

# Read file
janito4.tools.files.read_file README.md --max-lines 20
janito4 "Search the web for the latest Python news"

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

Metadata

Release files for janito4 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for janito4 0.5.0
File Size Uploaded
janito4-0.5.0.tar.gz 114.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for janito4 0.5.0
File Interpreter ABI Platform
janito4-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 278.2 kB

Release files / janito4-0.5.0.tar.gz

Download URL janito4-0.5.0.tar.gz
Size 114.2 kB
Tags Source
SHA-256 checksum
How to use checksums
35f89e8f0234775cb132dd7a86103813ad9c2ab5ea62792e2bff486d30e440a3
BLAKE2b-256 checksum
How to use checksums
932bc753e47ad14dad629c5b9ebbd134619d29e453fcb60d57cdaf17e7799965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / janito4-0.5.0-py3-none-any.whl

Download URL janito4-0.5.0-py3-none-any.whl
Size 164.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c09335b5c27b837c50c4f616b8fd4c97375e0910833280d51eaa2d5888017c7c
BLAKE2b-256 checksum
How to use checksums
1f6d3da92966dbed3c23a57bbbefcd6256e58806a3f73806bd568ef04a040593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page