jackwener/OpenCLI · warning · ArgumentError
type must be a GeoGebra object type like point, line, or cir
Error message
type must be a GeoGebra object type like point, line, or circle
What it means
An ArgumentError raised by `geogebra list --type <t>` when the type filter contains characters outside [a-z-]. The filter is meant to be a lowercase GeoGebra object type keyword (point, line, circle, segment, conic, etc.); anything else — mixed case, digits, spaces, underscores — is rejected before reaching the applet.
Source
Thrown at clis/geogebra/list.js:23
cli({
site: 'geogebra',
name: 'list',
access: 'read',
description: 'List all geometric objects on the GeoGebra canvas',
domain: 'www.geogebra.org',
strategy: Strategy.PUBLIC,
browser: true,
navigateBefore: false,
args: [
{ name: 'type', required: false, help: 'Filter by object type (e.g. "point", "line", "circle")' },
],
columns: ['name', 'type', 'value', 'visible'],
func: async (page, kwargs) => {
const filterType = kwargs.type == null || kwargs.type === ''
? ''
: String(kwargs.type).trim().toLowerCase();
if (filterType && !/^[a-z-]+$/.test(filterType)) {
throw new ArgumentError('type must be a GeoGebra object type like point, line, or circle');
}
await ensureApplet(page);
const objects = await ggbListObjects(page, filterType);
if (!Array.isArray(objects) || objects.length === 0) {
throw new EmptyResultError(
'geogebra list',
'No objects found on the canvas. Fresh runs start a blank session; use one "eval" call, or inspect an already-bound tab through the browser workspace commands.',
);
}
return objects;
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Use a lowercase type keyword: point, line, circle, segment, conic, polygon, etc.
- Lowercase and strip spaces from the value before passing it
- If you meant a specific object, use `geogebra info --name <label>` instead of list --type
- Omit --type entirely to list all objects and filter client-side
Example fix
// before opencli geogebra list --type "Point" // after opencli geogebra list --type "point"
Defensive patterns
Strategy: validation
Validate before calling
const type = String(process.argv.type ?? '').trim().toLowerCase();
if (type && !/^[a-z-]+$/.test(type)) {
throw new Error(`--type must be a lowercase GeoGebra type like point, line, circle; got "${type}"`);
} Type guard
const isValidTypeFilter = (t) => t == null || t === '' || /^[a-z-]+$/.test(String(t).trim().toLowerCase());
Try / catch
try {
await run('geogebra', 'list', '--type', type);
} catch (err) {
if (/type must be a GeoGebra object type/.test(err.message)) {
return run('geogebra', 'list'); // list all, filter client-side
}
throw err;
} Prevention
- Lowercase type filters before passing them
- Never pass object labels to --type; use info --name for labels
- When unsure, omit --type and filter the output yourself
When it happens
Trigger: `geogebra list --type 'Point'` (uppercase), `--type 'line segment'` (space), `--type 'poly1'` (digits — that's a label, not a type).
Common situations: Users passing an object label instead of a type; capitalizing the type name; trying to filter by name with the --type flag.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Use either --point or --radius, not both
- Provide --radius (number or point label) or --point (point o
- type must be one of: line, segment, ray
- command must contain at least one GeoGebra command
- <train-no> "${trainNo}" does not look like a 12306 internal
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/51b18e3a3c337998.
Report an issue: GitHub.