Skip to content

fix: add missing CLI options for non-interactive create commands#53

Open
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:fix/non-interactive-create-commands
Open

fix: add missing CLI options for non-interactive create commands#53
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:fix/non-interactive-create-commands

Conversation

@JoshSalway
Copy link

Summary

Closes #47

This PR adds the missing CLI options and nonInteractively() fallbacks to three create commands so they can be used in scripts and CI pipelines without interactive prompts.

This PR requires design decisions from maintainers — see questions below.

Changes

instance:create — 4 new options added

Option Default (non-interactive) Notes
--scaling-type= custom Is custom the right default? Interactively, the confirm prompt defaults to true (autoscaling enabled = custom). Should the non-interactive default match, or should it be none?
--scaling-cpu-threshold-percentage= 50 Matches the interactive default
--scaling-memory-threshold-percentage= 50 Matches the interactive default
--uses-scheduler= false Matches the interactive default

Also added nonInteractively() fallbacks to existing fields that were missing them:

  • size — no default (remains required via --size)
  • min_replicas — defaults to 1
  • max_replicas — defaults to min_replicas value
  • scaling_type — defaults to custom

websocket-cluster:create — 1 new option added

Option Default (non-interactive) Notes
--max-connections= 100 Matches WebsocketServerMaxConnection::ONE_HUNDRED. Is 100 the right default for non-interactive use?

Also added nonInteractively() fallback to region (falls back to the --region value or $defaults['region']).

websocket-application:create — 3 new options added

Option Default (non-interactive) Notes
--allowed-origins= null (none) Accepts comma-separated values. Should the default be empty (allow all), or should origins be required?
--ping-interval= 60 Matches the interactive default
--activity-timeout= 30 Matches the interactive default

Also updated allowed origins parsing in CreatesWebSocketApplication to support comma-separated input (in addition to newline-separated from the interactive textarea).

Questions for maintainers

  1. Should these commands support full non-interactive mode, or is interactive-only intentional for these resource types?
  2. For instance:create --scaling-type: is custom (autoscaling enabled) the correct non-interactive default?
  3. For websocket-cluster:create --max-connections: is 100 the correct non-interactive default?
  4. For websocket-application:create --allowed-origins: should the default be null (no restriction), or should origins be required in non-interactive mode?

Test plan

  • phpstan analyse passes with no errors
  • All existing tests pass (31/31)
  • Manual test: cloud instance:create <env-id> --name=test --size=compute-optimized-256 --no-interaction
  • Manual test: cloud websocket-cluster:create --name=test --region=us-east-1 --max-connections=100 --no-interaction
  • Manual test: cloud websocket-application:create <cluster-id> --name=test --no-interaction

🤖 Generated with Claude Code

Adds CLI options and nonInteractively() fallbacks to InstanceCreate,
WebsocketClusterCreate, and WebsocketApplicationCreate so they can be
used in scripts and CI pipelines without interactive prompts.

Closes laravel#47

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoshSalway

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: InstanceCreate, WebsocketClusterCreate, WebsocketApplicationCreate cannot be used non-interactively

1 participant