Skip to content

Create-Inc/pm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pm

Feature flag rollout manager. A terminal UI that shows all LaunchDarkly feature flags and where they are in your release process.

Built with TypeScript, React, and Ink.

Setup

npm install && npm run build && npm link

Auth

pm auth login     # paste your LD API access token
pm auth logout    # clear stored token

Get your token from https://app.launchdarkly.com/settings/authorization. Use a token with Writer role if you want to use the deprecate command.

Config is stored at ~/.config/pm/config.json.

Usage

pm                # launch the TUI
pm --help         # show help

The TUI shows all temporary feature flags across four environments — dev, preview, staging, prod — sorted by rollout completeness (most rolled out first).

Keyboard shortcuts

Key Action
Up / Down Navigate
( / ) Jump 5 items
o / Enter Open flag in LaunchDarkly
c Copy flag key to clipboard
e Expand/collapse targeting rules
D Deprecate flag in LaunchDarkly
r Refresh flag data
/ Search flags by key or name
d Cycle filter: all / rolling out / shipped
q Quit

Expanded view

Press e to expand the selected flag and see its targeting rules per environment — individual targets, segment rules, rollout percentages, and the default fallthrough, all with resolved variation names.

Actions (plugins)

Bind custom commands to keyboard shortcuts. Actions run in the background and their status is shown inline.

pm action list                          # show all actions
pm action add <key> <label> <command>   # bind a key
pm action remove <key>                  # unbind a key
pm action clear                         # remove all actions

Template variables available in commands:

Variable Value
{key} Flag key (e.g. new-editor)
{name} Flag name (e.g. New Editor)
{owner} Flag maintainer name
{url} LaunchDarkly dashboard URL for the flag

Remove flag action

This action creates a git worktree, spawns Claude Code to remove the feature flag from the codebase, commits the change, and opens a PR — all in the background.

pm action add x "Remove flag" "cd /path/to/your/repo && git fetch origin main && (test -d /path/to/worktrees/remove-{key} || git worktree add /path/to/worktrees/remove-{key} -b remove-{key} origin/main) && cd /path/to/worktrees/remove-{key} && claude -p --permission-mode=bypassPermissions 'Remove the feature flag {key} from the codebase. Search for all usages of this flag key, remove the flag checks, and keep the enabled/true code path. Clean up any dead code branches from the removal. After making changes, stage the files with git add and commit using the conventional commit format: chore: remove {name} feature flag. Then push and use the gh CLI to create a PR for this branch.'"

What it does:

  1. cd into your repo and fetch latest main
  2. Create a worktree at /path/to/worktrees/remove-{key} (or reuse it if it already exists, making the command idempotent)
  3. Run Claude Code headlessly to find all usages of the flag, remove the checks, keep the enabled path, and clean up dead code
  4. Commit with chore: remove {name} feature flag, push, and create a PR

Press x on any flag in the TUI to kick it off. The job status shows inline — yellow while running, green on success, red on failure. Completed jobs disappear after 5 seconds.

About

Feature flag rollout manager TUI for LaunchDarkly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors