{"record":{"id":"d1af1789b8a47a27","repo":"jackwener/OpenCLI","slug":"command-must-contain-at-least-one-geogebra-command","errorCode":null,"errorMessage":"command must contain at least one GeoGebra command","messagePattern":"command must contain at least one GeoGebra command","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/geogebra/eval.js","lineNumber":22,"sourceCode":"\ncli({\n  site: 'geogebra',\n  name: 'eval',\n  access: 'write',\n  description: 'Execute one or more GeoGebra command strings (semicolon-separated)',\n  domain: 'www.geogebra.org',\n  strategy: Strategy.PUBLIC,\n  browser: true,\n  navigateBefore: false,\n  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)\"',\n  args: [\n    { name: 'command', positional: true, required: true, help: 'GeoGebra command string (use ; to chain multiple commands)' },\n  ],\n  columns: ['command', 'result'],\n  func: async (page, kwargs) => {\n    const commands = String(kwargs.command).split(';').map(s => s.trim()).filter(Boolean);\n    if (commands.length === 0) {\n      throw new ArgumentError('command must contain at least one GeoGebra command');\n    }\n    await ensureApplet(page);\n    const results = [];\n    for (const command of commands) {\n      const result = requireGgbSuccess(await ggbEval(page, command), `Failed to execute GeoGebra command: ${command}`);\n      results.push({\n        command,\n        result: `ok (${result.label || 'no label'})`,\n      });\n    }\n    return results;\n  },\n});\n","sourceCodeStart":4,"sourceCodeEnd":36,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/geogebra/eval.js#L4-L36","documentation":"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.","triggerScenarios":"Passing an empty string, whitespace, or only semicolons (e.g. ';' or ' ; ; ') as the command at clis/geogebra/eval.js:22.","commonSituations":"Variable interpolation producing an empty command in scripts; accidental quoting that yields an empty shell argument; chaining syntax misunderstanding.","solutions":["Pass at least one GeoGebra command, e.g. \"a=Circle((0,0),5)\"","Chain multiple commands with ';' between non-empty commands","Fix script interpolation so the command variable is populated"],"exampleFix":"// before\nopencli geogebra eval \";\"\n// after\nopencli geogebra eval \"a=Circle((0,0),5);b=Line((0,0),(1,1))\"","handlingStrategy":"validation","validationCode":"const raw = String(args.command ?? '').trim();\nif (!raw || raw.split(';').every(s => !s.trim())) {\n  throw new Error('eval requires at least one non-empty GeoGebra command');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify interpolated variables are non-empty before building the command string","Use ';' only between commands, not leading/trailing","Echo the final command in scripts to catch empty interpolation early"],"tags":["cli","argument-validation","geogebra"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}