Skip to content
Merged
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
4 changes: 2 additions & 2 deletions docs/source/getting_started/environment-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Already familiar with OpenEnv? Here's the 8-step process at a glance:
| 2 | Edit `models.py` | Define Action & Observation dataclasses |
| 3 | Edit `server/my_environment.py` | Implement `reset()` and `step()` methods |
| 4 | Edit `client.py` | Implement `_step_payload()`, `_parse_result()`, `_parse_state()` |
| 5 | `openenv serve` | Start local dev server for testing |
| 5 | `uv run --project . server` | Start local dev server for testing |
| 6 | `openenv validate` | Validate environment structure |
| 7 | `openenv push` | Deploy to Hugging Face Hub |
| 8 | Share the URL! | Others use via `MyEnv.from_hub("you/my-env")` |
Expand All @@ -27,7 +27,7 @@ Already familiar with OpenEnv? Here's the 8-step process at a glance:
| Command | Description |
|---------|-------------|
| `openenv init NAME` | Scaffold new environment |
| `openenv serve` | Start local dev server |
| `uv run --project . server` | Start local dev server |
| `openenv build` | Build Docker image |
| `openenv validate --verbose` | Validate environment structure |
| `openenv push` | Deploy to Hugging Face Hub |
Expand Down
3 changes: 3 additions & 0 deletions docs/source/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The `openenv` CLI provides a set of commands for building, validating, and pushi

## `openenv serve`

Local serving is not implemented in the CLI yet. This command exits non-zero
and prints alternative ways to run an environment server.

[[autodoc]] openenv.cli.commands.serve.serve

## `openenv fork`
Expand Down
2 changes: 1 addition & 1 deletion src/openenv/cli/commands/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def serve(
console.print(" From an environment directory with pyproject.toml:")
console.print(f" [dim]$ uv run --project . server --port {port}[/dim]\n")

raise typer.Exit(0)
raise typer.Exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed correct. openenv serve now exits 1 while still printing the guidance — typer.Exit(1) propagates as SystemExit, so it bypasses the except Exception handler in __main__.main() (no Error: 1 re-wrap).

Optional: add a CliRunner test asserting result.exit_code == 1 (and that the guidance is printed) to lock in these exit semantics, since that's the whole point of this change.