@@ -53,7 +53,7 @@ $ npm install -g flagsmith-cli
5353$ flagsmith COMMAND
5454running command...
5555$ flagsmith (--version)
56- flagsmith-cli/0.1.2 darwin-arm64 node-v18.13.0
56+ flagsmith-cli/0.3.0 darwin-arm64 node-v18.20.4
5757$ flagsmith --help [COMMAND]
5858USAGE
5959 $ flagsmith COMMAND
@@ -62,38 +62,70 @@ USAGE
6262<!-- usagestop -->
6363# Commands
6464<!-- commands -->
65+ * [ ` flagsmith generate-types PROJECT ` ] ( #flagsmith-generate-types-project )
6566* [ ` flagsmith get [ENVIRONMENT] ` ] ( #flagsmith-get-environment )
6667* [ ` flagsmith help [COMMANDS] ` ] ( #flagsmith-help-commands )
6768
69+ ## ` flagsmith generate-types PROJECT `
70+
71+ Fetch Flagsmith feature flags as JSON. By default pipes to stdout, allowing use with other tools; or write to a file with -o.
72+
73+ ```
74+ USAGE
75+ $ flagsmith generate-types PROJECT [-a <value>] [-o <value>] [-e <value>] [-p]
76+
77+ ARGUMENTS
78+ PROJECT Flagsmith project ID
79+
80+ FLAGS
81+ -a, --api=<value> [default: https://api.flagsmith.com] The API endpoint (if self-hosted)
82+ -e, --exclude=<value> Comma-separated list of feature names to exclude
83+ -o, --output=<value> Write the fetched JSON to a file instead of stdout
84+ -p, --parseObjects (experimental) Include full object values when fetching features
85+
86+ DESCRIPTION
87+ Fetch Flagsmith feature flags as JSON. By default pipes to stdout, allowing use with other tools; or write to a file
88+ with -o.
89+
90+ EXAMPLES
91+ export FLAGSMITH_API_KEY=YOUR_KEY flagsmith generate-types PROJECT_ID | npx quicktype \
92+ --src-lang json \
93+ --lang typescript \
94+ --just-types \
95+ --explicit-unions \
96+ --acronym-style camel \
97+ --top-level FlagsmithTypes \
98+ -o FlagsmithTypes.ts
99+
100+ export FLAGSMITH_API_KEY=YOUR_KEY flagsmith generate-types PROJECT_ID -o features.json
101+ ```
102+
103+ _ See code: [ src/commands/generate-types/index.ts] ( https://github.com/Flagsmith/flagsmith-cli/blob/v0.3.0/src/commands/generate-types/index.ts ) _
104+
68105## ` flagsmith get [ENVIRONMENT] `
69106
70107Retrieve flagsmith features from the Flagsmith API and output them to a file.
71108
72109```
73110USAGE
74- $ flagsmith get [ENVIRONMENT] [-o <value>] [-a <value>] [-t
75- <value> -i <value>] [-p] [-e flags|environment]
111+ $ flagsmith get [ENVIRONMENT] [-o <value>] [-a <value>] [-t <trait_key>=<trait_value>... -i <value>]
112+ [-p] [-e flags|environment]
76113
77114ARGUMENTS
78- ENVIRONMENT The flagsmith environment key to use, defaults to the environment
79- variable FLAGSMITH_ENVIRONMENT
115+ ENVIRONMENT The flagsmith environment key to use, defaults to the environment variable FLAGSMITH_ENVIRONMENT
80116
81117FLAGS
82- -a, --api=<value> [default: https://edge.api.flagsmith.com/api/v1/] The
83- API URL to fetch the feature flags from
84- -e, --entity=<option> [default: flags] The entity to fetch, this will either
85- be the flags or an environment document used for [local
86- evaluation](https://docs.flagsmith.com/clients/server-s
87- ide#local-evaluation-mode-network-behaviour).
118+ -a, --api=<value> [default: https://edge.api.flagsmith.com/api/v1/] The API URL to fetch the feature flags from
119+ -e, --entity=<option> [default: flags] The entity to fetch, this will either be the flags or an environment document
120+ used for [local evaluation](https://docs.flagsmith.com/clients/server-side#local-evaluation-mod
121+ e-network-behaviour).
88122 <options: flags|environment>
89123 -o, --output=<value> [default: ./flagsmith.json] The file path output
90124 -p, --pretty Prettify the output JSON
91125
92126IDENTITY FLAGS
93- -i, --identity=<value> The identity for which to fetch
94- feature flags
95- -t, --trait=<trait_key>=<trait_value>... Trait key-value pair, separated by
96- an equals sign (=)
127+ -i, --identity=<value> The identity for which to fetch feature flags
128+ -t, --trait=<trait_key>=<trait_value>... Trait key-value pair, separated by an equals sign (=)
97129
98130DESCRIPTION
99131 Retrieve flagsmith features from the Flagsmith API and output them to a file.
@@ -116,46 +148,18 @@ EXAMPLES
116148 $ flagsmith get -p
117149```
118150
119- _ See code: [ dist/commands/get/index.ts] ( https://github.com/Flagsmith/flagsmith-cli/blob/v0.1.4/dist/commands/get/index.ts ) _
120-
121- ## ` flagsmith generate-types [ENVIRONMENT] `
122-
123- Generate a fully typed set of your project's current features.
124-
125- Note: This requires an API Key that is either generated for organisation settings or found in your account.
126-
127- ```
128- USAGE
129- $ FLAGSMITH_API_KEY=<KEY> flagsmith generate-types [PROJECT_ID]
130-
131- ARGUMENTS
132- PROJECT_ID The flagsmith project id you are fetching the types for.
133-
134- FLAGS
135- -a, --api=<value> [default: https://edge.api.flagsmith.com/api/v1/] The
136- API URL to fetch the feature flags from
137- -e, --exclude [default: null] Exclude any feature you intend to remove, can be a csv e.g feature_a,feature_b.
138- -o, --output=<value> [default: ./flagsmith.d.ts] The file path output
139- -p, --pretty Prettify the output JSON
140-
141- DESCRIPTION
142- Retrieve type definitions for the features and their possible remote configuration values.
143- ```
144-
145-
146-
147- _ See code: [ dist/commands/get/index.ts] ( https://github.com/Flagsmith/flagsmith-cli/blob/v0.1.4/dist/commands/get/index.ts ) _
151+ _ See code: [ src/commands/get/index.ts] ( https://github.com/Flagsmith/flagsmith-cli/blob/v0.3.0/src/commands/get/index.ts ) _
148152
149153## ` flagsmith help [COMMANDS] `
150154
151155Display help for flagsmith.
152156
153157```
154158USAGE
155- $ flagsmith help [COMMANDS] [-n]
159+ $ flagsmith help [COMMANDS... ] [-n]
156160
157161ARGUMENTS
158- COMMANDS Command to show help for.
162+ COMMANDS... Command to show help for.
159163
160164FLAGS
161165 -n, --nested-commands Include all nested commands in the output.
@@ -164,6 +168,8 @@ DESCRIPTION
164168 Display help for flagsmith.
165169```
166170
171+ _ See code: [ @oclif/plugin-help ] ( https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts ) _
172+
167173### Type generation examples
168174
169175[ 1 - Adding a remote config.mov] ( 1%20-%20Adding%20a%20remote%20config.mov )
0 commit comments