Authentication
Set up authentication and configure your Bluebag project
Before using the CLI, you need to authenticate with your Bluebag account and configure which project to sync with.
Initial Setup
Run the authentication command:
bluebag authThis will:
- Open your browser to the Bluebag authentication page
- Display a verification code in your terminal
- Wait for you to approve the device authorization
- Prompt you to select an organization and project
- Create a
.bluebagrcconfiguration file in your current directory
If your browser doesn't open automatically, copy the URL from the terminal and paste it into your browser.
Configuration File
After authentication, a .bluebagrc file is created in your project root:
{
"organizationId": "org_abc123",
"projectId": "prj_xyz789",
"skillsDir": "skills"
}Configuration Options
| Option | Description |
|---|---|
organizationId | Your Bluebag organization ID |
projectId | The project to sync Skills with |
skillsDir | Local directory where Skills are stored |
The default skillsDir is skills. You can change this to any directory path relative to your project root.
Version Control
This file should be committed to version control so your team can sync the same project:
git add .bluebagrc
git commit -m "Add Bluebag configuration"Logout
To clear your stored credentials:
bluebag logoutThis removes your authentication tokens but preserves the .bluebagrc configuration file.
Re-authentication
If your session expires or you need to switch accounts:
- Run
bluebag logoutto clear existing credentials - Run
bluebag authto authenticate again - Select your organization and project when prompted
Environment Variables
BLUEBAG_OPEN_BROWSER
Disable automatic browser opening during authentication:
export BLUEBAG_OPEN_BROWSER=0
bluebag authWhen disabled, you'll need to manually copy the URL from the terminal and paste it into your browser.
Multiple Projects
To work with multiple Bluebag projects, you have two options:
Option 1: Separate Directories
Keep different projects in separate directories, each with its own .bluebagrc:
project-a/
.bluebagrc # Points to project A
skills/
project-b/
.bluebagrc # Points to project B
skills/Option 2: Re-authenticate
Run bluebag auth in the same directory to switch projects. This will update the .bluebagrc file with the new project configuration.
Troubleshooting
Browser Doesn't Open
If the browser doesn't open automatically:
- Check the terminal for the authentication URL
- Copy and paste it into your browser manually
- Or set
BLUEBAG_OPEN_BROWSER=0and use the URL directly
Authentication Timeout
If authentication times out:
- Ensure you completed the browser authorization
- Check your internet connection
- Try running
bluebag authagain
Invalid Credentials
If you see "Authentication failed" or "Token expired":
- Run
bluebag logoutto clear stored credentials - Run
bluebag authto authenticate again - Ensure you have access to the organization and project