rlinf-cli 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rlinf_cli/__init__.py
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Copyright 2026 The RLinf Authors.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Zero-dependency global launcher for the ``rlinf`` CLI.
|
|
16
|
+
|
|
17
|
+
Locates the active RLinf repository checkout and delegates to its
|
|
18
|
+
``rlinf.cli.main`` module so globally installed ``rlinf`` (via
|
|
19
|
+
``uv tool install ./cli`` or ``uvx --from ./cli rlinf ...``) always stays in
|
|
20
|
+
sync with the current checkout and works before ``.venv`` exists.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
import importlib.metadata
|
|
26
|
+
import os
|
|
27
|
+
import sys
|
|
28
|
+
from pathlib import Path
|
|
29
|
+
from typing import Sequence
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _get_version() -> str:
|
|
33
|
+
try:
|
|
34
|
+
return importlib.metadata.version("rlinf-cli")
|
|
35
|
+
except importlib.metadata.PackageNotFoundError:
|
|
36
|
+
return "0.4.0"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _is_rlinf_checkout(path: Path) -> bool:
|
|
40
|
+
return (path / "rlinf" / "cli" / "main.py").is_file() and (
|
|
41
|
+
path / "requirements" / "install.sh"
|
|
42
|
+
).is_file()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def find_checkout_root(start: Path | None = None) -> Path:
|
|
46
|
+
"""Locate an RLinf checkout from env vars or by walking up from ``start``."""
|
|
47
|
+
candidates: list[Path] = []
|
|
48
|
+
if start is not None:
|
|
49
|
+
candidates.append(start.resolve())
|
|
50
|
+
for env_key in ("RLINF_REPO_PATH", "REPO_PATH"):
|
|
51
|
+
env_val = os.environ.get(env_key)
|
|
52
|
+
if env_val:
|
|
53
|
+
candidates.append(Path(env_val).expanduser().resolve())
|
|
54
|
+
cwd = Path.cwd().resolve()
|
|
55
|
+
candidates.extend([cwd, *cwd.parents])
|
|
56
|
+
|
|
57
|
+
seen: set[Path] = set()
|
|
58
|
+
for candidate in candidates:
|
|
59
|
+
if candidate in seen:
|
|
60
|
+
continue
|
|
61
|
+
seen.add(candidate)
|
|
62
|
+
if _is_rlinf_checkout(candidate):
|
|
63
|
+
return candidate
|
|
64
|
+
|
|
65
|
+
raise FileNotFoundError(
|
|
66
|
+
f"Could not locate an RLinf repository checkout from '{cwd}'. "
|
|
67
|
+
"Run inside an RLinf checkout ('git clone https://github.com/RLinf/RLinf.git && cd RLinf') "
|
|
68
|
+
"or set RLINF_REPO_PATH / REPO_PATH."
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
73
|
+
"""Delegate ``rlinf`` CLI invocations to the current RLinf checkout."""
|
|
74
|
+
raw_args = list(sys.argv[1:] if argv is None else argv)
|
|
75
|
+
if raw_args in (["-V"], ["--version"]):
|
|
76
|
+
sys.stdout.write(f"rlinf {_get_version()}\n")
|
|
77
|
+
sys.stdout.flush()
|
|
78
|
+
return 0
|
|
79
|
+
|
|
80
|
+
try:
|
|
81
|
+
repo_root = find_checkout_root()
|
|
82
|
+
except FileNotFoundError as exc:
|
|
83
|
+
sys.stderr.write(f"error: {exc}\n")
|
|
84
|
+
sys.stderr.flush()
|
|
85
|
+
return 2
|
|
86
|
+
|
|
87
|
+
root_str = str(repo_root)
|
|
88
|
+
if root_str not in sys.path:
|
|
89
|
+
sys.path.insert(0, root_str)
|
|
90
|
+
|
|
91
|
+
from rlinf.cli.main import main as checkout_main
|
|
92
|
+
|
|
93
|
+
return checkout_main(raw_args, repo_root=repo_root)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == "__main__":
|
|
97
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rlinf-cli
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Lightweight zero-dependency CLI launcher for RLinf
|
|
5
|
+
Author: RLinf Contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/RLinf/RLinf
|
|
8
|
+
Project-URL: Repository, https://github.com/RLinf/RLinf
|
|
9
|
+
Project-URL: Documentation, https://rlinf.readthedocs.io/
|
|
10
|
+
Project-URL: Bug Report, https://github.com/RLinf/RLinf/issues
|
|
11
|
+
Keywords: reinforcement-learning,embodied-ai,robotics,cli,rlinf
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# rlinf-cli
|
|
23
|
+
|
|
24
|
+
Lightweight, zero-dependency CLI launcher for [RLinf](https://github.com/RLinf/RLinf) — a distributed reinforcement learning infrastructure for embodied and agentic AI.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Recommended: install globally as a standalone tool
|
|
30
|
+
uv tool install rlinf-cli
|
|
31
|
+
|
|
32
|
+
# Or with pip / pipx
|
|
33
|
+
pip install rlinf-cli
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or run one-off without installing:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uvx --from rlinf-cli rlinf install embodied --model openvla --env maniskill_libero
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
Inside an [RLinf](https://github.com/RLinf/RLinf) checkout (or with `RLINF_REPO_PATH` / `REPO_PATH` set):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# 1. Inspect supported targets, models, environments, engines, and platforms
|
|
48
|
+
rlinf install --list
|
|
49
|
+
|
|
50
|
+
# 2. Install an environment (backed by requirements/install.sh)
|
|
51
|
+
rlinf install embodied --model openvla --env maniskill_libero
|
|
52
|
+
|
|
53
|
+
# 3. Verify Python, accelerators, rendering libraries, Ray, and Hugging Face
|
|
54
|
+
rlinf doctor
|
|
55
|
+
|
|
56
|
+
# 4. Discover, inspect, validate, and launch recipes
|
|
57
|
+
rlinf list
|
|
58
|
+
rlinf show maniskill_ppo_mlp
|
|
59
|
+
rlinf train maniskill_ppo_mlp --check
|
|
60
|
+
rlinf train maniskill_ppo_mlp
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`rlinf-cli` delegates directly to the active checkout's `rlinf/cli/` and automatically resolves `--venv`, `$VIRTUAL_ENV`, or the repository's `.venv`, so it stays in sync across branches and works before any virtual environment exists.
|
|
64
|
+
|
|
65
|
+
## Links
|
|
66
|
+
|
|
67
|
+
- Repository: https://github.com/RLinf/RLinf
|
|
68
|
+
- Documentation: https://rlinf.readthedocs.io/
|
|
69
|
+
- Issues: https://github.com/RLinf/RLinf/issues
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
rlinf_cli/__init__.py,sha256=yQOTB_xlUGW-zn4iocV-bOEdBb_hHAOMXyF_FSHiae0,3141
|
|
2
|
+
rlinf_cli-0.4.0.dist-info/METADATA,sha256=XPL2rjn_DWEVIkUShCLGHRL3OKfQaFy6ZogAx81XchE,2352
|
|
3
|
+
rlinf_cli-0.4.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
4
|
+
rlinf_cli-0.4.0.dist-info/entry_points.txt,sha256=CwTDy9h91zWrDgXn15BeZ8htevKr48FzXIrlO19MSS0,41
|
|
5
|
+
rlinf_cli-0.4.0.dist-info/top_level.txt,sha256=ECkjlhnqkG47fUIys7b3BZZSz1aK7ZBjukCllUcNXAA,10
|
|
6
|
+
rlinf_cli-0.4.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rlinf_cli
|