run.py for the complete application lifecycle - from local development to production deployment.
Overview
The SDK CLI is a unified interface that handles:- Configuration: Select which environment config to use
- Local Development: Start and test applications locally
- Packaging: Create deployable KAR archives
- Deployment: Deploy to the AgenticAI platform
- Management: Create environments, check status, and test deployments
CLI Structure
What’s run.py?
run.py is a thin wrapper script that invokes the centralized CLI from agenticai_core.cli.runner. It provides a consistent interface across all workspace operations.
Command Format
Available Commands
Command Details
Config Command
Select which environment configuration file to use as the default.-u, --use- Config name to use (for example,dev,staging,prod)
.env/prod to .env/default, which is then loaded by subsequent commands.
Package Command
Package your application into a deployable KAR archive file.-o, --output- Name for the output package (createsbin/<project_name>/)
bin/<project_name>/application.kar- Deployable ZIP archive (less than 1 MB target)bin/<project_name>/application.config.json- Application configuration
Target package size is less than 1 MB. If larger, check contents with
unzip -l bin/<project>/application.kar and ensure .venv isn’t included.Start Command
Start the application server locally for development and testing.-H, --host- Server host address (default:localhost)-P, --port- Server port (default:8080)
The flags use uppercase
-H and -P because lowercase -h conflicts with argparse’s built-in help flag.Deploy Command
Deploy your application to the AgenticAI platform.-f, --kar- Path to KAR archive file
-e, --env- Path to .env file to override app variables--package-only- Re-deploys only the package; skips app import
.env/default (set via config command):
KORE_HOST- Platform endpoint URLAPP_API_KEY- API authentication key
Save the
appId and streamId from deployment output for environment creation and testing.Publish Command
Create an environment for your deployed application.-a, --app- Application ID (from deploy output)-n, --name- Environment name (for example,development,staging,production)
-d, --desc- Environment description-e, --env- Path to .env file to override app variables
Status Command
Check the status of a deployed application environment.-a, --app- Application ID-n, --name- Environment name
Undeploy Command
Undeploy an application environment.-f, --path- Path to the deployment directory (for example,bin/myapp/)
Test Command
Run end-to-end tests on a deployed application.Quick Reference
Complete reference for allrun.py commands:
Environment Configuration
Create.env/<env> files with required variables:
Application Lifecycle Workflow
Complete workflow from development to production:Best Practices
-
Development
- Test locally with
python run.py startbefore deploying - Use meaningful project names for packages
- Keep package size minimal (less than 1 MB)
- Always test with MCP client during development
- Test locally with
-
Deployment
- Use
.venvfor virtual environments (excluded from packages) - Test in staging/dev before production
- Save appId and streamId from deployment output immediately
- Use separate
.envfiles for different environments - Verify package contents with
unzip -lif size is large
- Use
-
Environment Management
- Create separate environments for dev/staging/prod
- Use descriptive environment names and descriptions
- Document appId and environment names in your project README
- Periodically check status with
statuscommand
-
Monitoring
- Enable distributed tracing in dev/staging environments
- Monitor logs and performance metrics
- Use status command to check environment health
- Test deployments end-to-end before going live
-
Configuration
- Keep sensitive keys in
.envfiles (never commit these!) - Use different API keys for different environments
- Document required environment variables
- Validate configuration before deployment
- Keep sensitive keys in