Skip to main content
@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

The binary is named lmp. Versions older than Node 18 are not supported.

Login

Opens your browser to authorize the CLI via OAuth 2.1 with PKCE. The CLI:
  1. Registers itself dynamically with the OAuth provider (RFC 7591).
  2. Opens a browser to the consent page.
  3. Receives the auth code on a localhost callback.
  4. Exchanges the code for an access token.
  5. Trades the access token for a long-lived API key (so subsequent calls don’t depend on token refresh).
  6. Saves everything to ~/.letmepost/config.json (mode 0600).
If you’re in a headless environment, the URL is printed so you can copy it to another browser. If the OAuth provider isn’t reachable, the CLI falls back to prompting for an API key paste.

Environment overrides

Profiles

A single organization can carve into N profiles for per-client isolation. Pick which one to publish under.
Per-command override:
If the loaded credential is itself profile-scoped, passing a different --profile returns a clean validation_failed with rule: profile.scope_mismatch.

Accounts

Posting

A single call fans out to every platform in --to. The response renders per-target results:
Exit code is 0 on full success, 2 on any failure. Useful in pipelines:

Post log

Self-host

Point the CLI at your own deployment by setting LMP_API_BASE:
Or persist it: after 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:
For tighter integration, use the MCP server directly. It wraps the same API and exposes one tool per OpenAPI operation.

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, webhooks subcommands, keys (mint/list/revoke API keys), refresh-token rotation for OAuth-only auth