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.1.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.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: medula_cli-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 18458c231cfc2d3a94e1f99353d374d096b197b1f152efd84e721d27e3c5b243
MD5 49cf8b81b787d044f63b9446673c9488
BLAKE2b-256 5eeb22885fd08b83d304a5b2d1359964f82fb95aa47d18d4eebc4e048632f432

See more details on using hashes here.

File details

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

File metadata

  • Download URL: medula_cli-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a49ac05639374239e996794d5d06dbf9cf403f0e8ed2ff81e34ba17174f2adb0
MD5 3555bafedfcbfaa3ee9aed83d3520c51
BLAKE2b-256 7b4391a71877de7d69c4784f3b1105c702ce02a241b7a1483981b088f0871c9b

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