Logfire CLI
The Rust command-line interface for Pydantic Logfire. Sign in, query your traces and logs, manage projects and tokens, and connect your coding agent to Logfire from the terminal.
This package installs the native CLI, not the Python instrumentation SDK. Install an application SDK separately to send telemetry; see the Logfire documentation.
Install
Try it with uv:
uvx logfire-cli --help
Install it as an isolated command-line tool:
uv tool install logfire-cli
logfire --help
Or use pipx install logfire-cli. In an activated virtual environment, you can
also run python -m pip install logfire-cli.
The package provides both logfire and logfire-cli. If another package already
provides a logfire command, use logfire-cli or uvx logfire-cli to select this
CLI explicitly.
Python 3.9 or newer is required for the launcher. Wheels include the matching prebuilt binary for macOS (Apple Silicon and Intel), GNU/Linux (ARM64 and x86-64), and Windows (x86-64). You do not need Rust installed. Alpine/musl and Windows ARM64 do not currently have native wheels.
Sign in and query
Use your real organization name in place of acme, and eu instead of us if
your data is in the EU region:
logfire --region us --org acme auth
logfire --org acme mcp projects
Complete sign-in and approve access in your browser. OAuth credentials are stored in the OS credential store, scoped to the Logfire origin and organization.
Choose a project from the list, then query its data through the hosted Model Context Protocol (MCP) server:
logfire --org acme mcp query run 'SELECT message FROM records LIMIT 20' --project my-app
For scripts, make the target explicit and request non-interactive JSON output:
logfire --org acme --no-input --output json mcp projects
Connect a local project
From your application's directory, connect an existing project. This creates an
SDK write token and saves it in .logfire/logfire_credentials.json:
logfire --org acme init use --name my-app --permission send
logfire project current
OAuth remains in the OS credential store; the SDK token stays with the local project. Keep credential files out of version control.
To create additional read or write tokens for that project:
logfire --org acme token read
logfire --org acme token write
Each command creates a new token and prints the secret once to standard output. Store it securely; do not paste it into logs, issues, or chat. These commands do not replace the project's saved SDK write token.
Run Python with automatic instrumentation
The CLI selects the active project interpreter and delegates instrumentation to the Logfire Python SDK installed in that environment:
logfire run app.py
logfire run -m uvicorn main:app
logfire run pytest tests/
Use --python .venv/bin/python when interpreter discovery is ambiguous. See
logfire run for selection rules and passthrough behavior.
Set up instrumentation with a coding agent
With Codex or Claude Code installed, run this from your application's directory:
logfire --region us --org acme setup
The CLI detects installed agents and hands off the Logfire setup instructions bundled with this release. The agent can change your project to add instrumentation, using its normal permission and approval controls.
Authenticated product links can preserve a known project and setup job:
logfire --region us --org acme setup --project api --task instrumentation
Public and getting-started pages should normally keep using bare setup; the
contextual flags are for flows that already know the exact account target.
To inspect the instructions without launching an agent:
logfire --region us --org acme setup --print-prompt
Help and updates
logfire help
logfire help mcp
logfire help setup
uv tool upgrade logfire-cli
Use the upgrade command for a uv tool install installation; otherwise upgrade
with the package manager you used to install it.
See the Logfire documentation for application instrumentation and platform guides. Logfire CLI is licensed under the MIT license.
Release files for logfire-cli 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| logfire_cli-0.1.4-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| logfire_cli-0.1.4-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| logfire_cli-0.1.4-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| logfire_cli-0.1.4-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| logfire_cli-0.1.4-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 14.5 MB
Release files / logfire_cli-0.1.4-py3-none-win_amd64.whl
| Download URL | logfire_cli-0.1.4-py3-none-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fc59d3522ddf677105eebbd5d93685cb0723922657c230143505e0c32d6634a8
|
|
BLAKE2b-256 checksum How to use checksums |
1abb83d112d16b488e74da589ed0c56db35d9842f5c7b259c12bd89cde80c525
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / logfire_cli-0.1.4-py3-none-manylinux_2_17_x86_64.whl
| Download URL | logfire_cli-0.1.4-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
8df1cca4b576df3590dcc126e71a3878fab19f66257f4bebbb632ea0ee1a6678
|
|
BLAKE2b-256 checksum How to use checksums |
f0e9ba4947c53bcadd289c9fe226c8de9e431cc19d9a97c55363f41c1da9d2f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / logfire_cli-0.1.4-py3-none-manylinux_2_17_aarch64.whl
| Download URL | logfire_cli-0.1.4-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
65c75bb564415b13a1b68ea5fa0837adbf7b784d83577bb21d5205e733271483
|
|
BLAKE2b-256 checksum How to use checksums |
b1a778baff9567f9c127d1fb619c35142c7ddb6a10072c2a9811efda9b79cc14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / logfire_cli-0.1.4-py3-none-macosx_11_0_arm64.whl
| Download URL | logfire_cli-0.1.4-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8cd734ae1319f53676e86b4348285382ceb39e6fde55e02263f3c30084fab971
|
|
BLAKE2b-256 checksum How to use checksums |
7cabba1d3be728aae431cf8b7143821192ba75940ec65124e1db7e37d0c218be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / logfire_cli-0.1.4-py3-none-macosx_10_12_x86_64.whl
| Download URL | logfire_cli-0.1.4-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c0e9384c7a0d55623c5615200406f2a22648be89c8a72fcd3297bef5ec78a337
|
|
BLAKE2b-256 checksum How to use checksums |
a75b29f6d05e1bc1bda448a4adc58f4149cf6b39a65e23796d71da00981c6fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|