Command line
Trina CLI
Manage your Trina blog drafts straight from the terminal — sign in with your browser, list the drafts that are ready, and submit a published URL for verification. No password, no API key.
Before you start
- Node.js 18 or newer
- A Trina account (the same one you use to sign in to the console)
1. Install
Install it globally from npm; the command you run is trina.
npm install -g @trina007/trina-cliNo build step and no dependencies — it's a small Node package.
2. Sign in
Run login. It opens your browser to a Trina page; sign in with Google and click Authorize. The token is handed back to the CLI on your machine and stored locally.
trina login- Credentials are saved at ~/.config/trina/credentials.json (readable only by you) and refresh automatically.
- The browser only sends the token to a local address on your own computer — never to a third party.
- If the browser doesn't open, copy the printed URL into it manually. The sign-in window stays open for 5 minutes.
3. Commands
Once you're signed in:
trina readyList your blog drafts that haven't been published yet.trina get <id>Print a draft's title, body, and cover image URL.trina status <id>Show a draft's per-channel verification state.trina verify <id> <url>Submit the published URL so Trina can verify the live post.trina whoamiShow which account you're signed in as.trina logoutForget the saved login on this machine.If your account has more than one brand, add --brand <slug> to target a specific one.
Building automation or an AI agent? Add --json to ready, get, status, and verify for machine-readable output — so it can fetch a draft's body and cover, then check the result, without scraping the console.
A typical run
- trina ready — see which blog drafts are waiting.
- Copy a draft and publish it on your channel.
- trina verify <id> <url> — hand the published link back so Trina confirms it's live.
For AI agents
Every command takes --json, so an AI agent (or any script) can run the whole loop unattended — the only step that needs a human is the one-time sign-in.
- A human runs trina login once; the agent then reuses the saved, auto-refreshing credentials.
- trina ready --json — the agent gets the unpublished drafts as JSON and picks an id.
- trina get <id> --json — the agent reads the draft's title, Markdown body, and cover image URL.
- The agent publishes it to your channel and captures the live URL.
- trina verify <id> <url> --json — the agent submits the link and reads the verification result.
# one-time, by a human:
trina login
# then your agent runs, unattended:
trina ready --json # → [{ "id": "...", "title": "...", "verify": "pending" }]
trina get <id> --json # → { "title": "...", "body": "...", "cover": "https://..." }
# ...the agent posts the body + cover to your channel...
trina verify <id> <published-url> # confirm it's liveA get --json call returns everything needed to post — title, body, and cover:
$ trina get brief-1 --json
{
"id": "brief-1",
"title": "How retrieval-augmented generation works",
"status": "not_published",
"channel": "blog",
"verify": "pending",
"publishedUrl": null,
"cover": "https://.../cover.png",
"candidates": ["https://.../a.png", "https://.../b.png"],
"body": "# How retrieval-augmented generation works\n\n..."
}Because credentials refresh automatically, the loop keeps running after that first login. Add --brand <slug> if the agent manages more than one brand.
Help
Run trina help any time for the full command list. The package is open source: github.com/potenlab/ai-marketing/tree/main/cli