Skip to main content

TRMNL CLI

Manage your TRMNL devices, playlists and plugins from your terminal.

Written by Ryan Kulp

Clicking around a dashboard is fine. Typing trmnl list-devices and getting an answer is better.

The TRMNL CLI turns every endpoint in our Account API into a command. List your devices, rename them, manage playlists and plugin settings, install recipes, and more. We don't ship a new version when we add an endpoint. The CLI reads our API docs and picks up new commands on its own.

Prerequisites

  1. TRMNL account

  2. macOS, Linux or Windows

Step 1 - Install the CLI

With Homebrew: brew install usetrmnl/tap/trmnl

No Homebrew? Download a binary from the releases page.

Step 2 - Sign in

Run any command that touches your account, for example:

trmnl list-devices

Your browser opens trmnl.com and asks what the CLI may do. Read, content and devices are ticked. Delete, profile and apps are not, so tick them only if you need them. You can also limit the CLI to some of your devices and plugin settings. Click Allow and head back to your terminal.

Step 3 - Explore

trmnl --help lists every command, grouped the same way as our API docs. Add --help after any command to see what it accepts.

A few to try:

  • trmnl list-devices

  • trmnl update-device 123 'name: Kitchen'

  • trmnl list-playlist-items

  • trmnl list-plugin-settings

Step 4 - You're done!

The CLI refreshes its access on its own, so you stay signed in as long as you use it at least once every 30 days. After a longer break it opens your browser again.

To take access away, remove "TRMNL CLI" under Connected agents in the Developer section of your account page. To sign out on this computer only, run trmnl auth logout.

Scripts and automation

No browser on the machine? Create an API key under Account API keys in the Developer section of your account page, give it only the capabilities it needs, and set it before running a command:

export TRMNL_API_KEY=trmnl_xxxxx

With that set, the CLI uses the key and never opens a browser.

The API keys section appears once your account has a device with the Developer edition upgrade. Every BYOD license includes it. Browser sign in works for every account.

Troubleshooting

"lacks the devices capability" (or another capability). The CLI wasn't given that permission. For an API key, create a new key with it. For a browser sign in, remove "TRMNL CLI" from Connected agents, run the command again, and tick that box.

"Invalid API key". Your TRMNL_API_KEY is wrong or was revoked. Copy it again from the Developer section of your account page, or unset it to sign in through the browser instead.

"Rate limit exceeded". Too many requests in one minute. Wait a minute and try again.

A new command isn't showing up. The CLI remembers our API docs for a while. Run trmnl cache clear.

Looking for your device's screen endpoints? The CLI covers your account, not the endpoints a device calls itself. Those are in our developer docs.

Building a plugin? trmnlp previews your markup locally. Want an AI agent to do the typing? See AI Agent.

Did this answer your question?