AEnvironment CLI User Guide#
This guide provides comprehensive documentation for all AEnvironment CLI commands and features, helping you efficiently manage AEnvironment projects and environments.
đ Command Overview#
Usage: aenv [OPTIONS] COMMAND [ARGS]...
Aenv CLI helps build your custom aenv
Options:
--debug
-v, --verbose Enable verbose output
--help Show this message and exit.
Commands:
build Build Docker images with real-time progress display.
config Manage CLI configuration.
get Get specified environment details
init Initialize aenv project using environmental scaffolding tools
list List all environments with pagination
push Push current aenv project to remote backend aenv hub
release Release current aenv project
test Test current aenv project by running local directly
version Display version number and corresponding build/commit information
Command Category |
Command |
Description |
|---|---|---|
Project Lifecycle |
|
Initialize new project |
|
Build container images |
|
|
Validate environment configuration |
|
|
Push environment to repository |
|
Environment Management |
|
List all environments |
|
Get environment details |
|
Configuration Management |
|
Manage CLI configuration |
System Information |
|
Display version information |
đ Quick Start#
Typical Workflow#
# 1. Create new project
aenv init my-search-env --template default
# 2. Validate configuration
aenv run --work-dir ./my-search-env
# 3. Build image
aenv build --work-dir ./my-search-env --image-tag v1.0.0
# 4. Push to repository
aenv push --work-dir ./my-search-env --version 1.0.0
# 5. Release environment
aenv release --work-dir ./my-search-env
đ ī¸ Project Lifecycle Commands#
aenv init - Initialize Project#
Create a new AEnvironment project with support for multiple templates.
Basic Usage#
Usage: aenv init [OPTIONS] NAME
Initialize aenv project using scaffolding tools
NAME: aenv name
Examples:
aenv init myproject --version 1.0.0
aenv init myproject --template default --work-dir ./myproject --force
Options:
-v, --version TEXT Specify aenv version number
-t, --template [default] Scaffolding template selection
-w, --work-dir TEXT Working directory for initialization
--force Force overwrite existing directory
--help Show this message and exit.
Available Templates#
Template Name |
Description |
Use Cases |
|---|---|---|
|
Basic template |
General environments |
Project Structure#
my-project/
âââ config.json # Environment configuration
âââ Dockerfile # Container definition
âââ requirements.txt # Python dependencies
âââ src/ # Source code
â âââ __init__.py
â âââ custom_env.py
âââ test/ # Test files
âââ README.md # Project documentation
config.json: Defines environment metadata including build configuration, test scripts, deployment resource requirements, and version information
Configuration Example
{
"name": "r2egym-couple-env",
"version": "1.0.0",
"tags": ["swe", "python", "linux"],
"status": "Ready",
"codeUrl": "oss://xxx",
"artifacts": [],
"buildConfig": {
"dockerfile": "./Dockerfile"
},
"testConfig": {
"script": "pytest xxx"
},
"deployConfig": {
"cpu": "1C",
"memory": "2G",
"os": "linux",
"imagePrefix": "reg.example.com/areal_agent/image",
"podTemplate": ""
}
}
Dockerfile
The final deliverable is primarily a container image, with the Dockerfile defining base configuration, dependency installation, and environment variable setup.
src
Environment business logic code is placed in the src directory. Use @register decorators to register code as corresponding tools, functions, and rewards.
aenv run - Validate Environment#
After code development, use the run command for local validation.
Run Basic Usage#
Usage Details
Usage: aenv run [OPTIONS]
Test current aenv project by running local directly
Examples:
aenv run --work-dir /tmp/aenv/search
Options:
--work-dir TEXT Specify aenv development root directory
--inspector-port INTEGER MCP Inspector port
--help Show this message and exit.
# Validate current directory
aenv run
# Specify working directory
aenv run --work-dir ./my-project
Output Example
âšī¸ đ Starting aenv project validation...
Working Directory: /AEnvironment/aenv/hello
Inspector Port: 6274
âšī¸ đ Validating working environment...
â
â
Working environment validation passed
âšī¸ đ§ Checking dependencies...
â
â
Dependency check passed
âšī¸ đĻ Installing MCP Inspector...
MCP Inspector Is Installed...!
â
â
MCP Inspector installation completed
âšī¸ đ Starting MCP server and Inspector...
Press Ctrl+C to stop services
2025-12-09 17:18:21,875 - mcp_manager - INFO - đ Starting MCP server and Inspector...
2025-12-09 17:18:21,875 - mcp_manager - INFO - Starting task: mcp_server - python -m aenv.
Validation Checks#
â Configuration file format validation
â Code correctness verification
â Dependency completeness check
â MCP service functionality verification
aenv build - Build Images#
Build Docker container images with real-time progress display.
Build Basic Usage#
Usage Details
Usage: aenv build [OPTIONS]
Build Docker images with real-time progress display.
This command builds Docker images from your project and provides real-time
progress updates with beautiful UI components.
Examples:
aenv build
aenv build --image-name myapp --image-tag v1.0
aenv build --work-dir ./myproject --registry myregistry.com
Options:
-w, --work-dir DIRECTORY Working directory for the build
-n, --image-name TEXT Name for the Docker image
-t, --image-tag TEXT Tags for the Docker image (can be used multiple
times)
-r, --registry TEXT Docker registry URL
-s, --namespace TEXT Namespace for the Docker image
--push / --no-push Push image to registry after build
-p, --platform TEXT Platform for the Docker image
--help Show this message and exit.
# Basic build
aenv build
# Specify working directory
aenv build --work-dir ./my-project
# Custom image name
aenv build --image-name my-custom-env
# Multiple tags
aenv build --image-tag v1.0.0 --image-tag latest
# Specify platform
aenv build --platform linux/amd64,linux/arm64
Advanced Options#
Option |
Short |
Description |
Example |
|---|---|---|---|
|
|
Working directory |
|
|
|
Image name |
|
|
|
Image tags |
|
|
|
Registry URL |
|
|
|
Namespace |
|
|
|
Target platform |
|
|
Push after build |
|
|
|
Disable cache |
|
Build Output Example#

