How samuraigpt/muapi-cli works
MuAPI CLI is an agent-friendly command-line client for MuAPI’s image, video, audio, and other model APIs. Users configure credentials, choose a curated command or invoke any endpoint with schema-driven inputs, then submit work, optionally wait for prediction results, and display or download outputs. The CLI also exposes tools through MCP and an optional LangChain integration for agent discovery, skills, and creative workflows. The graph combines sampled call paths with relationships explicit in the README and SOURCE INDEX; unsampled command internals are represented at their existing source paths.
Main entry points: main.py Command router · client.py HTTP and polling · run.py Generic model runner · image.py Image and video
Components 24
CLI entry and commands
- Command router
muapi/main.py - Image and video
muapi/commands/image.py - Audio generation
muapi/commands/audio.py - Media editing
muapi/commands/edit.py - Media enhancement
muapi/commands/enhance.py - Generic model runner
muapi/commands/run.py - Prediction status
muapi/commands/predict.py - File upload
muapi/commands/upload.py
Shared runtime
- HTTP and polling
muapi/client.py - Credential storage
muapi/config.py - Schema introspection
muapi/schema_introspect.py - Output and downloads
muapi/utils.py
Account and workflows
- Authentication
muapi/commands/auth.py - Account and keys
muapi/commands/account.py - API key management
muapi/commands/keys.py - Workflow commands
muapi/commands/workflow.py
MCP interface
- MCP tool server
muapi/commands/mcp_server.py
LangChain integration
- Agent tools
integrations/langchain/muapi_langchain/tools.py - Agent API wrapper
integrations/langchain/muapi_langchain/_client.py - Model and skill registry
integrations/langchain/muapi_langchain/_registry.py - Model loader
integrations/langchain/muapi_langchain/loader.py - Generation callbacks
integrations/langchain/muapi_langchain/callbacks.py
Other components
- CLI user
- MuAPI service
Connections 35
- CLI user → Command router: runs commands
README.md - Command router → Authentication: routes to
muapi/main.py - Command router → Account and keys: routes to
muapi/main.py - Command router → API key management: routes to
muapi/main.py - Command router → Image and video: routes to
muapi/main.py - Command router → Audio generation: routes to
muapi/main.py - Command router → Media editing: routes to
muapi/main.py - Command router → Media enhancement: routes to
muapi/main.py - Command router → Generic model runner: routes to
muapi/main.py - Command router → Prediction status: routes to
muapi/main.py - Command router → Workflow commands: routes to
muapi/main.py - Command router → MCP tool server: routes to
muapi/main.py - Authentication → Credential storage: saves credentials
muapi/commands/auth.py - Authentication → MuAPI service: authenticates
muapi/commands/auth.py - HTTP and polling → Credential storage: reads credentials
muapi/client.py - Image and video → HTTP and polling: submits generation
muapi/commands/image.py - Audio generation → HTTP and polling: submits generation
muapi/commands/audio.py - Media editing → HTTP and polling: submits edits
muapi/commands/edit.py - Media enhancement → HTTP and polling: submits enhancement
muapi/commands/enhance.py - Generic model runner → HTTP and polling: submits endpoint
muapi/commands/run.py - Generic model runner → Schema introspection: introspects schema
muapi/commands/run.py - Prediction status → HTTP and polling: checks predictions
muapi/commands/predict.py - File upload → HTTP and polling: uploads files
muapi/commands/upload.py - HTTP and polling → MuAPI service: sends requests
muapi/client.py - Image and video → Output and downloads: prints results
muapi/commands/image.py - Generic model runner → Output and downloads: prints results
muapi/commands/run.py - Workflow commands → MuAPI service: executes workflows
- MCP tool server → HTTP and polling: dispatches tools
muapi/commands/mcp_server.py - MCP tool server → MuAPI service: serves tool requests
muapi/commands/mcp_server.py - CLI user → Agent tools: uses agent tools
- Agent tools → Model and skill registry: discovers models
integrations/langchain/muapi_langchain/tools.py - Agent tools → Agent API wrapper: runs generation
integrations/langchain/muapi_langchain/tools.py - Agent API wrapper → HTTP and polling: calls CLI client
integrations/langchain/muapi_langchain/_client.py - Agent API wrapper → Model and skill registry: resolves endpoints
integrations/langchain/muapi_langchain/_client.py - Model loader → HTTP and polling: loads model data
integrations/langchain/muapi_langchain/loader.py