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 --helpAuthentication
Get your API key from app.getlogflow.com → Settings → API Keys, then run:
bash
logflow auth lf_your_api_keyThe 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.comCommands
logflow projects
List all projects in your organization.
bash
logflow projectslogflow 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 filtersOutput is color-coded by level:
debug— greyinfo— cyanwarn— yellowerror— redfatal— 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 # combinedAll 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 · 2dConfig file
Config is stored at ~/.logflow/config.json:
json
{
"apiKey": "lf_your_api_key",
"apiUrl": "https://api.getlogflow.com"
}