Skip to content

CLI ​

The dbpinball binary is a thin adapter over the core. It parses arguments, calls the core, and prints either human-readable text or one JSON object.

Structure ​

FileRole
src/cli.rsClap definitions for every command and flag
src/commands/connections.rsconnections subcommands
src/commands/doctor.rsEnvironment check
src/commands/schema.rsschema inspect
src/config.rsResolves the shared configuration directory
src/credentials.rsSelects the keyring or environment provider
src/exit.rsMaps ErrorCode to a process exit code
src/output.rsJSON envelope and human output

Design rules ​

  • No password flag. The password is read from stdin, so it never appears in shell history or process arguments.
  • One JSON object. --json emits exactly one object on stdout.
  • Stable exit codes. The mapping is documented and tested.
  • No Tauri dependency. The CLI depends on the core, never on the desktop.

Exit codes ​

CodeMeaning
0Success
2Usage error
3Connection or credential failure
4Policy refusal
5Operation or environment failure
7Unknown connection profile
8Store conflict
9Store busy

Released under the MIT License.