Skip to content

feat(wuji): unified wuji console entry for deploy toolchain - #238

Merged
KraHsu merged 1 commit into
mainfrom
dev/wuji-cli-entry
Jun 20, 2026
Merged

KraHsu merged 1 commit into
mainfrom
dev/wuji-cli-entry

Conversation

@KraHsu

@KraHsu KraHsu commented Jun 20, 2026

Copy link
Copy Markdown
Owner

What

The deploy toolchain was invoked via long module paths (python -m genelab_wuji.deploy.scripts.play_real …). Replace them with a single uv run wuji <command> console script.

command dispatches to purpose
wuji check / wuji home hand_utils read-only bridge test / 3s home ramp
wuji observer cube_world_observer Hikvision camera → ArUco cube pose → ZMQ
wuji viewer toreal_viewer real2sim Genesis mirror
wuji calib calib_check calibration viewer (hand + cube vs twin)
wuji play play_real deploy control loop + goal modes + success monitor
uv run wuji play --ckpt policy.onnx --real --goal-mode random
uv run wuji <command> --help        # per-command options

How

  • New genelab_wuji.cli dispatcher. Each verb lazily imports its target module, so wuji play doesn't pull in the Hikvision MVS SDK that wuji observer needs (the observer module raises at import time when the SDK is absent) and vice-versa.
  • [project.scripts] wuji = "genelab_wuji.cli:main" in examples/wuji/pyproject.toml.
  • Each script's main() now takes an argv list (was reading sys.argv directly) so the dispatcher can route args; check/home share hand_utils via a prepended verb. The old python -m … entry points still work.
  • README + script docstrings updated to uv run wuji ….

Testing

  • New tests/test_examples_wuji_cli.py: verb→module routing, shared check/home prefix, lazy import via stubbed import_module, help/usage/unknown exit codes.
  • 46 passed (CLI + all deploy tests); ruff check + format clean.
  • Smoke-verified end to end: uv run wuji play --ckpt policy_DRv3b.onnx --mock --no-zmq --no-viewer --steps 2 runs the closed loop (obs_dim=207, action_dim=20).

The .pixi/... paths in the reorient mjlab-bridge scripts (sim2sim_mjlab.py, play_mjlab.py) are intentionally unchanged — those run in the separate wuji-mjlab pixi environment, not GeneLab's uv env.

🤖 Generated with Claude Code

Replace the long `python -m genelab_wuji.deploy.scripts.<x>` invocations
with a single `uv run wuji <command>` console script:

  wuji check | home          -> hand_utils (read-only test / home ramp)
  wuji observer              -> cube_world_observer (Hikvision -> ZMQ)
  wuji viewer                -> toreal_viewer (real2sim mirror)
  wuji calib                 -> calib_check
  wuji play                  -> play_real (deploy control loop)

- new `genelab_wuji.cli` dispatcher; each verb LAZILY imports its target
  module so `wuji play` doesn't pull in the camera SDK that the observer
  needs (the observer module raises at import without the MVS SDK)
- `[project.scripts] wuji = genelab_wuji.cli:main` in the example pyproject
- each script's `main()` now takes an `argv` list (was reading sys.argv)
  so the dispatcher can route args; `python -m ...` still works
- README + script docstrings updated to `uv run wuji ...`
- tests for verb routing, the shared check/home prefix, lazy import, and
  help/unknown exit codes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@KraHsu
KraHsu merged commit fbf2d40 into main Jun 20, 2026
4 checks passed
@KraHsu
KraHsu deleted the dev/wuji-cli-entry branch June 20, 2026 04:15
KraHsu added a commit that referenced this pull request Jul 10, 2026
feat(wuji): unified `wuji` console entry for deploy toolchain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant