Auth Command

Manage authentication credentials for Kodezi CLI including login, status checks, logout, and storage details.

The auth command handles all authentication operations for Kodezi CLI, including logging in, checking token validity, and securely removing stored credentials.

Authentication is required to unlock:

  • AI model access
  • Usage limits & billing sync
  • Saved session history
  • Project preferences
  • MCP/LSP initialization

If you try to use the CLI without authentication, you will be prompted automatically.

Usage

kodezi auth [subcommand]

Available subcommands:

  • login : Authenticate with email + token
  • status : Check authentication and token validity
  • logout : Clear stored credentials

Subcommands

Login

Authenticate your CLI using your Kodezi email and API token

Command:

kodezi auth login

This opens an interactive prompt.

Interactive flow:

Kodezi CLI Authentication
========================

Enter your Kodezi email: user@example.com
Enter your Kodezi token: ********************************

Validating credentials...

[OK] Successfully authenticated!
[OK] Email: user@example.com
[OK] Credentials saved to: ~/.kodezi-cli

Where to get your token?

  1. Go to https://kodezi.com
  2. Sign in
  3. Navigate to: Settings → Developer → API Tokens
  4. Click Generate Token
  5. Copy and paste it in the CLI prompt

The token input is masked for security. Credentials are validated before being saved.

Keep Your Token Secure

Your API token gives full access to your AI resources. Never commit it to Git, share it, or expose it publicly.

Status

Check your current authentication status and validate token:

Command:

kodezi auth status

When authenticated:

Authentication Status
=====================

Email: user@example.com
Token: abcd123456...wxyz (64 chars)
Last Verified: 2 hours ago

Validating token...
[OK] Token is valid

When not authenticated:

[X] Not authenticated

Run 'kodezi auth login' to authenticate

When token is invalid or expired

Authentication Status
=====================

Email: user@example.com
Token: ***************
[ERROR] Token is invalid or expired

Run: kodezi auth login

Logout

Remove your stored credentials:

kodezi auth logout

Output:

[OK] Successfully logged out
[OK] Credentials removed from configuration

This does not delete your account, only local CLI credentials.

Storage Location

Kodezi CLI uses a secure configuration directory to store your login information.

config.json
credentials.json

You can view the path using:

kodezi dirs

Global Flags

Global CLI flags also work with auth commands.

# Use custom data directory
kodezi --data-dir /path/to/dir auth login
# Run in a different working directory
kodezi --cwd /project auth status
# Debug authentication
kodezi -d auth login

See kodezi --help for all global flags.

Related Topics