Overview

Follow these best practices to use ntcli effectively and securely in production environments.

Workspace Organization

Environment-Based Separation

# Separate workspaces for each environment
ntcli workspace create my-app-dev
ntcli workspace create my-app-staging  
ntcli workspace create my-app-prod

Naming Conventions

  • Use descriptive names: data-pipeline-prod not prod1
  • Include environment: my-app-dev, my-app-prod
  • Keep names short (≤20 characters)

Security Best Practices

Token Management

# Rotate tokens regularly
ntcli token refresh

# Create new tokens
ntcli token create

# Revoke unused tokens
ntcli token list
ntcli token revoke my-jti

Secret Management

# Never commit secrets to version control
echo "*.env" >> .gitignore

# Use workspace-specific secrets
ntcli workspace switch prod
ntcli secrets set API_KEY=$PROD_API_KEY