AgentCube CLI is a developer tool that streamlines the development, packaging, building, and deployment of AI agents to AgentCube. It provides a unified interface for managing the complete agent lifecycle from local development to cloud deployment.
- Python 3.10+
- Git
- Docker (optional, for container builds)
# Clone the repository
git clone https://github.com/volcano-sh/agentcube.git
cd agentcube/cmd/cli
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .-
Package an existing agent:
kubectl agentcube pack -f examples/hello-agent --agent-name "my-agent" -
Build the container image:
kubectl agentcube build -f examples/hello-agent
-
Publish to AgentCube:
kubectl agentcube publish \ -f examples/hello-agent \ --image-url "docker.io/username/my-agent" -
Invoke your agent:
kubectl agentcube invoke -f examples/hello-agent --payload '{"prompt": "Hello World!"}' -
Check status:
kubectl agentcube status -f examples/hello-agent
- Multi-language Support: Python, Java (with more languages planned)
- Flexible Build Modes: Local Docker builds and cloud builds
- Multi-Provider Deployment: Support for AgentCube CRDs and standard Kubernetes deployments
- AgentCube Integration: Seamless publishing and management
- Developer-friendly: Rich CLI experience with detailed feedback
- CI/CD Ready: Python SDK for programmatic access
- Extensible Architecture: Plugin system for custom providers
pip install agentcube-cligit clone https://github.com/volcano-sh/agentcube.git
cd agentcube/cmd/cli
pip install -e .AgentCube uses a agent_metadata.yaml file to configure your agent:
agent_name: my-agent
description: "A sample AI agent"
language: python
entrypoint: python main.py
port: 8080
build_mode: local
requirements_file: requirements.txtAgentCube CLI follows a modular four-layer architecture:
- CLI Layer: Typer-based command interface
- Runtime Layer: Business logic and Python SDK
- Operations Layer: Core domain logic
- Services Layer: External integrations
AgentCube supports two deployment providers:
Deploys agents using AgentCube's custom AgentRuntime CRDs, providing enhanced agent lifecycle management and integration with the AgentCube ecosystem.
kubectl agentcube publish -f examples/hello-agent --provider agentcubeDeploys agents as standard Kubernetes Deployments and Services, suitable for environments without AgentCube CRDs installed.
kubectl agentcube publish -f examples/hello-agent --provider k8s \
--node-port 30080 \
--replicas 3Package the agent application into a standardized workspace.
kubectl agentcube pack [OPTIONS]
Options:
-f, --workspace TEXT Path to the agent workspace directory [default: .]
--agent-name TEXT Override the agent name
--language TEXT Programming language (python, java)
--entrypoint TEXT Override the entrypoint command
--port INTEGER Port to expose in the Dockerfile
--build-mode TEXT Build strategy: local or cloud
--description TEXT Agent description
--output TEXT Output path for packaged workspace
--verbose Enable detailed loggingBuild the agent image based on the packaged workspace.
kubectl agentcube build [OPTIONS]
Options:
-f, --workspace TEXT Path to the agent workspace directory [default: .]
-p, --proxy TEXT Custom proxy URL for dependency resolution
--cloud-provider TEXT Cloud provider name (e.g., huawei)
--output TEXT Output path for build artifacts
--verbose Enable detailed loggingPublish the agent to AgentCube
kubectl agentcube publish [OPTIONS]
Options:
-f, --workspace TEXT Path to the agent workspace directory [default: .]
--version TEXT Semantic version string (e.g., v1.0.0)
--image-url TEXT Image repository URL (required in local build mode)
--image-username TEXT Username for image repository
--image-password TEXT Password for image repository
--description TEXT Agent description
--region TEXT Deployment region
--cloud-provider TEXT Cloud provider name (e.g., huawei)
--provider TEXT Target provider for deployment (agentcube, k8s). 'agentcube' deploys AgentRuntime CR, 'k8s' deploys standard K8s Deployment/Service. [default: agentcube]
--node-port INTEGER Specific NodePort to use (30000-32767) for K8s deployment
--replicas INTEGER Number of replicas for K8s deployment (default: 1)
--endpoint TEXT Custom API endpoint for AgentCube or Kubernetes cluster
--namespace TEXT Kubernetes namespace to use for deployment [default: default]
--verbose Enable detailed loggingInvoke a published agent via AgentCube or Kubernetes.
kubectl agentcube invoke [OPTIONS]
Options:
-f, --workspace TEXT Path to the agent workspace directory [default: .]
--payload TEXT JSON-formatted input passed to the agent [default: {}]
--header TEXT Custom HTTP headers (e.g., 'Authorization: Bearer token')
--provider TEXT Target provider for deployment (agentcube, k8s). 'agentcube' deploys AgentRuntime CR, 'k8s' deploys standard K8s Deployment/Service. [default: agentcube]
--verbose Enable detailed loggingCheck the status of a published agent.
kubectl agentcube status [OPTIONS]
Options:
-f, --workspace TEXT Path to the agent workspace directory [default: .]
--provider TEXT Target provider for deployment (agentcube, k8s). 'agentcube' deploys AgentRuntime CR, 'k8s' deploys standard K8s Deployment/Service. [default: agentcube]
--verbose Enable detailed loggingAn AgentCube workspace typically contains:
my-agent/
├── agent_metadata.yaml # Agent configuration (auto-generated)
├── Dockerfile # Container definition (auto-generated)
├── requirements.txt # Python dependencies
├── main.py # Agent entrypoint
└── src/ # Source code
agent_name: my-agent
description: "My AI agent"
language: python
entrypoint: python main.py
port: 8080
build_mode: local
requirements_file: requirements.txtFully supported with automatic dependency management and Dockerfile generation.
- Supported versions: Python 3.8+
- Package manager: pip
- Dependencies file: requirements.txt
- Example: examples/hello-agent
Supported with Maven-based builds and OpenJDK runtime.
- Supported versions: Java 17+
- Build tool: Maven
- Dependencies file: pom.xml
- Note: Java example coming soon
-
"Docker is not available"
- Install Docker and make sure it's running
- Use
--build-mode cloudfor cloud builds
-
"Metadata file not found"
- Run
kubectl agentcube packfirst to generate metadata - Ensure you're in the correct workspace directory
- Run
-
"Agent not published yet"
- Run
kubectl agentcube publishbefore trying to invoke - Check that the build completed successfully
- Run
-
"Provider not found"
- Ensure you're using a valid provider:
agentcubeork8s - Check that your Kubernetes cluster has the required CRDs (for agentcube provider)
- Ensure you're using a valid provider:
# General help
kubectl agentcube --help
# Command-specific help
kubectl agentcube pack --help
kubectl agentcube build --help
kubectl agentcube publish --help
kubectl agentcube invoke --help
kubectl agentcube status --helpThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.