SDK Command Line Interface¶
Logfire comes with a CLI used for authentication and project management:
usage: logfire [-h] [--version]  ...
The CLI for Pydantic Logfire.
options:
  -h, --help  show this help message and exit
  --version   show the version and exit
commands:
    auth      Authenticate with Logfire.
    clean     Remove the contents of the Logfire data directory.
    inspect   Inspect installed packages and recommend packages that might be
              useful.
    whoami    Show user authenticated username and the URL to your Logfire
              project.
    projects  Project management for Logfire.
    info      Show versions of logfire, OS and related packages.
See https://logfire.pydantic.dev/docs/reference/cli/ for more detailed
documentation.
Authentication (auth)¶
You need to be authenticated to use the Logfire.
Abstract
Read the Terms of Service and Privacy Policy if you want
to know how we handle your data. 
To authenticate yourself, run the auth command in the terminal:
logfire auth
After pressing "Enter", you will be redirected to the browser to log in to your account.
Then, if you go back to the terminal, you'll see that you are authenticated! 
Clean (clean)¶
To clean most the files created by Logfire, run the following command:
logfire clean
The clean command doesn't remove the logs, and the authentication information stored in the ~/.logfire directory.
To also remove the logs, you can run the following command:
logfire clean --logs
Inspect (inspect)¶
The inspect command is used to identify the missing OpenTelemetry instrumentation packages in your project.
To inspect your project, run the following command:
logfire inspect
This will output the projects you need to install to have optimal OpenTelemetry instrumentation.
Who Am I (whoami)¶
๐ง Work in Progress ๐ง
This section is yet to be written, contact us if you have any questions.
Projects¶
List (projects list)¶
To check the projects you have access to, run the following command:
logfire projects list
You'll see something like this:
โฏ logfire projects list
โโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโ
โ Organization โ Project        โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Kludex       โ backend        โ
โ Kludex       โ worker         โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโ
Use (projects use)¶
To use an already created project, run the following command:
logfire projects use <project-name>
For example, to use the backend project, you can run:
logfire projects use backend
Create (projects new)¶
To create a new project, run the following command:
logfire projects new <project-name>
Follow the instructions, and you'll have a new project created in no time! 



