GuidesCLI

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 auth

This will:

  1. Open your browser to the Bluebag authentication page
  2. Display a verification code in your terminal
  3. Wait for you to approve the device authorization
  4. Prompt you to select an organization and project
  5. Create a .bluebagrc configuration 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

OptionDescription
organizationIdYour Bluebag organization ID
projectIdThe project to sync Skills with
skillsDirLocal 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 logout

This removes your authentication tokens but preserves the .bluebagrc configuration file.

Re-authentication

If your session expires or you need to switch accounts:

  1. Run bluebag logout to clear existing credentials
  2. Run bluebag auth to authenticate again
  3. Select your organization and project when prompted

Environment Variables

BLUEBAG_OPEN_BROWSER

Disable automatic browser opening during authentication:

export BLUEBAG_OPEN_BROWSER=0
bluebag auth

When 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:

  1. Check the terminal for the authentication URL
  2. Copy and paste it into your browser manually
  3. Or set BLUEBAG_OPEN_BROWSER=0 and use the URL directly

Authentication Timeout

If authentication times out:

  1. Ensure you completed the browser authorization
  2. Check your internet connection
  3. Try running bluebag auth again

Invalid Credentials

If you see "Authentication failed" or "Token expired":

  1. Run bluebag logout to clear stored credentials
  2. Run bluebag auth to authenticate again
  3. Ensure you have access to the organization and project

On this page