Authentication and Profiles
Managing authentication and profiles in the Kodexa CLI
The Kodexa CLI uses profiles to manage connections to different Kodexa platform instances. This page explains how to authenticate with the platform and manage your profiles.
Logging In
To authenticate with a Kodexa platform instance, use the login
command:
You’ll be prompted to enter:
- The URL of the Kodexa platform instance
- Your access token for authentication
- A profile name (defaults to “default”)
You can also provide these directly in the command:
Profile Management
Profiles allow you to manage connections to multiple Kodexa platform instances. Each profile stores a URL and access token for a specific instance.
Creating Profiles
When you log in, you automatically create a profile. You can specify a profile name during login:
If you don’t specify a profile name, it defaults to “default”.
You can create multiple profiles for different environments:
Viewing Profiles
To list all available profiles:
This shows all configured profiles and their associated URLs:
The profile with an asterisk (*) is the currently active profile.
Checking Current Profile
To check which profile is currently active:
This displays information about the current profile:
Switching Profiles
To switch to a different profile:
Replace prod
with the name of the profile you want to use.
After switching, you can verify the change:
Deleting Profiles
To delete a profile when you no longer need it:
You’ll be prompted to confirm the deletion:
Profile Configuration File
Profiles are stored in a configuration file on your system. The location depends on your operating system:
- macOS:
~/Library/Application Support/kodexa-cli/profiles.json
- Linux:
~/.local/share/kodexa-cli/profiles.json
- Windows:
C:\Documents and Settings\{User}\Application Data\Local Settings\kodexa\kodexa-cli\profiles.json
Platform Information
To verify your connection and view information about the platform you’re connected to:
This displays details about the Kodexa platform instance you’re currently connected to.
To see detailed information, add the verbose flag:
Token Storage
Your authentication tokens are securely stored in your system:
- macOS:
~/Library/Application Support/kodexa-cli
- Linux:
~/.local/share/kodexa-cli
- Windows:
C:\Documents and Settings\{User}\Application Data\Local Settings\kodexa\kodexa-cli
orC:\Documents and Settings\{User}\Application Data\kodexa\kodexa-cli
Environment Variable Authentication
You can also authenticate using environment variables:
When set, these environment variables take precedence over profile settings.
Global Options
Most Kodexa CLI commands accept the following authentication-related options:
These options override the active profile settings for individual commands.
Best Practices
- Use different profiles for different environments (development, production, etc.)
- Avoid storing tokens in scripts or sharing them with others
- Regularly rotate your access tokens for security
- Use the
--profile
option for one-off commands instead of switching profiles