CLI Authentication
The Smidge CLI needs to be authenticated with your account before you can generate or install skills.
Device Auth Flow
The primary authentication method uses a device authorization flow — similar to how GitHub CLI and other modern CLIs work.
smdg loginThis command:
- ●Generates a unique device code
- ●Opens your default browser to the Smidge login page
- ●Displays a confirmation code in the terminal
- ●Waits for you to confirm the code in the browser
- ●Stores the authentication token locally
In the browser, you'll see the device code displayed. Verify it matches what the CLI shows, then click Confirm. The CLI will detect the confirmation and complete the login.
Token Storage
After successful login, your authentication token is stored at:
~/.config/smdg-nodejs/config.jsonThis file contains your access token and is used for all subsequent CLI operations. Keep this file secure — anyone with access to it can act as your account.
Logging Out
To clear your stored credentials:
smdg logoutThis deletes the config file and invalidates the stored token.
API Key Authentication (CI/CD)
For automated environments like CI/CD pipelines, use an API key instead of the interactive device flow.
Setting Up
- ●Navigate to your Account page
- ●Find the API Key section
- ●Generate or copy your API key (format: smdg_sk_...)
- ●Set the
SMDG_API_KEYenvironment variable
export SMDG_API_KEY=smdg_sk_your_key_here
# The CLI will automatically use SMDG_API_KEY when present
smdg generate --source ./docs.pdf --name my-skillPriority
If both a stored token (from smdg login) and the SMDG_API_KEY environment variable are present, the environment variable takes priority.