Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ferrocad_shell

The host bridge the shell calls. Not upstream API: it is how FerroCAD’s window (and tools/userdocs.py) drive the facade.

Generated page. tools/api_docs.py reads this surface from the module itself. Do not edit it by hand.

App-shell helpers used by the FerroCAD shell library.

Every entry point returns a JSON string.

Functions

FunctionSummary
add_namespace(name: str, value) -> NoneExpose value to the console under name.
axis_summary() -> strThe axis’s provider and stem size for the shell’s popover.
bootstrap(doc_name: str = 'Shell') -> strCreate (or recreate) the sample document and report host status.
close_document(name: str) -> strClose a document by name.
commands() -> strThe registered workbench commands, with resources and live state, as JSON.
dialog_accept(payload_json: str) -> strAccept an open dialog: {"token": ..., "values": {...}}.
dialog_cancel(token: str) -> strCancel an open dialog and drop its token.
evaluate(code: str) -> strEvaluate one console line, capturing stdout/stderr and any traceback.
gpu_adapter() -> strThe persisted viewport GPU adapter setting (auto by default).
grid_summary() -> strThe grid’s provider and spacing for the shell’s popover.
hello() -> strA first console line, proving the interpreter is live.
interaction(object_name: str, manipulator: str, action: str, element: str, values_json: str) -> strApply a manipulator commit through the module that supports it.
load_workbenches(dirs_json: str = '[]') -> strBest-effort workbench loading.
manipulator_specs(payload_json: str) -> strThe handles the mods declare for the shell’s current selection, as JSON.
model_tree() -> strDocuments and their objects, for the inspector pane.
open_document(path: str) -> strOpen a saved document and make it active (the --open path).
properties(object_name: str) -> strProperty rows for one object, for the property editor pane.
provider_features() -> strEvery registered provider feature, with its backends and active flag.
provider_skin(payload_json: str) -> strOne feature’s provider-supplied WGSL source, for the shell to build.
run_command(name: str) -> strInvoke a workbench command by id; returns {ok, status?, dialog?, token?}.
set_gpu_adapter(payload_json: str) -> strPersist the viewport’s GPU adapter choice from the Dev Tools panel.
set_property(object_name: str, prop: str, text: str) -> strSet one property from its editor string, in a named transaction.
set_provider(payload_json: str) -> strSwitch one feature’s active provider from the shell’s popover.
set_selection(pairs_json: str) -> strReplace FreeCADGui.Selection with the shell’s selection.
set_view_state(state_json: str) -> strMirror the shell’s presentation state to FerroCADGui.ViewState.
stage_meshes() -> strThe tessellated shapes the viewport draws, as JSON.