Login Command
The login
command authenticates you with Codegen’s services, enabling access to AI features and private codemods.
Usage
Options
--token <token>
: Directly provide an authentication token instead of using browser-based authentication
Authentication Flow
-
Browser Authentication (Default):
This will:
- Open your default browser
- Direct you to the Codegen authentication page
- Automatically complete authentication when you log in
-
Token Authentication:
Useful for:
- CI/CD environments
- Machines without browsers
- Automated scripts
Validation
After logging in, Codegen will:
- Validate your credentials
- Store the authentication token securely
- Configure your environment for subsequent commands
Environment Variables
CODEGEN_TOKEN
: Alternative way to provide authentication tokenENV
: Set toprod
orstaging
to specify environment
Examples
Common Issues
-
Browser doesn’t open:
- Use the
--token
option instead - Check your default browser settings
- Use the
-
Token expired:
- Simply run
codegen login
again - New token will replace the old one
- Simply run
-
Permission issues:
- Ensure you have the correct permissions
- Contact support if problems persist
Your authentication token is stored securely in your system’s credential storage.
Never share your authentication token or commit it to version control.
Was this page helpful?