|
1 | 1 | --- |
2 | 2 | name: hyperview-cli |
3 | | -description: Use HyperView's control-plane CLI when operating a running HyperView session or setting up a workspace for it. Trigger on tasks involving workspaces, one dataset per workspace, embeddings, layouts, custom providers, runtime jobs, UI layout switching, native module panels, or backend-plus-frontend plugins/extensions from local files. |
| 3 | +description: Use HyperView's control-plane CLI for hyperview serve, dataset create, workspace create, embeddings compute, layouts compute, runtime jobs, ui layout set, ui selection set, ui panel add, extension add, tools run, native module panels, backend tools, and local HyperView plugin workflows. |
| 4 | +license: MIT |
| 5 | +compatibility: Requires Python 3.10+ and the hyperview CLI (`uv tool install hyperview`). Runtime-control commands require a running HyperView server. |
| 6 | +metadata: |
| 7 | + homepage: https://github.com/Hyper3Labs/HyperView |
4 | 8 | --- |
5 | 9 |
|
6 | 10 | # HyperView CLI |
7 | 11 |
|
8 | 12 | Use the `hyperview` CLI as the primary agent interface to HyperView. |
9 | 13 |
|
| 14 | +## Install the Skill |
| 15 | + |
| 16 | +For users who installed HyperView from a package, install or refresh this agent skill with: |
| 17 | + |
| 18 | +```bash |
| 19 | +uv tool install --upgrade hyperview && hyperview skill install |
| 20 | +``` |
| 21 | + |
| 22 | +Re-running `hyperview skill install` replaces old HyperView skill copies. By default this installs into detected agent locations plus the universal `~/.agents/skills/` fallback. Limit targets with repeated `--agent` flags such as `--agent claude-code`, `--agent github-copilot`, `--agent cursor`, or `--agent universal`; use `--all-known` when you explicitly want every known agent profile. Use `--scope project` to write project-local skills such as `.claude/skills/`, `.github/skills/`, `.cursor/skills/`, or `.agents/skills/` depending on the selected agent. |
| 23 | + |
10 | 24 | ## When to use it |
11 | 25 |
|
12 | 26 | - Create or inspect a persisted dataset. |
@@ -35,134 +49,40 @@ Use the `hyperview` CLI as the primary agent interface to HyperView. |
35 | 49 | - Datasets are created separately from workspaces. |
36 | 50 | - The workspace owns the dataset selection. |
37 | 51 | - `ui layout set` changes the active layout and the frontend opens the matching built-in scatter panel. |
38 | | -- Runtime-added panels are native module panels loaded into the host React tree. |
| 52 | +- Runtime-added panels can be typed scatter instances bound to explicit layout keys, or native module panels loaded into the host React tree. |
39 | 53 | - Runtime-added panels use the stable `HyperViewPanelSDK` surface on `window`. |
40 | 54 | - Plugins are repo-local extension folders with `extension.toml`, optional Python tools, and optional native panel modules. |
41 | 55 | - Plugin panels call backend tools through `HyperViewPanelSDK.hooks.useTool()` or `hyperview tools run`. |
42 | 56 | - In practice, create datasets and workspaces before starting the runtime for that workspace. The current runtime loads workspace registry state on startup. |
43 | 57 |
|
| 58 | +Read [references/commands.md](references/commands.md) for command recipes covering datasets, workspaces, providers, embeddings, layouts, runtime UI state, selections, and jobs. |
44 | 59 | Read [references/native-panels.md](references/native-panels.md) when the task involves authoring or registering a custom panel. |
45 | 60 | Read [references/plugins.md](references/plugins.md) when the task involves backend-plus-frontend plugins/extensions. |
46 | 61 |
|
47 | | -## Commands |
48 | | - |
49 | | -Create a persisted dataset from Hugging Face: |
50 | | - |
51 | | -```bash |
52 | | -hyperview dataset create cifar10_demo \ |
53 | | - --hf-dataset uoft-cs/cifar10 \ |
54 | | - --split train \ |
55 | | - --image-key img \ |
56 | | - --label-key label |
57 | | -``` |
58 | | - |
59 | | -Create a persisted dataset from a local image directory: |
60 | | - |
61 | | -```bash |
62 | | -hyperview dataset create local_assets_demo \ |
63 | | - --images-dir assets |
64 | | -``` |
65 | | - |
66 | | -Create a workspace with its dataset in one step: |
67 | | - |
68 | | -```bash |
69 | | -hyperview workspace create research \ |
70 | | - --dataset cifar10_demo \ |
71 | | - --activate |
72 | | -``` |
73 | | - |
74 | | -Change the dataset attached to a workspace: |
75 | | - |
76 | | -```bash |
77 | | -hyperview workspace set-dataset research imagenette_clip_20260411 |
78 | | -``` |
79 | | - |
80 | | -Start the runtime: |
81 | | - |
82 | | -```bash |
83 | | -hyperview serve --workspace research --dataset cifar10_demo --no-browser |
84 | | -``` |
85 | | - |
86 | | -Register a custom provider: |
87 | | - |
88 | | -```bash |
89 | | -hyperview provider register my-provider \ |
90 | | - --import-path my_pkg.provider:MyProvider |
91 | | -``` |
92 | | - |
93 | | -Compute checkpoint-backed embeddings and a layout: |
94 | | - |
95 | | -```bash |
96 | | -hyperview embeddings compute \ |
97 | | - --workspace research \ |
98 | | - --dataset cifar10_demo \ |
99 | | - --provider my-provider \ |
100 | | - --model-id experiment-a \ |
101 | | - --checkpoint /path/to/checkpoint.json \ |
102 | | - --layout euclidean:2d |
103 | | -``` |
104 | | - |
105 | | -Add a new layout to an existing embedding space: |
106 | | - |
107 | | -```bash |
108 | | -hyperview layouts compute \ |
109 | | - --workspace research \ |
110 | | - --dataset cifar10_demo \ |
111 | | - --space-key <space-key> \ |
112 | | - --layout euclidean:3d |
113 | | -``` |
114 | | - |
115 | | -Switch the live UI to a layout and selection: |
116 | | - |
117 | | -```bash |
118 | | -hyperview ui layout set --workspace research --layout-key <layout-key> |
119 | | -hyperview ui selection set --workspace research --ids sample-1,sample-8 |
120 | | -``` |
121 | | - |
122 | | -When the chosen layout is Euclidean 3D, HyperView opens or focuses the Euclidean 3D scatter panel. |
123 | | - |
124 | | -Add a native panel from a local JavaScript module file: |
125 | | - |
126 | | -```bash |
127 | | -hyperview ui panel add \ |
128 | | - --workspace research \ |
129 | | - --panel-id label-histogram \ |
130 | | - --title "Label Histogram" \ |
131 | | - --position right \ |
132 | | - --module-file agent-context/panels/label-histogram/index.js |
133 | | -``` |
134 | | - |
135 | | -Install a backend-plus-frontend plugin from a local extension folder: |
136 | | - |
137 | | -```bash |
138 | | -hyperview extension add agent-context/extensions/selection-profile \ |
139 | | - --workspace research \ |
140 | | - --json |
141 | | -``` |
142 | | - |
143 | | -Inspect and run installed plugin tools: |
144 | | - |
145 | | -```bash |
146 | | -hyperview extension list --json |
147 | | -hyperview tools list --json |
148 | | -hyperview tools run selection_profile.summarize \ |
149 | | - --workspace research \ |
150 | | - --param 'sample_ids=["sample-1","sample-8"]' \ |
151 | | - --json |
152 | | -``` |
153 | | - |
154 | 62 | ## Agent guidance |
155 | 63 |
|
156 | 64 | - Prefer CLI commands over direct file edits when the goal is to operate a running HyperView session. |
157 | 65 | - Treat dataset creation and workspace binding as separate steps when needed: `dataset create ...` creates persisted data, `workspace create --dataset ...` or `workspace set-dataset ...` binds it to a workspace. |
158 | 66 | - Prefer `workspace create --dataset ...` over separate create and dataset-attach calls when setting up a new workspace. |
159 | | -- For custom panels, have the agent write panel modules outside the app source tree, for example under `agent-context/`, and then add them through `hyperview ui panel add --module-file ...`. |
160 | | -- For plugins, prefer `agent-context/extensions/<plugin-name>/` for explicit local installs or `.hyperview/extensions/<plugin-name>/` when you want `hyperview serve` auto-discovery. |
| 67 | +- For custom module panels, have the agent write panel modules outside the app source tree, for example under `agent-context/`, and then add them through `hyperview ui panel add --module-file ...`. |
| 68 | +- For side-by-side embedding comparisons, add typed scatter panels through `hyperview ui panel add --kind scatter --layout-key ... --reference-panel-id ... --direction right`. |
| 69 | +- For plugins, prefer `.hyperview/extensions/<plugin-name>/` in the project root. `hyperview serve` auto-discovers those folders and attaches them to the launched workspace, so they can live in version control with the dataset/project code. |
161 | 70 | - Tools can write files under `ctx.extension_storage` and return `ctx.url_for(path)` for panel-renderable artifact URLs. |
162 | 71 | - Keep plugins self-contained: `extension.toml`, `tools.py`, `panel.js` or `panel.jsx`, and any local assets in the same folder. |
163 | 72 | - Prefer `--json` output when chaining commands or inspecting results programmatically. |
164 | 73 | - Wait for embedding/layout jobs to finish before issuing layout-switch commands that depend on their results. |
165 | 74 | - Use `hyperview jobs list` or `hyperview jobs inspect <job-id>` if a compute command is long-running or you started it with `--no-wait`. |
166 | 75 | - For provider args, use repeated `--provider-arg key=value` flags. |
167 | 76 | - Treat the workspace as the durable unit. Changing datasets means setting a new workspace dataset, not switching among many datasets inside one workspace. |
168 | | -- Prefer native module panels over raw HTML. The panel system no longer relies on iframes. |
| 77 | +- Prefer native module panels over raw HTML. The panel system no longer relies on iframes. |
| 78 | +- The first `uv run hyperview ...` invocation in a session can take 30+ seconds (torch/datasets imports). Allow generous timeouts and avoid sending SIGINT. |
| 79 | + |
| 80 | +## Inspecting runtime state |
| 81 | + |
| 82 | +The runtime exposes JSON discovery endpoints alongside the CLI. Use them to obtain layout keys, sample IDs, and registered tools/panels for follow-up commands: |
| 83 | + |
| 84 | +- `GET /api/runtime?workspace_id=<ws>` — full snapshot. Read `workspace.ui.active_layout_key`, `workspace.ui.selected_ids`, `workspace.ui.custom_panels[*].data.module_src`, and registered `extensions`/`tools`. |
| 85 | +- `GET /api/embeddings?workspace_id=<ws>` — the active or default layout, including `layout_key`, `geometry`, and sample `ids`. Use the returned `layout_key` for `hyperview ui layout set --layout-key ...` and pick from `ids` for `hyperview ui selection set --ids ...`. |
| 86 | +- `GET /api/tools` — registered tool URIs (also returned by `hyperview tools list --json`). |
| 87 | + |
| 88 | +Layout keys encode geometry and dimension as a substring (e.g. `..._euclidean_umap__2d_...`, `..._hyperbolic_umap__3d_...`). Match on those substrings when filtering by geometry/dimension. |
0 commit comments