init tenant
nexler init tenant
local only
Adds a guarded tenantorg listing/delete admin API to an existing app, for a hub (or similar) app to manage tenants: tenant/tenant.go (TenantOrg{ID, Name, Settings, Status, CreatedAt, UpdatedAt} — Settings is a free-form organization configuration blob; ListTenantOrgs/DeleteTenantOrg only, no generated create/update path yet) and handlers/admin/tenants/tenants.go (GET /admin/tenants, DELETE /admin/tenants/{id}), wired into routes/protected/protected.go automatically. Not the same thing as the -multitenant flag (see create app) — that threads a tenant Org through auth context; this is the actual store of tenant-organization records a hub app manages, and the two are independent.
Deliberately not part of core/ — whether an app has a multi-tenant model at all is provider/business-specific, not something every -db app needs — so this is its own opt-in init command, same shape as init kgate/init kpass. Requires the app to already have a core database connection (-db at create app time) and a JWT-capable -auth choice (jwt or both) — the delete endpoint needs an authenticated caller to gate at all. Both routes go through the Task Registry's middleware.RegisterTask — authenticated, not authorized, until nexler init kpass wires a real permission check. DeleteTenantOrg is a real, hard delete — no undo.
nexler init tenant -dir ./myapp
nexler init db -dir ./myapp # provisions tenant_orgs on a SQL core; Mongo needs none