Skip to content

Commit 1b7264b

Browse files
committed
feat: add sync command for uploading feature flags to FlipFlag API
- Add new 'sync' command to upload features from .flipflag.yml to FlipFlag platform - Support private/public key authentication via CLI flags or environment variables - Add configurable API URL for self-hosted instances - Include detailed sync documentation in README with CI/CD integration examples - Refactor code formatting from single quotes to double quotes for consistency BREAKING CHANGE: None
1 parent 426483a commit 1b7264b

File tree

2 files changed

+280
-64
lines changed

2 files changed

+280
-64
lines changed

README.md

Lines changed: 108 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# FlipFlag CLI
22

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.
54

6-
- start and stop work sessions,
7-
- track time,
8-
- automatically create/switch Git branches,
9-
- store contributor information from Git.
5+
## Key Features
106

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.
1215

1316
---
1417

@@ -54,7 +57,15 @@ TASK-1:
5457
5558
---
5659
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+
---
5869

5970
### ▶️ Start a Task
6071

@@ -150,6 +161,72 @@ Closes the latest unfinished time interval.
150161

151162
---
152163

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+
153230
## 🆘 Help
154231

155232
```bash
@@ -194,6 +271,28 @@ npx flipflag start TASK-1
194271

195272
---
196273

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+
197292
## 📝 License
198293

199-
MIT
294+
MIT
295+
296+
---
297+
298+
**Made with ❤️ by the FlipFlag team**

0 commit comments

Comments
 (0)