CLI

Tail and search your logs directly from the terminal with the @getlogflow/cli package.

Installation

bash
npm install -g @getlogflow/cli
# or use without installing
npx @getlogflow/cli --help

Authentication

Get your API key from app.getlogflow.com → Settings → API Keys, then run:

bash
logflow auth lf_your_api_key

The key is saved to ~/.logflow/config.json and reused automatically in all subsequent commands.

ℹ️
For self-hosted instances, pass --url to point to your own API: logflow auth lf_key --url https://api.yourcompany.com

Commands

logflow projects

List all projects in your organization.

bash
logflow projects

logflow tail

Stream logs in real time via SSE. Press Ctrl+C to stop.

bash
logflow tail                        # all logs, first project
logflow tail --service api          # filter by service
logflow tail --level error          # errors and above
logflow tail --filter "payment"     # message text search
logflow tail -s worker -l warn      # combine filters

Output is color-coded by level:

  • debug — grey
  • info — cyan
  • warn — yellow
  • error — red
  • fatal — red background

logflow logs

Fetch recent logs (newest first by default).

bash
logflow logs                        # last 50 logs
logflow logs --limit 200            # up to 500 logs
logflow logs --level error          # errors only
logflow logs --service worker       # specific service
logflow logs --since 1h             # last hour
logflow logs --since 30m            # last 30 minutes
logflow logs --since 2d             # last 2 days
logflow logs -s api -l error --since 6h  # combined

All options

bash
Options available on tail and logs:
  -p, --project <id>    Project ID (uses first project if omitted)
  -s, --service <name>  Filter by service name
  -l, --level <level>   Level: debug | info | warn | error | fatal
  -f, --filter <text>   Filter by message text

Additional options on logs:
  -n, --limit <n>       Number of logs to return (default: 50, max: 500)
      --since <time>    Time window: 30m · 1h · 6h · 24h · 2d

Config file

Config is stored at ~/.logflow/config.json:

json
{
  "apiKey": "lf_your_api_key",
  "apiUrl": "https://api.getlogflow.com"
}