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
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
- Log in to your Flywheel site via web browser
- Click your profile icon in the upper right corner
- Select Profile
- Navigate to the API Keys section
- Click Generate API Key or copy an existing key
For detailed instructions, see Managing API Keys.
Example
Output:
What Happens When You Login
When you run fw login, the CLI:
- Validates your API key with the Flywheel site
- Stores your credentials securely in your home directory (
~/.config/flywheel/user.json) - 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
Optional Arguments
| Optional Argument | Description |
|---|---|
-h, --help | Show help message and exit. |
Example
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
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
Output when logged in:
Output when not 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
Switching Flywheel Sites
Troubleshooting Authentication Issues
If you encounter authentication errors:
-
Check your current status:
-
If needed, logout and login again:
-
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