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

  1. Add --radius <number or point label> (e.g. --radius 5 or --radius B)
  2. 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

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


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/ffdd518ce1602685. Report an issue: GitHub.