hj tenants
Manage HelloJohn tenants from the command line — create, list, update, and switch between tenants with hjctl.
hj tenants
The hj tenants command group manages HelloJohn tenants. Tenants are isolated environments with their own users, configuration, and API keys.
Commands
| Command | Description |
|---|---|
hj tenants list | List all tenants |
hj tenants create | Create a new tenant |
hj tenants get | Get tenant details |
hj tenants update | Update tenant settings |
hj tenants delete | Delete a tenant |
hj tenants use | Set the active tenant for subsequent commands |
hj tenants api-keys | Manage tenant API keys |
hj tenants list
List all tenants in your account:
hj tenants listID NAME PLAN CREATED
tnt_01HABCDEF654321 Production pro 2024-01-15
tnt_01HABCDEF123456 Staging free 2024-03-01
tnt_01HABCDEF789012 Development free 2024-03-20Flags:
| Flag | Description |
|---|---|
--format json | Output as JSON |
--format table | Output as table (default) |
hj tenants create
Create a new tenant:
hj tenants create --name "My App Production" --plan proFlags:
| Flag | Required | Description |
|---|---|---|
--name | ✅ | Tenant display name |
--plan | No | Plan: free, pro, enterprise (default: free) |
--region | No | Data region: us-east-1, eu-west-1 (default: us-east-1) |
Output:
{
"id": "tnt_01HABCDEF654321",
"name": "My App Production",
"plan": "pro",
"created_at": "2024-06-01T10:00:00Z",
"api_key": "sk_live_abc123...",
"public_key": "pk_live_xyz789..."
}The API key and public key are shown once. Store the API key securely — it cannot be retrieved again.
hj tenants get
Get details for a specific tenant:
hj tenants get tnt_01HABCDEF654321Omit the ID to get the currently active tenant:
hj tenants getOutput includes: ID, name, plan, allowed origins, OAuth providers, MFA settings, user count.
hj tenants update
Update tenant settings:
# Update display name
hj tenants update tnt_01HABCDEF654321 --name "Production v2"
# Add allowed origins
hj tenants update tnt_01HABCDEF654321 \
--add-origin "https://app.example.com" \
--add-origin "https://www.example.com"
# Remove an allowed origin
hj tenants update tnt_01HABCDEF654321 \
--remove-origin "https://old.example.com"Flags:
| Flag | Description |
|---|---|
--name | New display name |
--add-origin | Add an allowed origin (repeatable) |
--remove-origin | Remove an allowed origin (repeatable) |
--session-ttl | Access token TTL in seconds (e.g., 900) |
--refresh-ttl | Refresh token TTL in seconds (e.g., 604800) |
hj tenants delete
Delete a tenant and all its data:
hj tenants delete tnt_01HABCDEF654321This requires confirmation:
⚠️ This will permanently delete tenant "Staging" and all its data (3,421 users, 12,040 sessions).
Type the tenant name to confirm: StagingThis action is irreversible. All users, sessions, MFA factors, and configuration will be deleted.
hj tenants use
Set the active tenant context for all subsequent commands:
hj tenants use tnt_01HABCDEF654321✅ Active tenant set to: Production (tnt_01HABCDEF654321)The active tenant is stored in ~/.hj/config.json. Commands that require a tenant ID use this value unless --tenant is explicitly passed.
To clear the active tenant:
hj tenants use --clearhj tenants api-keys
Manage API keys for a tenant.
List keys:
hj tenants api-keys listID NAME TYPE CREATED
key_01HABCDEF001 Default live 2024-01-15
key_01HABCDEF002 CI/CD live 2024-03-01
key_01HABCDEF003 Dev test 2024-03-20Create a key:
hj tenants api-keys create --name "CI/CD Pipeline" --type liveRevoke a key:
hj tenants api-keys revoke key_01HABCDEF002Global Flags
All hj tenants commands support:
| Flag | Description |
|---|---|
--tenant <id> | Override active tenant |
--api-key <key> | API key to use (overrides stored key) |
--format json|table | Output format |