CLI - resource

resource


The resource group offers read-only inspection of lab resources, intended for AI agents (e.g. Claude Code). It is the resource counterpart of the db group: it loads resources by id, searches them, reads their RFields, and renders their views — never mutating anything. Errors print a concrete next action so an agent can self-correct, output is capped with --limit to protect the context window, and --format json is available for reliable parsing.


A typical flow for an agent that has no id yet: search to find a resource, then info for its metadata, fields to list its RFields, read to print one, and views / call-view to render its visualizations.



resource search


Searches resources with the advanced, operator-based search. Pass a JSON list of filter criteria to --filter, each of the form {"key": <field>, "operator": <OP>, "value": <val>}. This is the entry point when you have no id yet.


gws resource search [OPTIONS]


Common filter keys: name, id, data, created_at, created_by, origin, folder, is_archived. Special keys: resource_typing_name / resource_typing_names (matches the type AND its subtypes), generated_by_task, tags (value = [{"key":..,"value":..}]), column_tags (Table only).



# Find flagged resources whose name contains "robot"
gws resource search --filter '[{"key":"name","operator":"CONTAINS","value":"robot"}]'

# Widen to unflagged resources, sorted by name, as JSON
gws resource search \
  --filter '[{"key":"name","operator":"CONTAINS","value":"robot"},{"key":"include_not_flagged","value":true}]' \
  --sort '[{"key":"name","direction":"ASC"}]' \
  --format json

resource info


Shows a resource's metadata as JSON, without loading its content. Use this to confirm a resource exists and inspect its type, name, and other model fields once you have its id.


gws resource info  [OPTIONS]


gws resource info abc123

resource fields


Lists a resource's RFields — its declared, persisted fields. Loads the resource content and prints each RField's name, its RField type, and the resolved value type. Use the listed names with gws resource read.


gws resource fields  [OPTIONS]


gws resource fields abc123

resource read


Prints one or more RFields of a resource, loading its content. Pass one or more RField names (e.g. _data) — run gws resource fields <id> first to list the valid names. For DataFrame/Series RFields, the number of printed rows is capped by --limit.


gws resource read  ... [OPTIONS]


# Read the _data RField of a resource
gws resource read abc123 _data

# Read several RFields with no row cap
gws resource read abc123 _data _meta --limit 0

resource views


Lists the views available for a resource. Each entry shows the view method name (with a (default) marker on the default view), its human name, its view type, and its short description. Pass a listed method name to gws resource call-view.


gws resource views  [OPTIONS]


gws resource views abc123

resource call-view


Renders a resource's view as JSON. Pass the view method name (see gws resource views <id>) and, optionally, a JSON object of view config values via --config. The view config is not saved.


gws resource call-view   [OPTIONS]


# Render the default view of a resource
gws resource call-view abc123 view_as_table

# Render a view with config values
gws resource call-view abc123 view_as_table --config '{"from_row": 1, "number_of_rows_per_page": 50}'
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.