@flopost/cli
v0.2.0
Published
CLI for the Flopost content OS — log in, manage API keys, install as an MCP server in Claude Code / Cursor / Crewly.
Maintainers
Readme
@flopost/cli
Command-line tool for Flopost — log in, manage API keys, and install Flopost as an MCP server in your agent (Claude Code, Cursor, Crewly).
npm i -g @flopost/cli
flopost login
flopost mcp install claude-codeCommands
| Command | What it does |
| --- | --- |
| flopost login | Browser-mediated handshake; stores key at ~/.flopost/credentials.json (mode 0600). |
| flopost login --device-code | Same flow, but prints a short code instead of auto-opening the browser. Useful over SSH. |
| flopost login --paste | Print a URL → authorize on any device (phone is fine) → paste the displayed key back into the CLI. No polling. |
| flopost logout | Clears local credentials and revokes the key on the server. |
| flopost whoami | Prints the identity the current key resolves to. |
| flopost keys list | List your active API keys. |
| flopost keys create <name> | Create a new key (plaintext shown ONCE). |
| flopost keys revoke <id> | Revoke a key by id. |
| flopost mcp install <client> | Write MCP config for claude-code / cursor / crewly / print. |
How auth works
flopost login runs the slice 7a bootstrap handshake:
- CLI calls
POST /api/cli-auth/initiateand gets a short-livedsession_id+ a humanuser_code. - CLI opens the browser to
https://flopost.io/cli-login?session=<id>. - You sign in, see what's being authorized (client, age, IP, UA), and click Authorize.
- Server mints a long-lived API key, encrypts the plaintext at rest in the session record, marks ready.
- CLI's poll loop receives the plaintext exactly once; the session doc is then deleted.
The CLI stores the key at ~/.flopost/credentials.json. Every subsequent CLI call adds X-Flopost-Api-Key: <key> to the request.
Env vars
| Var | Default | Use |
| --- | --- | --- |
| FLOPOST_API_URL | https://services.flopost.io | Override for local dev / staging. |
| FLOPOST_WEB_URL | https://flopost.io | Override the browser-side origin used in device-flow prompts. |
| FLOPOST_CREDENTIALS_PATH | ~/.flopost/credentials.json | Override the credentials file (testing). |
| NO_COLOR | unset | Disable ANSI colors in output. |
MCP install
flopost mcp install claude-code # prints the `claude mcp add ...` command
flopost mcp install cursor # writes ~/.cursor/mcp.json
flopost mcp install crewly # writes ~/.crewly/mcp.json
flopost mcp install print # prints the canonical JSON snippetManual config (any MCP-speaking client):
{
"mcpServers": {
"flopost": {
"url": "https://services.flopost.io/api/mcp",
"headers": { "X-Flopost-Api-Key": "<your-key>" }
}
}
}Build from source
cd cli
npm install
npm run build
node dist/index.js --help