Skip to content

flagsmith segment create

Create a segment

flagsmith segment create <name> [flags]

Examples

  # rules from a file, - for stdin, or an inline JSON string
  flagsmith segment create beta-users --rules @rules.json --description "Beta cohort"

  # scope it to a feature (feature-specific segment)
  flagsmith segment create rollout --rules @rules.json --feature onboarding

Options

      --description string   segment description
      --feature string       scope to a feature (id or name), making it feature-specific
  -h, --help                 help for create
      --rules string         rule tree: @file, - for stdin, or an inline JSON string

Options inherited from parent commands

      --api-url string        Flagsmith API base URL (env: FLAGSMITH_API_URL) (default "https://api.flagsmith.com")
  -c, --config-path string    path to flagsmith.json (env: FLAGSMITH_CONFIG_PATH)
  -e, --environment string    environment as its client-side SDK key (env: FLAGSMITH_ENVIRONMENT)
      --jq string             filter JSON output through a jq expression (implies --json)
      --json                  output JSON instead of human-readable text (env: FLAGSMITH_JSON_OUTPUT)
      --no-input              never prompt or open a browser; fail if required input is missing (env: FLAGSMITH_NO_INPUT)
      --organisation string   organisation ID or name (env: FLAGSMITH_ORGANISATION)
  -p, --project string        project ID or name (env: FLAGSMITH_PROJECT)
      --sdk-api-url string    SDK API base URL for flag evaluation (env: FLAGSMITH_SDK_API_URL)
      --yes                   answer confirmations affirmatively

SEE ALSO