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

Uploaded Python 3

File details

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

File metadata

  • Download URL: medula_cli-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c2e3b327e636046b01dd1d20bbd924e40d8d7b34b47d73140003a9d4e84741b6
MD5 9beaa05bda46d323665e33a93e356ca5
BLAKE2b-256 57de9c2691891ae0cd9862f9e93cf733cfeecbd07b8f8aa30de677d16e177b90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: medula_cli-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0e8573f13895e2dab0513bf18a6dce7fe2358e5e737d3e4ea1a0fff278e1d5
MD5 ee702d32e99a5dcc2e7bc61d07e30426
BLAKE2b-256 9dac61e98d86a1c35d2a79fba264fa2f0451786032da5a75c61ef5ae16397cc9

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