HelloJohn / docs
hjctl CLI

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

CommandDescription
hj tenants listList all tenants
hj tenants createCreate a new tenant
hj tenants getGet tenant details
hj tenants updateUpdate tenant settings
hj tenants deleteDelete a tenant
hj tenants useSet the active tenant for subsequent commands
hj tenants api-keysManage tenant API keys

hj tenants list

List all tenants in your account:

hj tenants list
ID                        NAME             PLAN       CREATED
tnt_01HABCDEF654321       Production        pro        2024-01-15
tnt_01HABCDEF123456       Staging           free       2024-03-01
tnt_01HABCDEF789012       Development       free       2024-03-20

Flags:

FlagDescription
--format jsonOutput as JSON
--format tableOutput as table (default)

hj tenants create

Create a new tenant:

hj tenants create --name "My App Production" --plan pro

Flags:

FlagRequiredDescription
--nameTenant display name
--planNoPlan: free, pro, enterprise (default: free)
--regionNoData 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_01HABCDEF654321

Omit the ID to get the currently active tenant:

hj tenants get

Output 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:

FlagDescription
--nameNew display name
--add-originAdd an allowed origin (repeatable)
--remove-originRemove an allowed origin (repeatable)
--session-ttlAccess token TTL in seconds (e.g., 900)
--refresh-ttlRefresh token TTL in seconds (e.g., 604800)

hj tenants delete

Delete a tenant and all its data:

hj tenants delete tnt_01HABCDEF654321

This requires confirmation:

⚠️  This will permanently delete tenant "Staging" and all its data (3,421 users, 12,040 sessions).
Type the tenant name to confirm: Staging

This 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 --clear

hj tenants api-keys

Manage API keys for a tenant.

List keys:

hj tenants api-keys list
ID                    NAME              TYPE    CREATED
key_01HABCDEF001      Default           live    2024-01-15
key_01HABCDEF002      CI/CD             live    2024-03-01
key_01HABCDEF003      Dev               test    2024-03-20

Create a key:

hj tenants api-keys create --name "CI/CD Pipeline" --type live

Revoke a key:

hj tenants api-keys revoke key_01HABCDEF002

Global Flags

All hj tenants commands support:

FlagDescription
--tenant <id>Override active tenant
--api-key <key>API key to use (overrides stored key)
--format json|tableOutput format

On this page