You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
makes it possible to copy flag setting such as targeting between environments, and cleans up error
handing. plus removal of old 'api.js' in favour of 'ldutils' executable.
BREAKING CHANGE: removed support for 'api' js
Copy file name to clipboardExpand all lines: README.md
+32-13Lines changed: 32 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,18 +27,10 @@ Please note that the api token is not the same as your sdk keys. You need to ge
27
27
28
28
### commandline usage OLD
29
29
This command line support was primarily for debugging api calls. The NEW version below is aimed at general usage.
30
-
```
31
-
export LAUNCHDARKLY_API_TOKEN=<api-token>
32
-
33
-
// collect all flags for a project
34
-
npm run api -- getFeatureFlags <myProjectId>
35
30
36
-
// update or create a customRole with array of policies
37
-
npm run api -- upsertCustomRole <customRoleKey> <customRoleName> '[{"resources":["proj/*"],"actions":["*"],"effect":"allow"}]'
38
-
```
39
31
40
-
### commandline usage NEW (in progress)
41
-
A more complete commandline solution is underway - try it out using:
32
+
### commandline usage
33
+
After cloning this repo you can make `ldutils` executable, and use it to make api calls based on passed in parameters.
42
34
43
35
```
44
36
chmod 755 ./ldutils
@@ -47,7 +39,30 @@ chmod 755 ./ldutils
47
39
48
40
The above will display a help screen of instructions, thanks to https://github.com/tj/commander.js/
49
41
50
-
Make sure you have env var LAUNCHDARKLY_API_TOKEN set, and if piping output to another command, ensure that LAUNCHDARKLY_API_LOGLEVEL is not set to 'debug'.
> Make sure you have env var LAUNCHDARKLY_API_TOKEN set, and if piping output to another command, ensure that LAUNCHDARKLY_API_LOGLEVEL is not set to 'debug' to ensure only the json result of the command is returned.
55
+
56
+
Here are some examples of commandline usage (if you have not added ldutils to PATH, prefix with `./`:
57
+
```
58
+
export LAUNCHDARKLY_API_TOKEN=<api-token>
59
+
60
+
// collect all flags for a project
61
+
ldutils getFeatureFlags <myProjectId>
62
+
63
+
// update or create a customRole with array of policies
> migrateFeatureFlag mode is used to copy flag attributes between environments. This covers: targets, rules, fallthrough, offVariation, prerequisites and optionally the flag on/off state.
75
94
76
95
### Custom roles
77
96
@@ -89,7 +108,7 @@ The command line modes and parameters map directly to the functions exposed for
89
108
-`bulkUpsertCustomRoleFolder` mode does the same on a folder of json files.
90
109
91
110
```
92
-
npm run api -- bulkUpsertCustomRoles ./exampleRoleBulkLoad.json
0 commit comments