Skip to content

Bug report: Cannot provide value for the missing parameter #6518

@MartinM85

Description

@MartinM85

Priority

(Low) Something is a little off

Description

Let's say I have a command with one boolean parameter

const options = globalOptionsZod
  .extend({
    enabled: zod.alias('e', z.boolean())
  })
  .strict();

When running the command without the parameter, CLI asks me to provide a value for the parameter

🌶️  Provide values for the following parameters:
√ enabled:  1

But it doesn't accept any value like 0, 1, true, or false and it fails with the error

Error: enabled: Expected boolean, received string

Steps to reproduce

Define zod schema with one boolean parameter for a command and try to run execute the command without the parameter.

Expected results

CLI accepts provided value for missing parameter.

Actual results

Error: enabled: Expected boolean, received string

Diagnostics

No response

CLI for Microsoft 365 version

v10.2.0

nodejs version

v20.8.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions