Keycloak authentication and resource management CLI for ITlusions
# Install
pip install itlc
# Setup OIDC authentication for kubectl
itlc configure oidc
# Interactive login
itlc login
# Check current user
itlc whoami
# Get service account token
itlc get-token --client-id=my-app --client-secret=secret- Interactive Authentication - Browser-based OAuth login (Azure CLI-style)
- Token Management - Automatic caching and refresh
- Realm Management - Multi-tenant realm switching
- Core Resource Management - Tenants, subscriptions, resource groups, management groups, locations
- Kubernetes Integration - OIDC authentication for kubectl
- Service Accounts - CI/CD automation support
- Cluster Management - Register and manage Kubernetes clusters
git clone https://github.com/ITlusions/ITL.ControlPlane.Cli.git
cd ITL.ControlPlane.Cli
pip install -e .pip install itlcπ Complete documentation is available in the docs/ folder:
- Getting Started - Installation and setup
- Authentication - Login, tokens, and realms
- Kubernetes Integration - OIDC setup and kubectl
- Core Resources - Tenants, subscriptions, resource groups via API Gateway
- Resource Management - Control Plane resources (legacy)
- Architecture - Design and security
- Examples - Configuration examples
- Scripts - Automation scripts
- Archive - Additional guides and references
export KEYCLOAK_URL=https://sts.itlusions.com # Keycloak server
export KEYCLOAK_REALM=itlusions # Keycloak realm
export KEYCLOAK_CLIENT_ID=my-app # Service account client ID
export KEYCLOAK_CLIENT_SECRET=secret # Service account secret
export CONTROLPLANE_URL=http://localhost:8000 # Control Plane API (direct)
export CONTROLPLANE_GATEWAY_URL=https://api.itlusions.com # API Gateway# Interactive login
itlc login
# Check current user
itlc whoami
# Logout
itlc logout# Get access token
itlc get-token
# Inspect JWT token
itlc inspect <token> --decode
# List cached tokens
itlc cache-list
# Clear cache
itlc clear-cache --all# List available realms
itlc realm list
# Switch realm
itlc realm set production
# Show realm info
itlc realm info# Create tenant
itlc tenant create my-tenant --display-name "My Tenant" --domain mycompany.com
# List tenants
itlc tenant list
# Create subscription
itlc subscription create my-sub --display-name "My Subscription" --tenant-id my-tenant
# List subscriptions
itlc subscription list
# Create resource group
itlc resourcegroup create my-rg my-sub --location westeurope
# Create management group hierarchy
itlc managementgroup create root-mg --display-name "Organization Root"
itlc managementgroup create platform-mg --display-name "Platform" --parent-id root-mg
# List management groups
itlc managementgroup list
# List locations
itlc location list
# Create custom location
itlc location create my-datacenter --display-name "My Datacenter" --region "Netherlands" --location-type DataCenter# Setup OIDC authentication
itlc configure oidc
# List registered clusters
itlc cluster list
# Add cluster
itlc cluster add --name k8s-prod --server https://api.k8s.example.com
# Use with kubectl
kubectl --context=k8s-prod get nodes# Clone repository
git clone https://github.com/ITlusions/ITLAuth.git
cd ITLAuth
# Install in development mode
pip install -e .
# Run tests
pytest
# Run specific test
python -m unittest tests.test_basicITL.ControlPlane.Cli/
βββ src/itlc/ # Main CLI package
β βββ __main__.py # CLI entry point
β βββ keycloak_client.py # Keycloak integration
β βββ interactive_auth.py# Browser-based login
β βββ token_cache.py # Token caching
β βββ controlplane_client.py # Control Plane API
β βββ core_commands.py # Core resource commands
β βββ ... # Other modules
βββ docs/ # Documentation
βββ tests/ # Test suite
βββ pyproject.toml # Package configuration
βββ setup.py # Setup script
βββ README.md # This file
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs/
- Repository: https://github.com/ITlusions/ITL.ControlPlane.Cli
- Issues: https://github.com/ITlusions/ITL.ControlPlane.Cli/issues
- ITlusions: https://www.itlusions.com
Made by ITlusions - Kubernetes β’ OIDC β’ Keycloak β’ Enterprise Auth