Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ See example scripts in `examples/` directory.
The OpenEnv CLI provides commands to manage environments:

- **`openenv init <env_name>`** - Initialize a new environment from template
- **`openenv import <source> --name <env_name> --output-dir <dir>`** - Wrap a supported third-party source environment, including ORS/OpenReward and Verifiers, as OpenEnv
- **`openenv push [--repo-id <repo>] [--private]`** - Deploy environment to Hugging Face Spaces

### Quick Start
Expand All @@ -281,12 +282,15 @@ The OpenEnv CLI provides commands to manage environments:
# Create a new environment
openenv init my_game_env

# Or import an ORS/OpenReward or Verifiers source environment
openenv import path/to/source --name my_game_env --output-dir .

# Deploy to Hugging Face (will prompt for login if needed)
cd my_game_env
openenv push
```

For detailed options: `openenv init --help` and `openenv push --help`.
For detailed options: `openenv init --help`, `openenv import --help`, and `openenv push --help`.

## Design Principles

Expand Down
7 changes: 7 additions & 0 deletions docs/source/getting_started/environment-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Already familiar with OpenEnv? Here's the 8-step process at a glance:
| Command | Description |
|---------|-------------|
| `openenv init NAME` | Scaffold new environment |
| `openenv import SOURCE --name NAME --output-dir DIR` | Wrap a supported third-party environment source tree |
| `openenv serve` | Start local dev server |
| `openenv build` | Build Docker image |
| `openenv validate --verbose` | Validate environment structure |
Expand Down Expand Up @@ -101,6 +102,12 @@ my_env/

Python classes are generated for the action, observation, environment, and client. For example, you will find `MyEnvironment`, `MyAction`, `MyObservation`, and `MyEnv` (client) in the `my_env` directory based on the name you provided. The environment uses the core `State` class from `openenv.core.env_server.types`.

If you already have an ORS/OpenReward or Prime Intellect Verifiers environment
source tree, use `openenv import SOURCE --name my_env --output-dir /Users/you/envs`
instead. The importer detects the source type from the code, vendors the source
under the generated package, and emits an OpenEnv wrapper with task/split and
MCP-style tool actions.

### 2. Define Models

Edit `models.py` to describe your action and observation using Pydantic:
Expand Down
12 changes: 12 additions & 0 deletions docs/source/guides/environment-anatomy.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ app = create_app(

This is what the environment's `server/app.py` entry point typically does — see `envs/echo_env/server/app.py` for a minimal real example.

## Optional Task APIs

Environments that expose reusable datasets can implement the optional task and
split `TaskProvider` protocol: `list_splits`, `list_tasks`, `num_tasks`,
`get_task`, and `get_task_range`. These are discovery methods, not part of the
core step/reset environment contract, and should be side-effect-free because
compatibility routes may call them on short-lived environment instances. OpenEnv
serves them through ORS-compatible endpoints such as `/list_environments`,
`/{env_name}/splits`, and `/{env_name}/task_range`. Existing environments that
do not implement these methods continue to work; task routes return `501` for
unsupported APIs.

## Rewards via the Rubric

Rewards are computed **inside the environment**, not by external code. The base `Environment` accepts an optional `rubric` on `__init__` — pass it to `super().__init__(rubric=...)`, call `self._reset_rubric()` from `reset`, and `self._apply_rubric(action, observation)` from `step` (or `_apply_rubric_async` from `step_async`). The [Rubrics tutorial](../tutorials/rubrics.md) covers the composable API end-to-end.
Expand Down
24 changes: 24 additions & 0 deletions docs/source/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ The `openenv` CLI provides a set of commands for building, validating, and pushi
:show-inheritance:
```

## `openenv import`

Import a supported third-party source environment into a generated OpenEnv
wrapper package. The command detects the source format from the directory
contents, so ORS/OpenReward and Prime Intellect Verifiers sources do not
require `--type` in the common case.

The generated wrapper vendors the source tree into the package. The importer
skips VCS/cache/build directories and common secret file patterns such as
`.env`, `secrets.yaml`, and private key files; review the generated `vendor/`
directory before publishing a wrapper.

```bash
openenv import path/to/source --name my_env --output-dir ./envs
openenv import path/to/source --name my_env --output-dir ./envs --env-class MyEnv
```

```{eval-rst}
.. automodule:: openenv.cli.commands.import_env
:members:
:undoc-members:
:show-inheritance:
```

## `openenv build`

```{eval-rst}
Expand Down
Loading