run.py for the complete application lifecycle — from local development to production deployment. run.py is a thin wrapper that invokes the centralized CLI from agenticai_core.cli.runner:
Available Commands
| Command | Purpose | Key Options | Example |
|---|---|---|---|
config | Select which .env config to use | -u <name> | python run.py config -u prod |
package | Package app for deployment | -o <name> | python run.py package -o my-app |
start | Start local development server | -H <host>, -P <port> | python run.py start -H 0.0.0.0 |
deploy | Deploy to AgenticAI Platform | -f <kar_file>, -e <env>, --package-only | python run.py deploy -f app.kar |
publish | Create app environment | -a <appId>, -n <name> | python run.py publish -a <id> -n dev |
status | Check environment status | -a <appId>, -n <name> | python run.py status -a <id> -n dev |
undeploy | Undeploy an app environment | -f <path> | python run.py undeploy -f bin/myapp/ |
test | Run end-to-end tests | — | python run.py test |
Command Details
Config Command
Select which environment configuration file to use as the default.| Option | Description |
|---|---|
-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.| Option | Description |
|---|---|
-o, --output | Name for the output package (creates bin/<project_name>/) |
bin/<project_name>/application.kar— Deployable ZIP archive (less than 1 MB target)bin/<project_name>/application.config.json— Application configuration
unzip -l bin/<project>/application.kar and ensure .venv isn’t included.
Start Command
Start the application server locally for development and testing.| Option | Default | Description |
|---|---|---|
-H, --host | localhost | Server host address |
-P, --port | 8080 | Server port |
-H and -P because lowercase -h conflicts with argparse’s built-in help flag.
Deploy Command
Deploy your application to the AgenticAI platform.| Option | Required | Description |
|---|---|---|
-f, --kar | Yes | Path to KAR archive file |
-e, --env | No | Path to .env file to override app variables |
--package-only | No | Re-deploys only the package; skips app import |
.env/default (set via config command):
KORE_HOST— Platform endpoint URLAPP_API_KEY— API authentication key
appId and streamId from deployment output for environment creation and testing.
Publish Command
Create an environment for your deployed application.| Option | Required | Description |
|---|---|---|
-a, --app | Yes | Application ID (from deploy output) |
-n, --name | Yes | Environment name (for example, development, staging, production) |
-d, --desc | No | Environment description |
-e, --env | No | Path to .env file to override app variables |
Status Command
Check the status of a deployed application environment.| Option | Required | Description |
|---|---|---|
-a, --app | Yes | Application ID |
-n, --name | Yes | Environment name |
Undeploy Command
Undeploy an application environment.| Option | Required | Description |
|---|---|---|
-f, --path | Yes | Path to the deployment directory (for example, bin/myapp/) |
Test Command
Run end-to-end tests on a deployed application. No options.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 (< 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