Login Command
Authenticate and access your SnippetKit account
Usage
Finding Your API Key
Users can retrieve their API key from the API Keys section of their account settings.
Creating a New API Key
If they don’t have one or need a new key, they can generate it in the API Keys section by clicking the Generate Token button.
Basic Usage
Prompts the user to enter an API key securely.
Stores the API key locally in a config file.
Silent Mode (Provide API Key in One Command)
Bypasses the prompt and saves the API key directly.
Where is the API Key Stored?
The API key is stored in a local config file (e.g., ~/.config/snippetkit/config.json).
It is never exposed in logs or shared with third-party services.
Common Errors & Troubleshooting
❌ Invalid API Key
Error Message:
Error: Invalid API key. Please check your credentials.
Solution:
- Ensure you copied the key correctly.
- Regenerate the key from your account dashboard.
🔒 Permission Denied (Cannot Store API Key)
Error Message:
Error: Unable to save API key. Check file permissions.
Solution:
- Run the command with proper permissions (sudo if needed).
- Check that
~/.config/snippetkit/exists and is writable.
🚫 No Internet Connection
Error Message:
Error: Could not connect to authentication server.
Solution:
- Check your internet connection.
- Retry after a few minutes.