Authentication
Login
pb login
Open a browser window for OAuth login. After successful authentication, credentials are stored locally.
Example:
bash
pb logintext
✓ Login successfuljson
{
"code": 200,
"data": null,
"msg": "Login successful"
}Logout
pb logout
Clear stored credentials and log out of PhoneBase.
Example:
bash
pb logouttext
✓ Logged outjson
{
"code": 200,
"data": null,
"msg": "Logged out"
}Status
pb status
Check the current authentication status and account balance.
Example:
bash
pb statustext
Authenticated: yes (api_key) Balance: $50.00json
{
"code": 200,
"data": {
"authenticated": true,
"auth_type": "api_key",
"balance_cents": 5000
},
"msg": "OK"
}API Key
pb apikey [key]
Set or view the API key. Without arguments, displays the current key. With an argument, saves the key to the config file.
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | No | API key to set. Omit to display the current key |
Examples:
bash
# View current API key
pb apikey
# Set a new API key
pb apikey pb_sk_xxxxxxxxxxxxxxxxxxxxtext
api_key = pb_sk_xxxxxxxxxxxxxxxxxxxxjson
{
"code": 200,
"data": { "api_key": "pb_sk_xxxxxxxxxxxxxxxxxxxx" },
"msg": "OK"
}