Overview
List all active workspace tokens for the current workspace. This command shows token metadata including JWT ID (JTI), creation time, expiration, and indicates which token is currently being used.Syntax
Options
Output format for the token listDefault:
Options:
table
Options:
table
, json
Include expired tokens in the listDefault:
Use case: Audit token usage history
false
Use case: Audit token usage history
Examples
List Active Tokens
Include Expired Tokens
JSON Output
Understanding Token Information
Table Columns
Column | Description |
---|---|
JTI | JWT ID - unique identifier for the token |
Created | When the token was created |
Expires | When the token expires (“Never” for non-expiring tokens) |
Current | ✓ indicates the token currently stored locally |
Status | Active, Expired, or Revoked (when --show-expired is used) |
Token States
- Active: Token is valid and can be used
- Expired: Token has passed its expiration date
- Current: Token currently stored in local configuration
Token Management Workflow
Audit Token Usage
Clean Up Old Tokens
Monitor Token Expiration
Security Considerations
Token Rotation: Regularly review and revoke unused tokens to maintain security.
Multiple Active Tokens: Multiple tokens can be active simultaneously. Revoke unused tokens to reduce attack surface.
Best Practices
- Regular Audits: Review token list monthly to identify unused tokens
- Token Naming: Use meaningful JTI patterns if creating tokens programmatically
- Expiration Monitoring: Set up alerts for tokens nearing expiration
- Immediate Revocation: Revoke tokens immediately when no longer needed
Error Handling
Authentication Required
Authentication Required
Error:
Authentication required. Try running ntcli token refresh
Solution: You need a valid workspace token to list tokens:Workspace Not Selected
Workspace Not Selected
Error:
No workspace selected
Solution: Select a workspace first:No Tokens Found
No Tokens Found
Output: Empty token listSolution: Create a token first: