jackwener/OpenCLI · error · ArgumentError
Provide --radius (number or point label) or --point (point o
Error message
Provide --radius (number or point label) or --point (point on circle)
What it means
ArgumentError thrown by geogebra add-circle when neither --radius nor --point is provided; the command has no way to construct a Circle command without a size definition.
Source
Thrown at clis/geogebra/add-circle.js:39
func: async (page, kwargs) => {
const center = normalizeLabel(kwargs.center, 'center');
if (kwargs.point && kwargs.radius !== undefined) {
throw new ArgumentError('Use either --point or --radius, not both');
}
const pointOnCircle = kwargs.point ? normalizeLabel(kwargs.point, 'point') : '';
const radiusValue = kwargs.radius;
let cmd;
if (pointOnCircle) {
cmd = `Circle(${center},${pointOnCircle})`;
} else if (radiusValue !== undefined) {
const raw = String(radiusValue).trim();
const num = Number(raw);
cmd = Number.isFinite(num)
? `Circle(${center},${normalizeNumber(raw, 'radius', { positive: true })})`
: `Circle(${center},${normalizeLabel(raw, 'radius point')})`;
} else {
throw new ArgumentError('Provide --radius (number or point label) or --point (point on circle)');
}
await ensureApplet(page);
const result = requireGgbSuccess(await ggbEval(page, cmd), `Failed to create circle: ${cmd}`);
return [{ label: result.label, center, radius: pointOnCircle || radiusValue }];
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Add --radius <number or point label> (e.g. --radius 5 or --radius B)
- Or add --point <label of a point on the circle> (e.g. --point B)
Example fix
// before opencli geogebra add-circle --center A // after opencli geogebra add-circle --center A --radius 5
Defensive patterns
Strategy: validation
Validate before calling
if (args.radius === undefined && !args.point) {
throw new Error('add-circle requires --radius (number or point label) or --point');
} Prevention
- Always include a sizing flag with add-circle
- Check shell quoting so flags are not silently dropped
- Add a wrapper-level check before invoking the CLI
When it happens
Trigger: Running add-circle with only --center (or nothing sizing-related), reaching the else branch at clis/geogebra/add-circle.js:39.
Common situations: Forgetting the sizing flag; a wrapper script dropping empty/undefined arguments before invoking the CLI.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Use either --point or --radius, not both
- type must be one of: line, segment, ray
- command must contain at least one GeoGebra command
- type must be a GeoGebra object type like point, line, or cir
- <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/ffdd518ce1602685.
Report an issue: GitHub.