Use ThreadRail from the command line
Run your outreach and CRM from the terminal. See what needs you, read campaign results, move deals and approve emails with the same rules, roles and audit trail as the ThreadRail app.
Install
npm install -g @rajoka/threadrail- Node 24 or later.
- macOS or Linux to sign in as yourself. On Windows, use a machine token for now.
Use -g so threadrail works from any folder.
Sign in
- Run threadrail login.
threadrail login - Press Enter to open the sign-in page, or open the address it shows. Check the code matches, then approve with your Rajoka ID and two-step sign-in.
- The first time, ThreadRail asks you to approve the connection for your workspace and choose its level. threadrail login shows that page and waits for you.
- When you see "Ready. You can now use threadrail.", you are done.
What you can do
Today and inbox
- Read only
Search contacts
contacts.searchFind a contact by name, email, firm or company number, with their firm and where they are in your campaigns.
threadrail contacts.search - Read only
Get a company
companies.getSee one firm in full: its Companies House details, contacts, campaign progress and the researched facts with their sources.
threadrail companies.get --company_id <company_id> - Read only
Get a thread or a contact's messages
threads.getRead one conversation, or every message with one contact.
threadrail threads.get - Read only
List what needs you
needs_you.listSee the replies waiting for you, most urgent first, each with a short summary.
threadrail needs_you.list - Read only
List next steps due
due_next_steps.listSee what is due today: deal next steps that are due or overdue, and conversations due a follow-up.
threadrail due_next_steps.list - Read only
Latest Monday digest
latest_digest.getRead this week's Monday summary: the week's numbers and what happened.
threadrail latest_digest.get - Makes changes
Mark a thread handled
threads.handled.updateMark a conversation as handled so it leaves Needs you. Nothing is sent.
threadrail threads.handled.update --thread_id <thread_id>
Campaigns and results
- Read only
Campaign figures
campaign_stats.listSee every campaign at a glance: firms at each stage, drafts waiting for approval, emails sent, replies and AI cost.
threadrail campaign_stats.list - Read only
Campaign report
campaign_reports.getRead one campaign's results: from sent to won, cost per interested reply, the angles that worked and how far it can run on its own.
threadrail campaign_reports.get --campaign_id <campaign_id> - Read only
Brand report
brand_reports.getRead one brand's results across all its campaigns: from sent to won, cost per interested reply and the angles that worked.
threadrail brand_reports.get --brand_slug <brand_slug> - Read only
Autonomy status
autonomy.getSee how much a campaign can do on its own, what it needs to earn more, and what is holding it back.
threadrail autonomy.get --campaign_id <campaign_id> - Read only
List open brief proposals
brief_proposals.listSee this week's suggested changes to a campaign's approach, each with its reason. An owner decides them in ThreadRail.
threadrail brief_proposals.list - Read only
Pipeline health
pipeline_runs.listSee when ThreadRail's daily and weekly jobs last ran.
threadrail pipeline_runs.list - Makes changes
Create a campaign
campaigns.createStart a new campaign for a brand, with its audience, offer and angles. Owners only. Every email still needs a person's approval.
threadrail campaigns.create --brand_slug <brand_slug> --name <name> --slug <slug> --audience_key <audience_key> --offer <offer> --angles <angles> --reason_line <reason_line> - Makes changes
Enrol firms
enrolments.createAdd up to 50 more firms to a campaign from its audience. Owners only. Each firm passes the opt-out and UK marketing rules checks first.
threadrail enrolments.create --campaign_id <campaign_id> --count <count> - Makes changes
Stop an enrolment
enrolments.cancelStop one firm in a campaign, with a reason. No more emails go to that firm from this campaign.
threadrail enrolments.cancel --enrolment_id <enrolment_id> --reason <reason> - Makes changes
Stop a campaign's sending
campaign_sending.cancelStop a campaign sending straight away and cancel every scheduled email. Owners only. Only a person in ThreadRail can restart it.
threadrail campaign_sending.cancel --campaign_id <campaign_id>
Drafts and sending
- Read only
List drafts waiting for approval
waiting_drafts.listSee the emails waiting for your approval, oldest first, including any the checker flagged for a person.
threadrail waiting_drafts.list - Makes changes
Write a draft
drafts.createWrite an email for one firm yourself. It is checked and goes to the approval queue; it is never sent from here.
threadrail drafts.create --enrolment_id <enrolment_id> --subject <subject> --body <body> --why_line <why_line> - Makes changes
Add an opt-out
suppressions.createStop all email to an address, domain, phone number or company, everywhere and for good.
threadrail suppressions.create --kind <kind> --value <value> - Makes changes
Reject a waiting draft
draft_rejections.createReject a waiting email and say why. ThreadRail can write a new one from your reason, or stop that firm.
threadrail draft_rejections.create --draft_id <draft_id> --reason <reason> - Makes changes
Suggest a reply on a thread
reply_suggestions.createAsk ThreadRail's AI to draft a reply from your instruction. It waits in the reply box for a person to edit and send.
threadrail reply_suggestions.create --thread_id <thread_id> --channel <channel> --instruction <instruction> - Makes changes
Report a wrong fact
fact_reports.createReport a wrong fact in an email that was sent. The campaign drops back to full approval while the fact is checked.
threadrail fact_reports.create --message_id <message_id> --note <note> - Makes changes
Prepare a draft to send
sends.prepareShow the exact email before it goes, so you can approve it.
threadrail sends.prepare --draft_id <draft_id> - Makes changes
Send a prepared draft
sends.commitSend an email you prepared. It goes out in the next sending window if the campaign allows it, or waits for a person's approval.
threadrail sends.commit --token <token> - Makes changes
Approve a prepared draft
approvals.commitApprove an email you prepared. At a campaign's first level, emails are approved in ThreadRail instead.
threadrail approvals.commit --token <token>
Deals
- Read only
Deals board
deals.listSee your deals, open and closed, with their stage, value and next step, for everything or one campaign or brand.
threadrail deals.list - Makes changes
Set a deal's next step
deals.next_step.updateSet a deal's next step, with an optional due date.
threadrail deals.next_step.update --deal_id <deal_id> --text <text> - Makes changes
Move a deal
deals.stage.updateMove a deal to another stage, or mark it won or lost.
threadrail deals.stage.update --deal_id <deal_id> --stage <stage> - Makes changes
Set a deal's value
deals.value.updateSet a deal's value in pounds.
threadrail deals.value.update --deal_id <deal_id> --value_gbp <value_gbp>
Brands, mailboxes and channels
- Read only
Sender health
sender_health.listCheck each sending mailbox: warm-up progress, daily limit, emails sent today, any pauses and why, and its email setup.
threadrail sender_health.list - Read only
List brands
brands.listSee your brands, with their voice, sending details, footer and channels.
threadrail brands.list - Makes changes
Create a brand
brands.createCreate a brand. Owners only.
threadrail brands.create --name <name> --slug <slug> - Makes changes
Update a brand
brands.updateChange a brand's voice, banned phrases, legal footer or privacy link. Owners only.
threadrail brands.update --brand_id <brand_id> - Read only
List channels
channels.listSee your mailboxes, aliases and WhatsApp numbers, with their status and whether they are paused.
threadrail channels.list - Makes changes
Create a mailbox password link
mailboxes.createAdd a mailbox and get a secure page where you type its password. Owners only.
threadrail mailboxes.create --brand_id <brand_id> --address <address> - Makes changes
Test a mailbox
mailbox_tests.createTest that a mailbox connects. Owners only.
threadrail mailbox_tests.create --mailbox_id <mailbox_id> - Makes changes
Create a mailbox alias
mailbox_aliases.createAdd another address on a mailbox's domain. Owners only.
threadrail mailbox_aliases.create --mailbox_id <mailbox_id> --address <address> - Makes changes
Cancel a mailbox alias
mailbox_aliases.cancelRetire a mailbox address and keep its mail history. Owners only.
threadrail mailbox_aliases.cancel --alias_id <alias_id> - Makes changes
Update a channel
channels.updateChange how a mailbox or WhatsApp number is handled, or pause or resume it. Owners only.
threadrail channels.update --kind <kind> --endpoint_id <endpoint_id> - Makes changes
Request a WhatsApp number
whatsapp_number_requests.createAsk for a WhatsApp number to be connected. Owners only.
threadrail whatsapp_number_requests.create --brand_id <brand_id> --number <number> - Makes changes
Start sender warm-up
warmups.createStart warming up a new email sender, once its email setup and warm-up contacts are ready. Owners only.
threadrail warmups.create --sender_id <sender_id> - Makes changes
Add warm-up contact
warmup_contacts.createAdd a person who agreed to receive warm-up emails. Owners only.
threadrail warmup_contacts.create --brand_id <brand_id> --name <name> --email <email> --relationship <relationship> - Makes changes
Remove warm-up contact
warmup_contacts.cancelStop sending warm-up emails to a person. Owners only.
threadrail warmup_contacts.cancel --contact_id <contact_id> - Makes changes
Resume paused sending
sending_pauses.cancelResume a paused sender at a lower daily limit, as the app does. Owners only.
threadrail sending_pauses.cancel --kind <kind> --id <id> - Read only
List signatures
signatures.listSee the email signatures in your workspace.
threadrail signatures.list - Makes changes
Save new signature
signatures.createSave an email signature for a person and brand, or for one mailbox address.
threadrail signatures.create --brand_id <brand_id> --html <html> - Makes changes
Update signature
signatures.updateChange an email signature.
threadrail signatures.update --signature_id <signature_id> --html <html> - Makes changes
Remove signature
signatures.cancelRemove an email signature. Members can remove their own; owners can remove anyone's.
threadrail signatures.cancel --signature_id <signature_id> - Read only
List snippets
snippets.listSee your saved reply snippets.
threadrail snippets.list - Makes changes
Create snippet
snippets.createSave reply text you use often, for one brand or the whole workspace.
threadrail snippets.create --name <name> --html <html> - Makes changes
Update snippet
snippets.updateChange a saved snippet. Its author or an owner can change it.
threadrail snippets.update --snippet_id <snippet_id> --name <name> --html <html> - Makes changes
Remove snippet
snippets.cancelRemove a saved snippet. Its author or an owner can remove it.
threadrail snippets.cancel --snippet_id <snippet_id>
Support and team
- Read only
Support overview
support_overview.getSee how support is set up for each brand: automatic answers, help articles, and its mailboxes and WhatsApp numbers.
threadrail support_overview.get - Read only
Sign-up sources
signup_sources.listCheck that sign-ups from your products are reaching ThreadRail, and how many matched a contact in the last 30 days.
threadrail signup_sources.list - Read only
List help articles
help_articles.listSee your approved help articles.
threadrail help_articles.list - Makes changes
Create help article
help_articles.createAdd an approved help article with its source. Owners only.
threadrail help_articles.create --brand_id <brand_id> --title <title> --body <body> --source_url <source_url> - Makes changes
Update help article
help_articles.updateChange an approved help article. Owners only.
threadrail help_articles.update --article_id <article_id> --title <title> --body <body> --source_url <source_url> - Makes changes
Set automatic support answers
support_auto.updateTurn automatic support answers on or off for a brand. Owners only; turning them on needs 20 good suggestions in a row first.
threadrail support_auto.update --brand_id <brand_id> --enabled <enabled> - Read only
List workspace members
members.listSee the people in your workspace.
threadrail members.list - Makes changes
Add workspace member
members.createAdd someone who already uses ThreadRail to your workspace, by email. Owners only.
threadrail members.create --email <email> - Makes changes
Remove workspace member
members.cancelRemove someone from your workspace and end their connections. Owners only; the last owner stays.
threadrail members.cancel --user_id <user_id>
Examples
See every campaign at a glance
threadrail campaign_stats.listSee the replies waiting for you, most urgent first
threadrail needs_you.listRead a campaign's results for the last 7 days
threadrail campaign_reports.get --campaign_id <id> --days 7Set a deal's next step
threadrail deals.next_step.update --deal_id <id> --text "Send the onboarding guide" --on 2026-12-01Show an email, then approve it
threadrail sends.prepare --draft_id <id>Count what needs you, in a script
threadrail needs_you.list --json
Scripts and automation
- Add --json to any command for output a script can read.
- The exit code is 0 on success and 1 on any error. Errors are one line on stderr, or JSON with --json.
- On a server or in CI, set RAJOKA_CONNECT_TOKEN to a Rajoka Connect machine token. It is used instead of a person's sign-in, and --access-token wins over both.
How it stays safe
- Sign in with Rajoka ID and two-step sign-in. threadrail never sees your password.
- Your sign-in is kept only in your system keychain, never in a file. threadrail logout removes it from this computer.
- You choose the workspace and level when you approve the connection. Remove it at any time on the Connections screen in ThreadRail, and the CLI stops working on every computer.
- Every command runs as you, with your role in ThreadRail.
- Text from your records is shown as data, never as terminal instructions.
Troubleshooting
command not found: threadrail- Install it with -g: npm install -g @rajoka/threadrail.
Unsupported engine, or a syntax error when it starts- Update Node to 24 or later.
Run threadrail login- Your sign-in has ended or was not accepted. Run threadrail login again.
A message with an Open: link- Open the link, finish the step there, such as approving the connection, then run the command again.
Turn on two-step sign-in- Turn it on for your Rajoka ID, then run threadrail login again.
needs the system keychain- On a machine without one, such as a server, use RAJOKA_CONNECT_TOKEN.
Manage your connection
You can see or remove your command line connection in ThreadRail.