@letmepost/cli is a small, fast CLI that wraps the letmepost.dev REST API. Designed for terminal use, scripts, CI, and agentic tools like opencode that need a stable command surface to shell into.
Install
lmp. Versions older than Node 18 are not supported.
Login
- Registers itself dynamically with the OAuth provider (RFC 7591).
- Opens a browser to the consent page.
- Receives the auth code on a localhost callback.
- Exchanges the code for an access token.
- Trades the access token for a long-lived API key (so subsequent calls don’t depend on token refresh).
- Saves everything to
~/.letmepost/config.json(mode0600).
Environment overrides
| Variable | Description |
|---|---|
LMP_API_KEY | Skip the stored credential entirely and use this Bearer key for the call. |
LMP_API_BASE | Override the API host (defaults to https://api.letmepost.dev). For self-hosted. |
Profiles
A single organization can carve into N profiles for per-client isolation. Pick which one to publish under.--profile returns a clean validation_failed with rule: profile.scope_mismatch.
Accounts
Posting
--to. The response renders per-target results:
0 on full success, 2 on any failure. Useful in pipelines:
Post log
Self-host
Point the CLI at your own deployment by settingLMP_API_BASE:
lmp login the chosen base URL is saved alongside the credential, so subsequent calls reuse it without the env var.
Use from opencode / shell agents
The CLI prints structured output and uses standard exit codes, so it composes cleanly into agentic tool definitions:Source + roadmap
- Source: github.com/letmepost/letmepost.dev/tree/main/apps/cli
- Apache 2.0
- v0.1 ships with:
login,logout,whoami,version,accounts list/disconnect,post,posts list/get,profiles list/use/current - v0.2 will add:
media upload,webhookssubcommands,keys(mint/list/revoke API keys), refresh-token rotation for OAuth-only auth

