CLI access

The tuna command line runs SQL against this ERP — reads for anyone, writes if your account has them. Four steps, about two minutes.

1

Install it

Builds natively on your own machine, so macOS (Apple Silicon included), Linux and Windows are all just this one line.

cargo install --git ssh://git@github.com/Dirac-Software/tuna.git tuna

No Rust on this machine yet? Install it first, then re-run the line above:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2

Point it at this server

The CLI talks to the gateway, not to the database. Put this in your shell profile so it survives a new terminal.

This server doesn't know its gateway address.

Nobody set TUNA_API_URL on this dashboard, so it can't print the URL for you. Running everything locally? Skip this step — the CLI already defaults to http://localhost:8092. Otherwise ask whoever deployed this dashboard for the gateway address and export that.

3

Log in

Mint a token here, then paste it at the prompt. The token carries your identity — what you may do is your account's permissions, not the token's.

tuna login
4

Check it works

The first tells you who the database thinks you are; the second returns real rows.

tuna whoami
tuna read "select * from sales.order_overview limit 5"

Good to know

  • • Reads go through tuna read, writes through tuna write — read mode is enforced by Postgres, not by the CLI.
  • tuna read --json emits NDJSON, so it pipes straight into jq.
  • • Minting a token revokes your previous one, so it is also how you kill a leaked one.
  • • Warehouse work, moving money, and changing permissions are not available from the CLI at all — those verbs are simply not granted to it.