h hopperCode

Agent tools

The tools hoppercode registers with Pi. The agent chooses which to call based on your request.

hoppercode surfaces two tool families. rh_* operates on the Rhino document; gh_* operates on the Grasshopper canvas. Bundled Pi skills and prompts live under mds/ (e.g. gh-modeling-expert, rhino-document, gh-cookbook).

Rhino document

ToolRole
rh_run_scriptRun Rhino commands, Python, or C# on the active document.
rh_query_objectsList objects (short IDs for GH params).

Grasshopper canvas — edit

ToolRole
gh_edit_componentsAdd, move, delete components.
gh_edit_paramParameter values and expressions.
gh_edit_wireConnect / disconnect wires.
gh_edit_groupGroups.
gh_edit_scriptScript component source.
gh_create_widget / gh_mutate_widgetSliders, panels, toggles, etc.
gh_param_rhinoReference or internalize Rhino geometry on params.

Grasshopper canvas — query

ToolRole
gh_get_canvasCanvas layout and component snapshot.
gh_list_componentsSearch the component library by keyword.
gh_get_canvas_errorsRuntime errors on the canvas.

Interaction & capture

ToolRole
rh_capture_viewCapture a Rhino viewport screenshot as PNG for visual QA. Permission-gated; only active after you allow viewport screenshots for the session, and only on models that accept image input.
rh_view_controlDrive the viewport: switch active / standard / named / CPlane views, set the camera (location, target, lens length, projection), zoom (extents / selected / bounding box), and save named views.
ask_userAsk a free-text clarifying question and wait for an answer when requirements are ambiguous.
pick_optionPresent 2–6 options to pick from (an "Other" choice is appended automatically).