{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "pydantic-logfire--connect-a-python-project-to-logfire",
 "repo": "pydantic/logfire",
 "repo_url": "https://github.com/pydantic/logfire",
 "repo_slug": "pydantic-logfire",
 "title": "Connect a Python project to Logfire in two commands",
 "page_title": "How to connect a Python project to Logfire in two commands with Logfire",
 "summary": "Install the SDK and CLI, authenticate, and let init pick or create the project and save its write token.",
 "who": "A developer adding observability to an existing Python service.",
 "problem": "Wiring tokens and projects by hand is fiddly.",
 "outcome": "A project linked to Logfire and ready to receive traces.",
 "steps": [
  "Install with `pip install logfire`",
  "From your application's directory run `uvx logfire-cli auth` to sign in",
  "Run `uvx logfire-cli init` to select or create a project and save its write token locally",
  "Call Logfire.configure() in your code, which does not prompt for setup"
 ],
 "agent_prompt": "Using pydantic/logfire, install it with `pip install logfire`, run `uvx logfire-cli auth` and `uvx logfire-cli init` in <my app directory>, then add logfire.configure() to the entrypoint.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Beginner",
 "time": "10 minutes",
 "basis": "readme",
 "caveat": "The server application is closed source; only the SDK and docs are in the repo.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with pip",
  "A Logfire account, since the backend is a closed source hosted service",
  "uv for the uvx commands"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "init saves a project write token locally; keep it out of git."
  },
  {
   "tag": "data",
   "notice": "Traces you send go to the hosted Logfire backend, which is closed source."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/pydantic-logfire/connect-a-python-project-to-logfire/",
 "md": "https://dedupedai.com/use-cases/pydantic-logfire/connect-a-python-project-to-logfire/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/pydantic-logfire--connect-a-python-project-to-logfire.json",
 "api_version": "v1"
}
