diff --git a/internal/cli/api.go b/internal/cli/api.go index bce5efc11..94be6f987 100644 --- a/internal/cli/api.go +++ b/internal/cli/api.go @@ -72,7 +72,7 @@ func apiCmd(cli *cli) *cobra.Command { cmd := &cobra.Command{ Use: "api ", - Args: cobra.RangeArgs(1, 2), + Args: cobra.RangeArgs(0, 2), Short: "Makes an authenticated HTTP request to the Auth0 Management API", Long: fmt.Sprintf( `Makes an authenticated HTTP request to the [Auth0 Management API](%s) and returns the response as JSON. @@ -117,6 +117,10 @@ func apiUsageTemplate() string { func apiCmdRun(cli *cli, inputs *apiCmdInputs) func(cmd *cobra.Command, args []string) error { return func(cmd *cobra.Command, args []string) error { + if len(args) == 0 { + return cmd.Help() + } + if err := inputs.fromArgs(args, cli.tenant); err != nil { return fmt.Errorf("failed to parse command inputs: %w", err) }