Output and errors

The filemaker CLI provides three levels of status: per-operation NDJSON results, a batch summary object, and a process exit code. Automation scripts should evaluate all three.

Operation results

Each input operation produces one JSON line on standard output. The op property identifies the operation, and status reports ok, dry-run, or error.

Copy
{"op":"create:table","status":"ok","result":{"name":"Invoices","id":130}}
Copy
{"op":"create:table","status":"dry-run","result":{"name":"Invoices","id":130}}
Copy
{"op":"read:table","status":"error","error":{"code":"not_found","message":"table 'Invoices' not found"}}

Error objects provide a machine-readable code, a human-readable message, and optional metadata including suggestions and numeric dbError codes from the FileMaker engine.

Batch summary

At completion, filemaker emits a summary object to standard error:

Copy
{"type":"summary","total":2,"ok":1,"errors":1,"dryRun":false,"rolledBack":true}
Summary field Meaning
total Total operations processed.
ok Count of successful operations.
errors Count of failed operations.
dryRun Indicates whether --dry-run was enabled.
rolledBack Indicates whether the transaction rolled back.

Warning  Verify summary outcome: If execution halts without emitting a batch summary, do not assume changes committed. Re-read the database schema in a new process before retrying.

Fatal and usage errors

Errors preventing batch initialization emit a fatal object to standard error:

Copy
{"type":"fatal","error":{"code":"open_failed","message":"failed to open file","dbError":802}}

The fatal error codes include open_failed, input_unreadable (a path that can't be read, or is a directory), invalid_encoding (input that isn't valid text), file_exists (a new file would overwrite an existing one), and run_timeout (the run reached its timeout; always the last record).

Process exit codes

Exit code Meaning
0 All operations completed successfully.
1 One or more operation errors occurred.
2 The run ended before or instead of the operations: the input couldn't be read, the file couldn't be opened, or the commit, close, or move of a new file failed.
4 Execution reached configured timeout limit.
64 Usage error: a mistake in the command line itself, such as an unknown option. The message is plain text on standard error, not a JSON record.

Output redirection

Operation results route to standard output by default; specify --out=<path> to save results to disk. Summaries, fatal errors, and credential prompts remain on standard error.