# Debug commands of @ferret/dataflow, @ferret/motion

Call with `world.commands.execute(name, args)`; `world.commands.list()` on the running game is the authority. Read from the sources of these packages.

- `edit.game.list` — the files of the game: [{name, bytes, lines}]
- `edit.game.remove` — remove a file of the game: {name} -> the files left
- `edit.game.set` — add or replace a file of the game: {name, source}, or several at once: {files: {name: text}, remove?: [name]}; a game with an error is refused whole and the old one stays -> the files
- `game.check` — read and check a game file without loading it: {source} -> {ok, error, kinds, externs, flows, nodes, clocks}
- `game.despawn` — remove an entity: {id}
- `game.entities` — the entities: {kind?} -> [{id, kind, fields}]; with {offset?, count?} a page {total, offset, rows}
- `game.entity` — one entity's fields and tokens: {id} -> {id, kind, fields, tokens}
- `game.eval` — one expression of the current step: {expr} -> its value (the time and the pre values are copied into a scratch machine; nothing of the game changes)
- `game.graph` — the game's graph: {kind?, offset?, count? (a page of the nodes)} -> nodes (id, op, name, args, type, clock, form, at), sinks, events, and each graph's measured cost
- `game.load` — read, check and load the game: {source, name?} or {files: {name: text}} -> {kinds, nodes, levels}; it runs after game.run
- `game.manifest` — a level written in forms, as its manifest JSON: {level? (a name; the first one)} -> the manifest
- `game.run` — step the game with the world's fixed step
- `game.spawn` — make an entity of a kind: {kind, fields?} -> {id}
- `game.step` — advance the game by hand: {n? (1), dt? (the fixed step)} -> {steps, time}
- `game.stop` — stop stepping the game
- `game.tokens` — the tokens (values) of the last step: {kind?, id?} (the game's graph, or one entity's) -> [{id, op, form, value}]; with {offset?, count?} a page {total, offset, rows}
- `game.trace` — values of chosen nodes over steps: {steps, nodes: [names of def or node ids]}; steps by hand when the game is not running, else it waits for the next steps -> [{step, time, values}]
