@@ -48,6 +48,7 @@ import { update } from "./commands/update/index.ts";
4848import { isClerkSkillInstalled } from "./lib/skill-detection.ts" ;
4949import { orgsEnable , orgsDisable } from "./commands/orgs/index.ts" ;
5050import { billingEnable , billingDisable } from "./commands/billing/index.ts" ;
51+ import { apiKeysEnable , apiKeysDisable } from "./commands/api-keys/index.ts" ;
5152import { registerExtras } from "@clerk/cli-extras" ;
5253
5354const USER_LIST_ORDER_BY_FIELDS = [
@@ -629,13 +630,17 @@ Give AI agents better Clerk context: install the Clerk skills
629630 description : "Enable organizations with options" ,
630631 } ,
631632 {
632- command : "clerk enable billing --for org " ,
633+ command : "clerk enable billing --for orgs " ,
633634 description : "Enable billing for organizations only" ,
634635 } ,
635636 {
636637 command : "clerk enable billing" ,
637638 description : "Enable billing for organizations and users" ,
638639 } ,
640+ {
641+ command : "clerk enable api-keys" ,
642+ description : "Enable API Keys for users" ,
643+ } ,
639644 ] ) ;
640645
641646 enable
@@ -672,7 +677,7 @@ Give AI agents better Clerk context: install the Clerk skills
672677 . description ( "Enable billing for organizations and/or users" )
673678 . option (
674679 "--for <targets...>" ,
675- "Billing targets (org and/or user ), separated by spaces or commas (e.g. org user ). Defaults to both when omitted." ,
680+ "Billing targets (orgs and/or users ), separated by spaces or commas (e.g. orgs users ). Defaults to both when omitted." ,
676681 )
677682 . option ( "--app <id>" , "Application ID to target" )
678683 . option ( "--instance <id>" , "Instance to target (dev, prod, or instance ID)" )
@@ -685,15 +690,15 @@ Give AI agents better Clerk context: install the Clerk skills
685690 description : "Enable billing for organizations and users" ,
686691 } ,
687692 {
688- command : "clerk enable billing --for org " ,
693+ command : "clerk enable billing --for orgs " ,
689694 description : "Enable billing for organizations only" ,
690695 } ,
691696 {
692- command : "clerk enable billing --for user " ,
697+ command : "clerk enable billing --for users " ,
693698 description : "Enable billing for users only" ,
694699 } ,
695700 {
696- command : "clerk enable billing --for org user " ,
701+ command : "clerk enable billing --for orgs users " ,
697702 description : "Enable billing for both targets" ,
698703 } ,
699704 {
@@ -703,19 +708,55 @@ Give AI agents better Clerk context: install the Clerk skills
703708 ] )
704709 . action ( billingEnable ) ;
705710
711+ enable
712+ . command ( "api-keys" )
713+ . aliases ( [ "apikeys" , "api_keys" ] )
714+ . description ( "Enable API Keys on the linked instance" )
715+ . option (
716+ "--for <targets...>" ,
717+ "API Keys targets (orgs and/or users), separated by spaces or commas (e.g. orgs users). Defaults to users when omitted." ,
718+ )
719+ . option ( "--app <id>" , "Application ID to target" )
720+ . option ( "--instance <id>" , "Instance to target (dev, prod, or instance ID)" )
721+ . option ( "--yes" , "Skip confirmation prompts" )
722+ . option ( "--dry-run" , "Show the patch that would be sent without applying it" )
723+ . setExamples ( [
724+ {
725+ command : "clerk enable api-keys" ,
726+ description : "Enable API Keys for users" ,
727+ } ,
728+ {
729+ command : "clerk enable api-keys --for orgs" ,
730+ description : "Enable API Keys for organizations" ,
731+ } ,
732+ {
733+ command : "clerk enable api-keys --for users orgs" ,
734+ description : "Enable API Keys for users and organizations" ,
735+ } ,
736+ {
737+ command : "clerk enable api-keys --dry-run" ,
738+ description : "Preview the patch without applying it" ,
739+ } ,
740+ ] )
741+ . action ( apiKeysEnable ) ;
742+
706743 const disable = program
707744 . command ( "disable" )
708745 . description ( "Disable Clerk features on the linked instance" )
709746 . setExamples ( [
710747 { command : "clerk disable orgs" , description : "Disable organizations" } ,
711748 {
712- command : "clerk disable billing --for org " ,
749+ command : "clerk disable billing --for orgs " ,
713750 description : "Disable billing for organizations only (leaves organizations enabled)" ,
714751 } ,
715752 {
716753 command : "clerk disable billing" ,
717754 description : "Disable billing for organizations and users" ,
718755 } ,
756+ {
757+ command : "clerk disable api-keys" ,
758+ description : "Disable API Keys" ,
759+ } ,
719760 ] ) ;
720761
721762 disable
@@ -742,7 +783,7 @@ Give AI agents better Clerk context: install the Clerk skills
742783 )
743784 . option (
744785 "--for <targets...>" ,
745- "Billing targets (org and/or user ), separated by spaces or commas (e.g. org user ). Defaults to both when omitted." ,
786+ "Billing targets (orgs and/or users ), separated by spaces or commas (e.g. orgs users ). Defaults to both when omitted." ,
746787 )
747788 . option ( "--app <id>" , "Application ID to target" )
748789 . option ( "--instance <id>" , "Instance to target (dev, prod, or instance ID)" )
@@ -754,16 +795,44 @@ Give AI agents better Clerk context: install the Clerk skills
754795 description : "Disable billing for organizations and users" ,
755796 } ,
756797 {
757- command : "clerk disable billing --for org " ,
798+ command : "clerk disable billing --for orgs " ,
758799 description : "Disable billing for organizations only" ,
759800 } ,
760801 {
761- command : "clerk disable billing --for user " ,
802+ command : "clerk disable billing --for users " ,
762803 description : "Disable billing for users only" ,
763804 } ,
764805 ] )
765806 . action ( billingDisable ) ;
766807
808+ disable
809+ . command ( "api-keys" )
810+ . aliases ( [ "apikeys" , "api_keys" ] )
811+ . description ( "Disable API Keys on the linked instance" )
812+ . option (
813+ "--for <targets...>" ,
814+ "API Keys targets (orgs and/or users), separated by spaces or commas (e.g. orgs users). Omit to disable API Keys entirely." ,
815+ )
816+ . option ( "--app <id>" , "Application ID to target" )
817+ . option ( "--instance <id>" , "Instance to target (dev, prod, or instance ID)" )
818+ . option ( "--yes" , "Skip confirmation prompts" )
819+ . option ( "--dry-run" , "Show the patch that would be sent without applying it" )
820+ . setExamples ( [
821+ {
822+ command : "clerk disable api-keys" ,
823+ description : "Disable API Keys entirely" ,
824+ } ,
825+ {
826+ command : "clerk disable api-keys --for orgs" ,
827+ description : "Disable API Keys for organizations only" ,
828+ } ,
829+ {
830+ command : "clerk disable api-keys --for users" ,
831+ description : "Disable API Keys for users only" ,
832+ } ,
833+ ] )
834+ . action ( apiKeysDisable ) ;
835+
767836 program
768837 . command ( "api" )
769838 . description ( "Make authenticated requests to the Clerk API" )
0 commit comments