jackwener/OpenCLI · error · ArgumentError

command must contain at least one GeoGebra command

Error message

command must contain at least one GeoGebra command

What it means

ArgumentError thrown by geogebra eval when the positional --command string contains no usable GeoGebra command after splitting on ';' and filtering empty segments. At least one non-empty command is required.

Source

Thrown at clis/geogebra/eval.js:22

cli({
  site: 'geogebra',
  name: 'eval',
  access: 'write',
  description: 'Execute one or more GeoGebra command strings (semicolon-separated)',
  domain: 'www.geogebra.org',
  strategy: Strategy.PUBLIC,
  browser: true,
  navigateBefore: false,
  example: 'opencli geogebra eval "A=(0,0);B=(4,0);c=Circle(A,B);d=Circle(B,A);C=Intersect(c,d,1);Polygon(A,B,C)"',
  args: [
    { name: 'command', positional: true, required: true, help: 'GeoGebra command string (use ; to chain multiple commands)' },
  ],
  columns: ['command', 'result'],
  func: async (page, kwargs) => {
    const commands = String(kwargs.command).split(';').map(s => s.trim()).filter(Boolean);
    if (commands.length === 0) {
      throw new ArgumentError('command must contain at least one GeoGebra command');
    }
    await ensureApplet(page);
    const results = [];
    for (const command of commands) {
      const result = requireGgbSuccess(await ggbEval(page, command), `Failed to execute GeoGebra command: ${command}`);
      results.push({
        command,
        result: `ok (${result.label || 'no label'})`,
      });
    }
    return results;
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Pass at least one GeoGebra command, e.g. "a=Circle((0,0),5)"
  2. Chain multiple commands with ';' between non-empty commands
  3. Fix script interpolation so the command variable is populated

Example fix

// before
opencli geogebra eval ";"
// after
opencli geogebra eval "a=Circle((0,0),5);b=Line((0,0),(1,1))"
Defensive patterns

Strategy: validation

Validate before calling

const raw = String(args.command ?? '').trim();
if (!raw || raw.split(';').every(s => !s.trim())) {
  throw new Error('eval requires at least one non-empty GeoGebra command');
}

Prevention

When it happens

Trigger: Passing an empty string, whitespace, or only semicolons (e.g. ';' or ' ; ; ') as the command at clis/geogebra/eval.js:22.

Common situations: Variable interpolation producing an empty command in scripts; accidental quoting that yields an empty shell argument; chaining syntax misunderstanding.

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/d1af1789b8a47a27. Report an issue: GitHub.