Skip to content

flagsmith evaluate

Show the flags an SDK resolves for the current environment

flagsmith evaluate [feature] [flags]

Examples

  # the flags a fresh SDK sees
  flagsmith evaluate

  # resolved for one user: segment overrides applied, variants allocated
  flagsmith evaluate --identity user-123

  # a what-if: overlay traits without persisting the identity
  flagsmith evaluate --identity user-123 --trait plan=premium --trait age=42

  # one feature, for scripting
  flagsmith eval onboarding --identity user-123 --jq .value

  # bootstrap a frontend SDK (can be provided as state)
  flagsmith eval --js > state.json

  # gate a script on a flag: a disabled flag fails
  flagsmith eval new-pipeline --test && ./deploy.sh

Options

  -h, --help                help for evaluate
  -i, --identity string     resolve for this identifier
      --js                  output the state a Flagsmith frontend SDK hydrates from
      --persist             persist the identity and its traits instead of evaluating transiently
      --test                with a named feature: fail when the flag is disabled
      --trait stringArray   trait key=value to evaluate with (repeatable)

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

  • flagsmith - The Flagsmith command-line interface