flipt
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFlipt Feature Flag Management
Flipt功能标志管理
Use this skill to manage Flipt feature flags for controlled feature rollouts.
使用此技能来管理Flipt功能标志,以实现可控的功能发布。
Running Commands
运行命令
Use the included script:
bash
node .claude/skills/flipt/flipt.mjs <command> [options]使用附带的脚本:
bash
node .claude/skills/flipt/flipt.mjs <command> [options]Commands
命令
| Command | Description |
|---|---|
| List all flags |
| Get details for a specific flag |
| Create a new boolean flag |
| Enable a flag (set to true) |
| Disable a flag (set to false) |
| Delete a flag (requires confirmation) |
| 命令 | 描述 |
|---|---|
| 列出所有标志 |
| 获取特定标志的详细信息 |
| 创建一个新的布尔型标志 |
| 启用标志(设置为true) |
| 禁用标志(设置为false) |
| 删除标志(需要确认) |
Options
选项
| Flag | Description |
|---|---|
| Description for new flag |
| Create flag as enabled (default: disabled) |
| Output results as JSON |
| Minimal output |
| Skip confirmation prompts |
| 标志 | 描述 |
|---|---|
| 新标志的描述 |
| 创建已启用的标志(默认:禁用) |
| 以JSON格式输出结果 |
| 精简输出 |
| 跳过确认提示 |
Examples
示例
bash
undefinedbash
undefinedList all flags
列出所有标志
node .claude/skills/flipt/flipt.mjs list
node .claude/skills/flipt/flipt.mjs list
Get a specific flag
获取特定标志
node .claude/skills/flipt/flipt.mjs get gift-card-vendor-waifu-way
node .claude/skills/flipt/flipt.mjs get gift-card-vendor-waifu-way
Create a new flag (disabled by default)
创建新标志(默认禁用)
node .claude/skills/flipt/flipt.mjs create my-new-feature -d "Enable new feature for testing"
node .claude/skills/flipt/flipt.mjs create my-new-feature -d "Enable new feature for testing"
Create a flag that's enabled immediately
创建立即启用的标志
node .claude/skills/flipt/flipt.mjs create my-feature --enabled -d "Already enabled feature"
node .claude/skills/flipt/flipt.mjs create my-feature --enabled -d "Already enabled feature"
Enable a flag
启用标志
node .claude/skills/flipt/flipt.mjs enable my-new-feature
node .claude/skills/flipt/flipt.mjs enable my-new-feature
Disable a flag
禁用标志
node .claude/skills/flipt/flipt.mjs disable my-new-feature
node .claude/skills/flipt/flipt.mjs disable my-new-feature
Delete a flag (with confirmation)
删除标志(需要确认)
node .claude/skills/flipt/flipt.mjs delete old-flag
node .claude/skills/flipt/flipt.mjs delete old-flag
Delete without confirmation
无需确认直接删除
node .claude/skills/flipt/flipt.mjs delete old-flag --force
node .claude/skills/flipt/flipt.mjs delete old-flag --force
JSON output for scripting
以JSON格式输出用于脚本编写
node .claude/skills/flipt/flipt.mjs list --json
undefinednode .claude/skills/flipt/flipt.mjs list --json
undefinedGitOps Integration
GitOps集成
Flipt uses GitOps - flags are stored in the repository. Changes made via the API are temporary and will be overwritten on the next Git sync (every 30 seconds).
civitai/flipt-stateFor permanent changes, edit the repository directly:
bash
undefinedFlipt采用GitOps方式——标志存储在仓库中。通过API进行的更改是临时的,会在下次Git同步(每30秒一次)时被覆盖。
civitai/flipt-state要进行永久更改,请直接编辑仓库:
bash
undefinedClone the state repo
克隆状态仓库
gh repo clone civitai/flipt-state /tmp/flipt-state
gh repo clone civitai/flipt-state /tmp/flipt-state
Edit civitai-app/default/features.yaml
编辑civitai-app/default/features.yaml
Add your flag under the flags:
section
flags:在flags:
部分下添加你的标志
flags:Commit and push
提交并推送
cd /tmp/flipt-state
git add -A && git commit -m "Add new feature flag" && git push
undefinedcd /tmp/flipt-state
git add -A && git commit -m "Add new feature flag" && git push
undefinedFlag Format in YAML
YAML中的标志格式
yaml
flags:
- key: my-feature-flag
name: my-feature-flag
type: BOOLEAN_FLAG_TYPE
description: Description of what this flag controls
enabled: false
# Optional: rollout rules
rollouts:
- threshold:
percentage: 50
value: true
- segment:
keys:
- moderators
operator: OR_SEGMENT_OPERATOR
value: trueyaml
flags:
- key: my-feature-flag
name: my-feature-flag
type: BOOLEAN_FLAG_TYPE
description: Description of what this flag controls
enabled: false
# 可选:发布规则
rollouts:
- threshold:
percentage: 50
value: true
- segment:
keys:
- moderators
operator: OR_SEGMENT_OPERATOR
value: trueSafety Notes
安全注意事项
- API changes are temporary: The Git repo is the source of truth
- Test before enabling: Use segments for gradual rollout
- Coordinate with team: Others may be editing the same flags
- API更改是临时的:Git仓库是事实来源
- 启用前测试:使用分段进行逐步发布
- 与团队协作:其他人可能正在编辑相同的标志
Environment Setup
环境设置
Copy to and configure:
.env.example.envbash
cp .claude/skills/flipt/.env.example .claude/skills/flipt/.envThe skill needs and to connect to Flipt.
FLIPT_URLFLIPT_API_TOKEN复制到并进行配置:
.env.example.envbash
cp .claude/skills/flipt/.env.example .claude/skills/flipt/.env该技能需要和来连接到Flipt。
FLIPT_URLFLIPT_API_TOKEN