Skip to main content

Command-line interface for Medula AI Agent Platform

Project description

Medula CLI

A command-line interface for the Medula AI Agent Platform, designed for developers who want to manage their AI agents from the terminal.

Installation

From PyPI (when published)

pip install medula-cli

Development Installation

git clone https://github.com/Subomi-olagoke/studious-rotary-phone
cd studious-rotary-phone
pip install -e .

Quick Install (Local)

pip install -r requirements.txt
chmod +x medula_cli.py
ln -s $(pwd)/medula_cli.py /usr/local/bin/medula

Quick Start

1. Login

medula auth login
# Enter your Medula email and password

2. List Your Agents

medula agents list

3. Create a New Agent

medula agents create --name "Support Bot" --model claude-3-haiku

4. Chat with Your Agent

medula chat start <agent-id>

5. Initialize a New Project

medula init my-ai-project
cd my-ai-project

Commands

Authentication

medula auth login               # Login to Medula platform
medula auth logout              # Logout and clear credentials  
medula auth whoami              # Show current user info

Agent Management

medula agents list              # List all your agents
medula agents create            # Create a new agent
medula agents show <agent-id>   # Show agent details
medula agents list --format json  # Output as JSON

Interactive Chat

medula chat start <agent-id>           # Start interactive chat
medula chat start <agent-id> --save-session name  # Save conversation

Chat commands while in session:

  • /exit - End the conversation
  • /save - Save current conversation
  • /help - Show help

Training Data

medula data upload <agent-id> --text "Training content"
medula data upload <agent-id> --file document.pdf  # Coming soon

Project Management

medula init <project-name>      # Initialize new project

Configuration

The CLI stores configuration in ~/.medula/:

  • config.json - General configuration
  • Secure token storage via system keyring

Configuration Options

{
  "endpoint": "https://your-medula-instance.com",
  "tenant_id": "your-tenant-id", 
  "user_email": "you@company.com"
}

Examples

Developer Workflow

# Initialize new project
medula init customer-support-bot
cd customer-support-bot

# Create agent
medula agents create --name "Customer Support" --model claude-3-sonnet

# Upload training data
medula data upload <agent-id> --text "Return Policy: Items can be returned within 30 days..."

# Test the agent
medula chat start <agent-id>

CI/CD Integration

# In your CI pipeline
export MEDULA_TOKEN="your-api-token"
medula agents list --format json | jq '.[] | select(.status=="active")'

Advanced Usage

Multiple Environments

# Development
medula auth login --endpoint https://dev-api.medula.ai

# Production  
medula auth login --endpoint https://api.medula.ai

JSON Output for Scripting

# Get all agents as JSON
medula agents list --format json

# Parse with jq
medula agents list --format json | jq '.[] | select(.model=="claude-3-haiku")'

API Integration

The CLI leverages your existing Medula API:

  • POST /login - Authentication
  • GET /api/v1/tenants/{tenant_id}/agents - List agents
  • POST /api/v1/tenants/{tenant_id}/agents - Create agents
  • POST /api/v1/tenants/{tenant_id}/agents/{agent_id}/chat - Chat

Troubleshooting

Authentication Issues

# Clear stored credentials
medula auth logout
medula auth login

# Check current status
medula auth whoami

Connection Issues

# Verify endpoint
medula auth whoami

# Test with different endpoint
medula auth login --endpoint https://your-instance.com

Debug Mode

# Enable verbose output
export MEDULA_DEBUG=1
medula agents list

Development

Project Structure

cli/
├── medula_cli.py      # Main CLI application
├── requirements.txt   # Dependencies
├── setup.py          # Package setup
└── README.md         # This file

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Project details


Download files

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

Source Distribution

medula_cli-1.0.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

medula_cli-1.0.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file medula_cli-1.0.2.tar.gz.

File metadata

  • Download URL: medula_cli-1.0.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for medula_cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d3f0b8c2d7140c1d280a283388fb229eae33779c92a7d2c6b0ce7a23ff69a8ef
MD5 22fccc53773ec1640816a7d1856da28d
BLAKE2b-256 b15ed892e93ed2d238ed3f6c670778b398593bf886c2bbcd6e57134e3812933f

See more details on using hashes here.

File details

Details for the file medula_cli-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: medula_cli-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for medula_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 181fb140dad5ad9a779dbed0743bc7b5b4496eb98891ca14e78b91f7ba9b682b
MD5 1c19a6443ef3afad4c66a735749a99c8
BLAKE2b-256 212612a31d98ab519888c1784b1d84a99fd1f9b9f8ad497a61a88f3f967c63ef

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