@@ -21,6 +21,7 @@ import (
2121 "time"
2222 "unicode"
2323
24+ "github.com/slackapi/slack-cli/internal/iostreams"
2425 "github.com/slackapi/slack-cli/internal/shared"
2526 "github.com/slackapi/slack-cli/internal/slackerror"
2627 "github.com/slackapi/slack-cli/internal/style"
@@ -98,13 +99,6 @@ func NewCreateCommand(clients *shared.ClientFactory) *cobra.Command {
9899 // If one's developer account is managed by multiple Production Slack teams, one of those team IDs must be provided in the command
99100 cmd .Flags ().StringVar (& createCmdFlags .owningOrgID , "owning-org-id" , "" , "Enterprise team ID that manages your developer account, if applicable" )
100101
101- if err := cmd .MarkFlagRequired ("name" ); err != nil {
102- panic (err )
103- }
104- if err := cmd .MarkFlagRequired ("password" ); err != nil {
105- panic (err )
106- }
107-
108102 return cmd
109103}
110104
@@ -116,6 +110,36 @@ func runCreateCommand(cmd *cobra.Command, clients *shared.ClientFactory) error {
116110 return err
117111 }
118112
113+ name := createCmdFlags .name
114+ if name == "" {
115+ name , err = clients .IO .InputPrompt (
116+ ctx ,
117+ "Enter a name for the sandbox" ,
118+ iostreams.InputPromptConfig {
119+ Required : true ,
120+ },
121+ )
122+ if err != nil {
123+ return err
124+ }
125+ }
126+ createCmdFlags .name = name
127+
128+ password := createCmdFlags .password
129+ if password == "" {
130+ password , err = clients .IO .InputPrompt (
131+ ctx ,
132+ "Enter a password for the sandbox" ,
133+ iostreams.InputPromptConfig {
134+ Required : true ,
135+ },
136+ )
137+ if err != nil {
138+ return err
139+ }
140+ }
141+ createCmdFlags .password = password
142+
119143 domain := createCmdFlags .domain
120144 if domain == "" {
121145 var err error
@@ -170,7 +194,6 @@ func runCreateCommand(cmd *cobra.Command, clients *shared.ClientFactory) error {
170194
171195// getEpochFromTTL parses a time-to-live string (e.g., "1d", "2w", "3mo") and returns the Unix epoch
172196// when the sandbox will be archived. Supports days (d), weeks (w), and months (mo).
173- // Minimum is 1 day, maximum is 6 months.
174197func getEpochFromTTL (ttl string ) (int64 , error ) {
175198 lower := strings .TrimSpace (strings .ToLower (ttl ))
176199 if lower == "" {
@@ -206,7 +229,7 @@ func getEpochFromTTL(ttl string) (int64, error) {
206229 return target .Unix (), nil
207230}
208231
209- // getEpochFromDate parses a date in yyyy-mm-dd format and returns the Unix epoch at start of that day (UTC).
232+ // getEpochFromDate parses a date in yyyy-mm-dd format and returns the Unix epoch at the start of that day (UTC)
210233func getEpochFromDate (dateStr string ) (int64 , error ) {
211234 dateFormat := "2006-01-02"
212235 t , err := time .ParseInLocation (dateFormat , dateStr , time .UTC )
0 commit comments