Skip to content

Conversation

@zkwentz
Copy link
Contributor

@zkwentz zkwentz commented Nov 4, 2025

tl;dr

venv ❯ openenv --help
                                                                                                                                     
 Usage: openenv [OPTIONS] COMMAND [ARGS]...                                                                                          
                                                                                                                                     
 OpenEnv - HTTP-based agentic environments CLI                                                                                       
                                                                                                                                     
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.                                                           │
│ --show-completion             Show completion for the current shell, to copy it or customize the installation.                    │
│ --help                        Show this message and exit.                                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ init   Initialize a new OpenEnv environment                                                                                       │
│ push   Push an OpenEnv environment to Hugging Face Spaces                                                                         │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Praxis

~/Development/OpenEnv openenv_cli
venv ❯ openenv init myenv
Creating OpenEnv environment 'myenv'...
✓ Created 13 files
Environment created successfully at: /Users/zwentz/Development/OpenEnv/myenv

Next steps:
  cd /Users/zwentz/Development/OpenEnv/myenv
  # Edit your environment implementation in server/myenv_environment.py
  # Edit your models in models.py
  # Build your docker environment: docker build -t myenv:latest -f server/Dockerfile .
  # Run your image: docker run myenv:latest

~/Development/OpenEnv openenv_cli*
venv ❯ cd myenv 

~/Development/OpenEnv/myenv openenv_cli*
venv ❯ openenv push
Validating OpenEnv environment in /Users/zwentz/Development/OpenEnv/myenv...
✓ Found OpenEnv environment: myenv
✓ Authenticated as: zkwentz
Preparing files for Hugging Face deployment...
✓ Updated Dockerfile: enabled web interface
Creating/verifying space: zkwentz/myenv
✓ Space zkwentz/myenv is ready
Uploading files to zkwentz/myenv...
✓ Upload completed successfully
Space URL: https://huggingface.co/spaces/zkwentz/myenv

✓ Deployment complete!
Visit your space at: https://huggingface.co/spaces/zkwentz/myenv

Test Plan

~/Development/OpenEnv openenv_cli
venv ❯ pytest --cov=openenv_cli --cov-report=term-missing tests/test_cli/
======================================================== test session starts ========================================================
platform darwin -- Python 3.13.7, pytest-8.4.2, pluggy-1.6.0
rootdir: /Users/zwentz/Development/OpenEnv
configfile: pyproject.toml
plugins: mock-3.15.1, anyio-4.11.0, cov-7.0.0
collected 43 items                                                                                                                  

tests/test_cli/test_init.py .................                                                                                 [ 39%]
tests/test_cli/test_main.py ...                                                                                               [ 46%]
tests/test_cli/test_push.py .......................                                                                           [100%]

========================================================== tests coverage ===========================================================
_________________________________________ coverage: platform darwin, python 3.13.7-final-0 __________________________________________

Name                                   Stmts   Miss  Cover   Missing
--------------------------------------------------------------------
src/openenv_cli/__init__.py                1      0   100%
src/openenv_cli/__main__.py               16      0   100%
src/openenv_cli/_cli_utils.py              2      0   100%
src/openenv_cli/commands/__init__.py       2      0   100%
src/openenv_cli/commands/init.py         143     29    80%   67, 206-207, 210-211, 214-215, 240-241, 264-274, 277, 280, 370-379
src/openenv_cli/commands/push.py         155      8    95%   89, 101, 106-107, 136, 174-175, 334
--------------------------------------------------------------------
TOTAL                                    319     37    88%
======================================================== 43 passed in 1.34s =========================================================

TODO

  • Add openenv convert to convert an existing environment to an OpenEnv valid environment to push
  • Update github workflows to push using openenv cli

… Face Spaces

- Introduced `openenv push` command to validate and upload OpenEnv environments.
- Updated `README.md` and template files to include deployment instructions.
- Enhanced `pyproject.toml` with new dependencies: `pyyaml` and `huggingface_hub`.
- Modified import statements to support the new command structure.
- Added tests for the `push` command to ensure functionality and validation.
…tion

- Introduced `_get_random_hf_space_config` function to generate random emoji and color values for Hugging Face Spaces.
- Updated `_create_template_replacements` to include placeholders for the new configuration values.
- Modified `README.md` template to use dynamic placeholders for emoji and color settings.
- Added coverage configuration to `pyproject.toml` to exclude specific files and lines from coverage reports.
- Introduced new tests in `test_init.py` to validate environment name requirements and handle file path collisions.
- Created `test_main.py` to ensure the main application handles exceptions and can be invoked as an entry point.
- Expanded `test_push.py` with additional tests for authentication handling, error scenarios, and validation of input formats.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 4, 2025
- Removed dependency on `HF_TOKEN` environment variable for Hugging Face authentication.
- Updated `_ensure_hf_authenticated` function to handle login without requiring a token.
- Modified README.md to reflect changes in authentication process.
- Adjusted tests to verify initialization of `HfApi` without token parameter.
- Added details about the OpenEnv CLI, including commands for initializing and deploying environments.
- Updated environment structure to include `openenv.yaml` for better organization.
- Provided quick start instructions for using the CLI to scaffold new environments and deploy to Hugging Face Spaces.
@jspisak jspisak added the enhancement New feature or request label Nov 4, 2025
Copy link
Collaborator

@burtenshaw burtenshaw left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Very nice.

@zkwentz zkwentz merged commit 904c5db into main Nov 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants