Overview
Theprime env init command scaffolds a new environment module with a basic template, including starter code, metadata, and documentation.
Usage
Arguments
Environment ID (will be normalized to use underscores for the package name).Example:
my-env creates environments/my_env/Options
Path to environments directory where the new environment will be created.
Overwrite README.md if it already exists.
Create a multi-file package structure with
__init__.py instead of a single-file module.Initialize with the OpenEnv layout for tool-use environments. Creates
proj/ directory with OpenEnv project structure.Created Structure
Standard Environment
By default, creates a single-file module structure:Multi-File Environment
With--multi-file, creates a package structure:
OpenEnv Environment
With--openenv, creates an OpenEnv-based environment:
Examples
Create a Standard Environment
Create a Multi-File Environment
Create an OpenEnv Environment
Custom Path
~/my-envs/my_env/.
Template Contents
Environment Implementation
The generatedmy_env.py contains a starter template:
pyproject.toml
Defines the package metadata and dependencies:README.md
Provides a documentation template with sections for:- Overview
- Datasets
- Task description
- Quickstart examples
- Environment arguments
- Metrics
Next Steps
After creating an environment:- Edit the environment code in
my_env.py - Add dependencies to
pyproject.tomlif needed - Install the environment:
- Test with an evaluation:
OpenEnv Workflow
For OpenEnv environments, additional steps are required:- Implement the OpenEnv server in
proj/server/app.py - Build the Docker image:
- Install and test:
Naming Conventions
- Environment IDs can use hyphens (e.g.,
my-env) or underscores (e.g.,my_env) - Package names normalize to underscores (e.g.,
my_env) - Directory names match the package name (e.g.,
environments/my_env/) - Module names match the package name (e.g.,
my_env.py)
Troubleshooting
Directory Already Exists
If the environment directory already exists, the command will skip creating existing files:--rewrite-readme to force overwrite the README.