Skip to content

Authentication Commands

The Flywheel CLI provides three commands to manage your authentication to a Flywheel site: fw login, fw logout, and fw status.

The fw login Command

Use fw login to authenticate the CLI with your Flywheel site using an API key.

Usage

fw login <api_key>

Required Arguments

Required Argument Description
api_key Your Flywheel API Key

Optional Arguments

Optional Argument Description
-h, --help Show help message and exit.
-C PATH, --config-file Specify configuration options via config file.*
--no-config Do NOT load the default configuration file.
-y, --yes Assume the answer is yes to all prompts.
--ca-certs CA_CERTS Path to a local Certificate Authority certificate bundle file. This option may be required when using a private Certificate Authority.
--timezone TIMEZONE Set the effective local timezone to use when uploading data.
-q, --quiet Squelch log messages to the console.
-d, --debug Turn on debug logging.
-v, --verbose Get more detailed output.

* Learn more about how to create this file.

Getting Your API Key

  1. Log in to your Flywheel site via web browser
  2. Click your profile icon in the upper right corner
  3. Select Profile
  4. Navigate to the API Keys section
  5. Click Generate API Key or copy an existing key

For detailed instructions, see Managing API Keys.

Example

fw login my_api_key_here

Output:

You are now logged in as John Doe!

What Happens When You Login

When you run fw login, the CLI:

  1. Validates your API key with the Flywheel site
  2. Stores your credentials securely in your home directory (~/.config/flywheel/user.json)
  3. Uses these credentials for all subsequent CLI commands

Tip

You only need to log in once. The CLI will remember your credentials until you run fw logout or change API keys.


The fw logout Command

Use fw logout to remove your stored API key from the CLI.

Usage

fw logout

Optional Arguments

Optional Argument Description
-h, --help Show help message and exit.

Example

fw logout

What Happens When You Logout

When you run fw logout, the CLI deletes your stored credentials from ~/.config/flywheel/user.json. You will need to run fw login again to use the CLI.

When to Use Logout

  • Switching to a different Flywheel site
  • Switching to a different user account
  • Removing credentials from a shared computer
  • Troubleshooting authentication issues

The fw status Command

Use fw status to check your current authentication status and verify which Flywheel site and user account you're connected to.

Usage

fw status

Optional Arguments

Optional Argument Description
-h, --help Show help message and exit.
-C PATH, --config-file Specify configuration options via config file.*
--no-config Do NOT load the default configuration file.
-y, --yes Assume the answer is yes to all prompts.
--ca-certs CA_CERTS Path to a local Certificate Authority certificate bundle file. This option may be required when using a private Certificate Authority.
--timezone TIMEZONE Set the effective local timezone to use when uploading data.
-q, --quiet Squelch log messages to the console.
-d, --debug Turn on debug logging.
-v, --verbose Get more detailed output.

* Learn more about how to create this file.

Example

fw status

Output when logged in:

You are currently logged in to https://flywheel.example.com as john.doe@example.com

Output when not logged in:

You are not currently logged in

When to Use Status

  • Verify you're connected to the correct Flywheel site
  • Confirm your user identity before running commands
  • Troubleshoot authentication issues
  • Check login status in scripts or automation

Common Workflows

First-Time Setup

1
2
3
4
5
6
7
8
# 1. Login with your API key
fw login <your_api_key>

# 2. Verify your connection
fw status

# 3. Start using the CLI
fw ls

Switching Flywheel Sites

1
2
3
4
5
6
7
8
# 1. Logout from current site
fw logout

# 2. Login to new site with different API key
fw login <different_api_key>

# 3. Verify connection to new site
fw status

Troubleshooting Authentication Issues

If you encounter authentication errors:

  1. Check your current status:

    fw status
    
  2. If needed, logout and login again:

    fw logout
    fw login <your_api_key>
    
  3. Verify your API key is valid and not expired in your Flywheel profile


Common Errors

"You are not currently logged in"

Cause: No valid API key is stored.

Solution: Run fw login <your_api_key> to authenticate.

"Invalid API key"

Cause: The provided API key is incorrect or has been revoked.

Solution:

  • Verify you copied the entire API key correctly
  • Generate a new API key in your Flywheel profile
  • Ensure you're using the API key for the correct Flywheel site

"Connection refused"

Cause: Cannot connect to the Flywheel site.

Solution:

  • Check your internet connection
  • Verify the Flywheel site URL is correct
  • Check if your organization uses a proxy or VPN that may need to be configured