@@ -68,6 +68,7 @@ def init_config(
6868 cpanel_token : str | None = typer .Option (None , "--cpanel-token" , help = "cPanel API token (if using token auth)." ),
6969 cpanel_password : str | None = typer .Option (None , "--cpanel-password" , help = "cPanel password (if using password auth)." ),
7070 use_password : bool = typer .Option (False , "--password" , "-p" , help = "Use password instead of API token." ),
71+ domain : str | None = typer .Option (None , "--domain" , "-d" , help = "Limit operations to this domain only." ),
7172 default_ttl : int | None = typer .Option (None , "--default-ttl" , help = "Default TTL to write into the env file." ),
7273 audit_log_path : str | None = typer .Option (
7374 None ,
@@ -147,6 +148,16 @@ def action(app_context):
147148 ui .console .print ("[dim] Security > Manage API Tokens > Create[/]\n " )
148149 secret = secret or questionary .password ("cPanel API token" ).ask ()
149150
151+ # Ask for domain restriction
152+ if not domain :
153+ ui .console .print ("\n [dim]Limit operations to a single domain (optional):[/]" )
154+ domain_input = questionary .text (
155+ "Default domain" ,
156+ instruction = "(leave empty for all domains)"
157+ ).ask ()
158+ if domain_input :
159+ domain = domain_input .strip ().lower ()
160+
150161 host = host .strip () if host else None
151162 user = user .strip () if user else None
152163 secret = secret .strip () if secret else None
@@ -175,6 +186,7 @@ def action(app_context):
175186 cpanel_user = user ,
176187 cpanel_token = secret ,
177188 auth_method = auth_method ,
189+ default_domain = domain or None ,
178190 port = current .port ,
179191 timeout_seconds = current .timeout_seconds ,
180192 default_ttl = ttl ,
0 commit comments