launchdarkly / ldcli

The official command line interface for managing LaunchDarkly feature flags.
Other
11 stars 1 forks source link

feat: Add command to launchDevly to update the project environment and context #433

Closed cdelst closed 1 month ago

cdelst commented 1 month ago
update the specified project and its flag configuration with the LaunchDarkly Service

Usage:
  ldcli dev-server update-project [flags]

Required flags:
      --project string   The project key

Optional flags:
      --context string   Stringified JSON representation of your context object ex. {"user": { "email": "test@gmail.com", "username": "foo", "key": "bar"}}
      --source string    environment to copy flag values from

Global flags:
  -h, --help                  Get help about any command
      --access-token string     LaunchDarkly access token with write-level access
      --analytics-opt-out       Opt out of analytics tracking
      --base-uri string         LaunchDarkly base URI (default "https://app.launchdarkly.com")
      --dev-stream-uri string   Streaming service endpoint that the dev server uses to obtain authoritative flag data. This may be a LaunchDarkly or Relay Proxy endpoint (default "https://stream.launchdarkly.com")
  -o, --output string           Command response output format in either JSON or plain text (default "plaintext")
      --port string             Port for the dev server to run on (default "8765")
$ go run . dev-server update-project --context '{"kind": "user", "key": "dev-environment"}' --source staging                

Context updated successfully to:
{
  "key": "dev-environment",
  "kind": "user"
}
Source environment updated successfully to 'staging'