|
1 | 1 | # FlipFlag CLI |
2 | 2 |
|
3 | | -**Flipflag** is a lightweight CLI tool for tracking development tasks directly inside your repository. |
4 | | -It stores data in a local `.flipflag.yml` file and allows you to: |
| 3 | +**FlipFlag CLI** is a lightweight command-line tool for managing feature flags and tracking development tasks directly in your repository. |
5 | 4 |
|
6 | | -- start and stop work sessions, |
7 | | -- track time, |
8 | | -- automatically create/switch Git branches, |
9 | | -- store contributor information from Git. |
| 5 | +## Key Features |
10 | 6 |
|
11 | | -Flipflag is designed as a minimal, developer-friendly alternative to larger issue/time-tracking systems. |
| 7 | +- 📋 **Task Management**: Start and stop work sessions with time tracking |
| 8 | +- 🔄 **Flag Synchronization**: Upload feature flags to FlipFlag platform |
| 9 | +- 🌿 **Git Integration**: Automatically create/switch Git branches |
| 10 | +- ⏱️ **Time Tracking**: Record when features are being worked on |
| 11 | +- 👥 **Team Collaboration**: Store contributor information from Git |
| 12 | +- 🚀 **CI/CD Ready**: Integrate with GitLab, GitHub Actions, CircleCI, and more |
| 13 | + |
| 14 | +FlipFlag CLI stores all data in a local `.flipflag.yml` file, making it easy to version control your feature flags alongside your code. |
12 | 15 |
|
13 | 16 | --- |
14 | 17 |
|
@@ -54,7 +57,15 @@ TASK-1: |
54 | 57 |
|
55 | 58 | --- |
56 | 59 |
|
57 | | -## 🧭 Usage |
| 60 | +## 🧭 Commands |
| 61 | +
|
| 62 | +FlipFlag CLI provides three main commands: |
| 63 | +
|
| 64 | +1. **`start`** - Start working on a task |
| 65 | +2. **`stop`** - Stop working on a task |
| 66 | +3. **`sync`** - Upload feature flags to FlipFlag API |
| 67 | + |
| 68 | +--- |
58 | 69 |
|
59 | 70 | ### ▶️ Start a Task |
60 | 71 |
|
@@ -150,6 +161,72 @@ Closes the latest unfinished time interval. |
150 | 161 |
|
151 | 162 | --- |
152 | 163 |
|
| 164 | +## 🔄 Sync Command |
| 165 | + |
| 166 | +Upload feature flags from `.flipflag.yml` to FlipFlag platform: |
| 167 | + |
| 168 | +```bash |
| 169 | +flipflag sync --private-key "your_private_key" |
| 170 | +``` |
| 171 | + |
| 172 | +### Using Environment Variables (Recommended) |
| 173 | + |
| 174 | +```bash |
| 175 | +export FLIPFLAG_PRIVATE_KEY="your_private_key" |
| 176 | +flipflag sync |
| 177 | +``` |
| 178 | + |
| 179 | +### Sync Command Options |
| 180 | + |
| 181 | +| Option | Environment Variable | Description | Required | |
| 182 | +|--------|---------------------|-------------|----------| |
| 183 | +| `--private-key KEY` | `FLIPFLAG_PRIVATE_KEY` | Private API key | ✅ Yes | |
| 184 | +| `--public-key KEY` | `FLIPFLAG_PUBLIC_KEY` | Public API key | ❌ No | |
| 185 | +| `--api-url URL` | `FLIPFLAG_API_URL` | API endpoint | ❌ No | |
| 186 | +| `--config PATH` | - | Config file path | ❌ No | |
| 187 | + |
| 188 | +### Sync Examples |
| 189 | + |
| 190 | +```bash |
| 191 | +# Basic sync |
| 192 | +export FLIPFLAG_PRIVATE_KEY="priv_abc123..." |
| 193 | +flipflag sync |
| 194 | +
|
| 195 | +# Custom config file |
| 196 | +flipflag sync --config .flipflag.production.yml |
| 197 | +
|
| 198 | +# Self-hosted API |
| 199 | +flipflag sync --api-url "https://flipflag.your-company.com" |
| 200 | +``` |
| 201 | + |
| 202 | +### CI/CD Integration |
| 203 | + |
| 204 | +**GitLab CI/CD:** |
| 205 | + |
| 206 | +```yaml |
| 207 | +sync-features: |
| 208 | + stage: sync |
| 209 | + image: node:20-alpine |
| 210 | + only: |
| 211 | + - main |
| 212 | + script: |
| 213 | + - npm install -g @flipflag/cli |
| 214 | + - flipflag sync --private-key "$FLIPFLAG_PRIVATE_KEY" |
| 215 | +``` |
| 216 | + |
| 217 | +**GitHub Actions:** |
| 218 | + |
| 219 | +```yaml |
| 220 | +- name: Sync Feature Flags |
| 221 | + run: | |
| 222 | + npm install -g @flipflag/cli |
| 223 | + flipflag sync --private-key "${{ secrets.FLIPFLAG_PRIVATE_KEY }}" |
| 224 | +``` |
| 225 | + |
| 226 | +📚 **Complete CI/CD Guide**: See [CLI_SYNC.md](../docs/CLI_SYNC.md) for detailed integration examples with GitLab, GitHub Actions, CircleCI, Jenkins, and Azure Pipelines. |
| 227 | + |
| 228 | +--- |
| 229 | + |
153 | 230 | ## 🆘 Help |
154 | 231 |
|
155 | 232 | ```bash |
@@ -194,6 +271,28 @@ npx flipflag start TASK-1 |
194 | 271 |
|
195 | 272 | --- |
196 | 273 |
|
| 274 | +## 📚 Documentation |
| 275 | + |
| 276 | +- **[Feature Flag Sync Guide](../docs/CLI_SYNC.md)** - Complete guide for syncing flags and CI/CD integration |
| 277 | +- **[CI/CD Examples](../docs/examples/)** - Ready-to-use configurations for various platforms |
| 278 | +- **[FlipFlag SDK](https://github.com/flipflag-dev/sdk)** - Client SDK for feature flag management |
| 279 | + |
| 280 | +--- |
| 281 | + |
| 282 | +## 🔗 Links |
| 283 | + |
| 284 | +- **Website**: https://flipflag.dev |
| 285 | +- **Dashboard**: https://cloud.flipflag.dev |
| 286 | +- **Documentation**: https://docs.flipflag.dev |
| 287 | +- **GitHub**: https://github.com/flipflag-dev/cli |
| 288 | +- **NPM**: https://www.npmjs.com/package/@flipflag/cli |
| 289 | + |
| 290 | +--- |
| 291 | + |
197 | 292 | ## 📝 License |
198 | 293 |
|
199 | | -MIT |
| 294 | +MIT |
| 295 | + |
| 296 | +--- |
| 297 | + |
| 298 | +**Made with ❤️ by the FlipFlag team** |
0 commit comments