Authentication
The pd4castr CLI uses a browser-based login flow to connect to your account. You log in once, and the CLI stores your credentials locally for subsequent commands.
Log in
Run the following command to authenticate:
pd4castr loginThe CLI starts a device authorization flow and displays a verification URL and a login code:
ℹ Please open the login link in your browser:
https://pdview.au.auth0.com/activate?user_code=ABCD-EFGH
ℹ Your login code is:
ABCD-EFGH
⠋ Waiting for login to complete...To complete the login:
- Open the verification URL in your browser.
- Enter the login code shown in your terminal.
- Sign in with your pd4castr credentials.
The CLI waits automatically and confirms when the login succeeds:
✔ Successfully logged in to the pd4castr APIIf you’re already logged in with a valid token, the CLI skips the flow and displays:
✔ Already logged in!Where credentials are stored
The CLI stores your authentication token in a file called .pd4castr in your
home directory (~/.pd4castr). This file contains your access token and its
expiration timestamp. The token is checked for expiry each time you run a
command that requires authentication.
Note: Don’t edit the
.pd4castrfile manually. Usepd4castr loginandpd4castr logoutto manage your credentials.
Log out
To clear your stored credentials:
pd4castr logout✔ Successfully logged out of the pd4castr APICommands that require authentication
Not every CLI command needs you to be logged in. Here is a breakdown:
| Command | Requires login | Why |
|---|---|---|
pd4castr init | No | Fetches templates from GitHub |
pd4castr login | No | Initiates the login flow |
pd4castr logout | No | Clears local credentials |
pd4castr fetch | Yes | Queries platform data sources via the API |
pd4castr test | No | Runs entirely on your local machine |
pd4castr publish | Yes | Creates models, pushes images, uploads data |
Troubleshooting
- Token expired? Run
pd4castr loginagain. The CLI automatically detects expired tokens and prompts you to re-authenticate. - Browser didn’t open? Copy the verification URL from your terminal and paste it into your browser manually.
- Login timed out? The authorization code has a limited lifetime. If it
expires, run
pd4castr loginagain to generate a new code.
Next steps
Once you’re logged in, you can fetch test data from configured data sources and publish your model to the platform.