SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Improve `spacetime call` diagnostics for invalid / ill-typed arguments

Open cloutiertyler opened this issue 1 year ago • 1 comments

Today (2024-04-10), I (pgoldman) had to hop into a call with the BitCraft team to explain the correct syntax to call a reducer which took a C-style enum as an argument via the CLI. Ideally, the CLI error message should have given them enough information to determine a correct call on their own. Consider:

  • Changing the CLI's parsing to accept strings for C-style enums (They were trying to pass "Admin", when the correct parse was { "Admin": {} }, which is a stupid and unintuitive format).
  • Printing a sample invocation which will parse correctly.
  • Linking the docs for the JSON format used by the CLI.

cloutiertyler avatar Dec 16 '24 21:12 cloutiertyler

We could accept both the old and new format and therefore not be api-breaking.

bfops avatar Jan 06 '25 20:01 bfops