@forloop-cc/forloop-cli 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -86
- package/dist/forloop +888 -240
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,10 +99,7 @@ That's it. You're connected.
|
|
|
99
99
|
|
|
100
100
|
Visit the ForLoop settings page to generate a token:
|
|
101
101
|
|
|
102
|
-
| Environment | URL |
|
|
103
|
-
|-------------|-----|
|
|
104
102
|
| Production | https://forloop.cc/profile?tab=api-tokens |
|
|
105
|
-
| Development | https://dev.forloop.cc/profile?tab=api-tokens |
|
|
106
103
|
|
|
107
104
|
Tokens start with `floop_`. Create a token with at least these scopes:
|
|
108
105
|
- `sprint:read`, `sprint:write`
|
|
@@ -132,69 +129,6 @@ forloop auth logout # Remove saved token
|
|
|
132
129
|
|
|
133
130
|
---
|
|
134
131
|
|
|
135
|
-
## Environments
|
|
136
|
-
|
|
137
|
-
ForLoop has two environments — **Production** and **Development**. By default, the CLI connects to production. Use the development environment when you want to test features or work on staging data without affecting production.
|
|
138
|
-
|
|
139
|
-
### Production (default)
|
|
140
|
-
|
|
141
|
-
No extra setup needed. The CLI connects to `https://api.forloop.cc` automatically.
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
forloop sprint list
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Development
|
|
148
|
-
|
|
149
|
-
The development environment connects to `https://api.dev.forloop.cc`. You need two things:
|
|
150
|
-
|
|
151
|
-
1. **A dev API token** — create one at https://dev.forloop.cc/profile?tab=api-tokens
|
|
152
|
-
2. **Environment variables** — the CLI requires explicit opt-in for security:
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
export FORLOOP_ENV=development
|
|
156
|
-
export FORLOOP_ALLOW_DEV=true
|
|
157
|
-
forloop auth login --api-key floop_xxxxx
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
> **Security note:** `FORLOOP_ALLOW_DEV=true` is required because dev API tokens have fewer restrictions. This flag prevents accidentally using a dev token against production data. Set it only when you intend to use the dev environment.
|
|
161
|
-
|
|
162
|
-
### One-Liner for Dev
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
FORLOOP_ENV=development FORLOOP_ALLOW_DEV=true forloop sprint list
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Persistent Dev Setup
|
|
169
|
-
|
|
170
|
-
To always use dev for a specific project, add an `opencode.json` in your project root:
|
|
171
|
-
|
|
172
|
-
```json
|
|
173
|
-
{
|
|
174
|
-
"forloop": {
|
|
175
|
-
"apiUrl": "https://api.dev.forloop.cc",
|
|
176
|
-
"allowDev": true
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Or set it globally in `~/.config/opencode/config.json`:
|
|
182
|
-
|
|
183
|
-
```json
|
|
184
|
-
{
|
|
185
|
-
"forloop": {
|
|
186
|
-
"apiUrl": "https://api.dev.forloop.cc",
|
|
187
|
-
"allowDev": true
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
| Question | Answer |
|
|
193
|
-
|----------|--------|
|
|
194
|
-
| What happens if I don't set `FORLOOP_ALLOW_DEV=true`? | The CLI will ignore your dev URL and connect to production instead, with a warning message |
|
|
195
|
-
| Can I switch between prod and dev per-command? | Yes, the `--api-url` flag or `FORLOOP_ENV` env var overrides the config |
|
|
196
|
-
| Do I need separate tokens for prod and dev? | Yes — create one token at each environment's settings page |
|
|
197
|
-
|
|
198
132
|
---
|
|
199
133
|
|
|
200
134
|
## Commands
|
|
@@ -419,9 +353,7 @@ These flags work with every command:
|
|
|
419
353
|
| Variable | Purpose |
|
|
420
354
|
|----------|---------|
|
|
421
355
|
| `FORLOOP_API_KEY` | API token (alternative to `forloop auth login`) |
|
|
422
|
-
| `FORLOOP_API_URL` | Override the API base URL |
|
|
423
|
-
| `FORLOOP_ENV` | Set to `production` or `development` |
|
|
424
|
-
| `FORLOOP_ALLOW_DEV` | Set to `true` to enable dev environment URLs |
|
|
356
|
+
| `FORLOOP_API_URL` | Override the API base URL (e.g., `https://api.dev.forloop.cc`) |
|
|
425
357
|
| `FORLOOP_SPRINT_ID` | Default sprint ID for commands that auto-detect it |
|
|
426
358
|
|
|
427
359
|
---
|
|
@@ -561,8 +493,7 @@ The CLI resolves configuration from these sources, in priority order:
|
|
|
561
493
|
```json
|
|
562
494
|
{
|
|
563
495
|
"forloop": {
|
|
564
|
-
"apiUrl": "https://api.
|
|
565
|
-
"allowDev": true
|
|
496
|
+
"apiUrl": "https://api.forloop.cc"
|
|
566
497
|
}
|
|
567
498
|
}
|
|
568
499
|
```
|
|
@@ -572,8 +503,7 @@ The CLI resolves configuration from these sources, in priority order:
|
|
|
572
503
|
```json
|
|
573
504
|
{
|
|
574
505
|
"forloop": {
|
|
575
|
-
"apiUrl": "https://api.forloop.cc"
|
|
576
|
-
"allowDev": false
|
|
506
|
+
"apiUrl": "https://api.forloop.cc"
|
|
577
507
|
}
|
|
578
508
|
}
|
|
579
509
|
```
|
|
@@ -600,23 +530,11 @@ export FORLOOP_API_KEY=floop_xxxxx
|
|
|
600
530
|
|
|
601
531
|
Tokens must start with `floop_`. Double-check you copied the entire token from https://forloop.cc/profile?tab=api-tokens.
|
|
602
532
|
|
|
603
|
-
### "Dev API URL ignored"
|
|
604
|
-
|
|
605
|
-
The CLI refuses dev URLs unless you explicitly opt in:
|
|
606
|
-
|
|
607
|
-
```bash
|
|
608
|
-
export FORLOOP_ALLOW_DEV=true
|
|
609
|
-
export FORLOOP_ENV=development
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
This is a security measure — dev tokens should never accidentally hit production APIs.
|
|
613
|
-
|
|
614
533
|
### "Forbidden" or "Not Found" on Specific Resources
|
|
615
534
|
|
|
616
535
|
Some resources (organizations, stories, files) return 403/404 when you don't have access or they don't exist in your current environment. Try:
|
|
617
|
-
- Checking you're in the right environment (prod vs dev)
|
|
618
536
|
- Verifying the resource ID exists with `forloop sprint get --id <id>`
|
|
619
|
-
- Checking
|
|
537
|
+
- Checking your token has the required scopes
|
|
620
538
|
|
|
621
539
|
### Verbose Debugging
|
|
622
540
|
|