LaunchDarkly CLI
Read time: 3 minutes
Last edited: Aug 28, 2024
Overview
This topic describes how to get started with the LaunchDarkly CLI.
LaunchDarkly provides a command line interface (CLI) so that you can set up and manage your feature flags, account members, projects, environments, teams, and other resources directly from the command line.
Installation
The LaunchDarkly CLI is available for macOS, Windows, and Linux.
To install the LaunchDarkly CLI:
brew tap launchdarkly/homebrew-tapbrew install ldcli
To update to the latest version of the LaunchDarkly CLI:
brew upgrade ldcli
Get started
To get started with the LaunchDarkly CLI, you need to authenticate yourself. Then, you can use setup
to create and set up your first flag, run any of the ldcli commands.
Authentication
Before you run commands in the LaunchDarkly CLI, you need to authenticate yourself. You have two options:
- Authenticate with your email and password. The
login
command provides a login link to the LaunchDarkly UI, requests your approval for the LaunchDarkly CLI to access your account information, and then stores an appropriate access token in the LaunchDarkly CLI's configuration file. - Authenticate with an access token that you create. The
config
command controls authorization and other configuration values.
Here's how:
# you only need to run this onceldcli login
To learn how to create an access token, read Creating API access tokens.
Setup
The setup
command provides a step-by-step guide to create a flag, install an SDK, and toggle that flag:
ldcli setup
Additional documentation
For more information about common commands, read LaunchDarkly CLI commands.
You can also use the ldcli [command] --help
command to view usage information for all commands for the LaunchDarkly CLI.
To view and contribute to the LaunchDarkly CLI source code, or to file issues for our team, visit the LaunchDarkly CLI GitHub repository.