aenv push - Push Environment#
Push the built environment to a remote repository.
Push Basic Usage#
# Push current environment
aenv push
# Specify version
aenv push --version 1.0.0
# Specify working directory
aenv push --work-dir ./my-project
# Push to specific registry
aenv push --registry registry.company.com
Push Options#
Option |
Description |
Example |
|---|---|---|
|
Specify version number |
|
|
Target registry |
|
|
Namespace |
|
|
Force overwrite |
|
đ Environment Management Commands#
aenv list - List Environments#
Display all available AEnvironment environments.
List Basic Usage#
# List all environments
aenv list
# Table format display
aenv list --format table
# JSON format output
aenv list --format json
# Pagination display
aenv list --limit 20 --offset 0
# Filter by name
aenv list --name search
# Filter by tags
aenv list --tags python,search
Output Format#
$ aenv list --format table
+---------------------------+------------+---------------+-------------------------------------+
| Name | Version | Description | Created At |
+===========================+============+===============+=====================================+
| swebench-env | 1.0.2 | | 2025-12-08T14:21:04.143332845+08:00 |
+---------------------------+------------+---------------+-------------------------------------+
| test-search-env | 1.0.0 | | 2025-11-27T11:41:42.212945201+08:00 |
+---------------------------+------------+---------------+-------------------------------------+
| mini-swe-agent-env | 1.1.1 | | 2025-11-24T23:21:35.882220449+08:00 |
+---------------------------+------------+---------------+-------------------------------------+
aenv get - Get Environment Details#
Retrieve detailed information about a specific environment.
Get Basic Usage#
# Get environment details
aenv get search-env
# Specify version
aenv get search-env --version 1.0.0
# JSON format output
aenv get search-env --format json
Get Output Example#
{
"id": "search-1.0.0",
"name": "search",
"description": "",
"version": "1.0.0",
"tags": [
"swe",
"python",
"linux"
],
"code_url": "~/.aenv/search-code.tar.gz",
"status": 6,
"artifacts": [
{
"id": "",
"type": "image",
"content": "docker.io/xxxx/image:search-1.0.0-v3"
}
],
"build_config": {
"dockerfile": "./Dockerfile"
},
"test_config": {
"script": "pytest xxx"
},
"deploy_config": {
"cpu": "1C",
"memory": "2G",
"os": "linux"
}
}
Note: Requires non-local mode to use.
âī¸ Configuration Management Commands#
aenv config - Configuration Management#
Manage CLI configuration and settings.
Subcommands#
config show - Display Configuration#
# Show all configurations
aenv config show
# JSON format
aenv config show --format json
config get - Get Configuration#
# Get specific value
aenv config get global_mode
config init - Initialize Configuration#
# Create default configuration
aenv config init
đ System Information Commands#
aenv version - Version Information#
Display CLI version and build information.
Version Basic Usage#
# Show version only
aenv version -s
# JSON format
aenv version --format json
Version Output Example#
$ aenv version
AEnv CLI Version: 0.1.0
Build Date: 2024-01-15
Git Commit: abc123def
Go Version: go1.21.0
Platform: linux/amd64
Python Version: 3.12.0
đ¯ Practical Usage Examples#
Scenario 1: Developing New Environment#
# 1. Create search tool environment
aenv init search-tool --template search
# 2. Modify configuration
cd search-tool
# Edit config.json and Dockerfile
# 3. Implement business logic
@register_tool
@register_function
@register_reward
Scenario 2: CI/CD Integration#
# Use in CI scripts
#!/bin/bash
set -e
# Validate environment
aenv run --work-dir ./project
# Build and push
aenv build --work-dir ./project \
--image-tag ${BUILD_NUMBER} \
--registry registry.company.com \
--push
# Publish
aenv push
đ Quick Reference#
Common Command Combinations#
# Complete workflow
aenv init â aenv run â aenv build â aenv push
# Environment management
aenv list â aenv get â aenv push
# Configuration management
aenv config path â aenv config set â aenv config show
Debug Commands#
# Verbose output
aenv --verbose <command>