Overview
Generate a new workspace token for the current workspace without storing it locally. This command is useful for creating tokens for CI/CD systems, scripts, or other automation tools.Syntax
Options
Token expiration time in secondsDefault:
Example:
31536000 (1 year)Example:
86400 (24 hours)Output format for the tokenDefault:
Options:
textOptions:
text, jsonExamples
Create Standard Token
Create Short-Lived Token
Create Non-Expiring Token
JSON Output
Security Considerations
Best Practices
- Copy Immediately: Copy the token immediately as it cannot be retrieved again
- Secure Storage: Store tokens in secure credential management systems
- Regular Rotation: Rotate tokens regularly using
ntcli token refresh - Scope Limitation: Use workspace-specific tokens rather than global tokens
CI/CD Integration
GitHub Actions
Script Usage
Error Handling
Authentication Required
Authentication Required
Error:
Authentication required. Try running ntcli token refreshSolution: Ensure you have a valid workspace token:Workspace Not Selected
Workspace Not Selected
Error:
No workspace selectedSolution: Select a workspace first:Invalid Expiration
Invalid Expiration
Error:
Invalid expiration timeSolution: Use a valid expiration time in seconds: