Skip to content

Support multi-value options in the CLI #1400

Description

@DaveHanns

Problem

The CLI has no consistent, framework-level way to accept multiple values for a single flag. The command framework rejects a repeated flag (src/lib/command-framework/apify-command.ts), and there is no built-in comma-separated handling. This blocks flags that mirror API filters typed as string[], for example apify runs ls --status, where the API accepts several statuses.

Goal

Add a framework-wide, opt-in way to declare a flag as multi-value (in the spirit of enableJsonFlag), so commands accept several values consistently.

Convention to decide

Pick one, or support both as gh does:

  • Comma-separated: --status a,b
  • Repeated flag: --status a --status b

Notes

  • Only a couple of flags need this today; the first consumer is apify runs ls --status. The API also supports startedAfter and startedBefore, so runs ls could reach parity.
  • Existing single-value flags must keep working unchanged.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.t-buildersIssues owned by the Builders team.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions