$ npm install -g @prefab-cloud/prefab
$ prefab COMMAND
running command...
$ prefab (--version)
@prefab-cloud/prefab/0.5.2 darwin-arm64 node-v22.12.0
$ prefab --help [COMMAND]
USAGE
$ prefab COMMAND
...
prefab create NAME
prefab download
prefab gen
prefab generate
prefab generate-new-hex-key
prefab get [NAME]
prefab info [NAME]
prefab interactive
prefab list
prefab override [NAME]
prefab schema NAME
prefab serve DATA-FILE
prefab set-default [NAME]
Create a new item in Prefab
USAGE
$ prefab create NAME --api-key <value> --type boolean-flag|boolean|string|double|int|string-list|json
[--json] [--interactive] [--no-color] [--verbose] [--confidential] [--env-var <value>] [--value <value>] [--secret]
[--secret-key-name <value>]
ARGUMENTS
NAME name for your new item (e.g. my.new.flag)
FLAGS
--confidential mark the value as confidential
--env-var=<value> environment variable to get value from
--secret encrypt the value of this item
--secret-key-name=<value> [default: prefab.secrets.encryption.key] name of the secret key to use for
encryption/decryption
--type=<option> (required)
<options: boolean-flag|boolean|string|double|int|string-list|json>
--value=<value> default value for your new item
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Create a new item in Prefab
EXAMPLES
$ prefab create my.new.flag --type boolean-flag
$ prefab create my.new.flag --type boolean-flag --value=true
$ prefab create my.new.string --type string --value="hello world"
$ prefab create my.new.string --type string --value="hello world" --secret
$ prefab create my.new.string --type string --env-var=MY_ENV_VAR_NAME
$ prefab create my.new.string --type json --value="{\"key\": \"value\"}"
See code: src/commands/create.ts
Download a Datafile for a given environment
USAGE
$ prefab download --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--environment <value>]
FLAGS
--environment=<value> environment to download
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Download a Datafile for a given environment
You can serve a datafile using the `serve` command.
EXAMPLES
$ prefab download --environment=test
See code: src/commands/download.ts
Generate type definitions for your Prefab configuration
USAGE
$ prefab gen --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--output-dir <value>]
[--target node-ts|react-ts|python-pydantic|ruby]
FLAGS
--output-dir=<value> [default: generated-sources] output directory for generated code
--target=<option> [default: node-ts] language/framework to generate code for
<options: node-ts|react-ts|python-pydantic|ruby>
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Generate type definitions for your Prefab configuration
ALIASES
$ prefab gen
EXAMPLES
$ prefab gen --target node-ts
$ prefab gen --target react-ts --output-dir custom/path
$ prefab gen --target python
Generate type definitions for your Prefab configuration
USAGE
$ prefab generate --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--output-dir <value>]
[--target node-ts|react-ts|python-pydantic|ruby]
FLAGS
--output-dir=<value> [default: generated-sources] output directory for generated code
--target=<option> [default: node-ts] language/framework to generate code for
<options: node-ts|react-ts|python-pydantic|ruby>
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Generate type definitions for your Prefab configuration
ALIASES
$ prefab gen
EXAMPLES
$ prefab generate --target node-ts
$ prefab generate --target react-ts --output-dir custom/path
$ prefab generate --target python
See code: src/commands/generate.ts
Generate a new hex key suitable for secrets
USAGE
$ prefab generate-new-hex-key [--json] [--interactive] [--no-color] [--verbose]
GLOBAL FLAGS
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Generate a new hex key suitable for secrets
EXAMPLES
$ prefab generate-new-hex-key
See code: src/commands/generate-new-hex-key.ts
Get the value of a config/feature-flag/etc.
USAGE
$ prefab get [NAME] --api-key <value> [--json] [--interactive] [--no-color] [--verbose]
ARGUMENTS
NAME config/feature-flag/etc. name
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Get the value of a config/feature-flag/etc.
EXAMPLES
$ prefab get my.config.name
See code: src/commands/get.ts
Show details about the provided config/feature-flag/etc.
USAGE
$ prefab info [NAME] --api-key <value> [--json] [--interactive] [--no-color] [--verbose]
[--exclude-evaluations]
ARGUMENTS
NAME config/feature-flag/etc. name
FLAGS
--exclude-evaluations Exclude evaluation data
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Show details about the provided config/feature-flag/etc.
EXAMPLES
$ prefab info my.config.name
See code: src/commands/info.ts
USAGE
$ prefab interactive [--json] [--interactive] [--no-color] [--verbose]
GLOBAL FLAGS
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
EXAMPLES
$ prefab
See code: src/commands/interactive.ts
Show keys for your config/feature flags/etc.
USAGE
$ prefab list --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--configs]
[--feature-flags] [--log-levels] [--segments]
FLAGS
--configs include configs
--feature-flags include flags
--log-levels include log levels
--segments include segments
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Show keys for your config/feature flags/etc.
All types are returned by default. If you pass one or more type flags (e.g. --configs), only those types will be
returned
EXAMPLES
$ prefab list
$ prefab list --feature-flags
See code: src/commands/list.ts
Override the value of an item for your user/API key combo
USAGE
$ prefab override [NAME] --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--remove]
[--value <value>]
ARGUMENTS
NAME config/feature-flag/etc. name
FLAGS
--remove remove your override (if present)
--value=<value> value to use for your override
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Override the value of an item for your user/API key combo
EXAMPLES
$ prefab override # will prompt for name and value
$ prefab override my.flag.name --value=true
$ prefab override my.flag.name --remove
$ prefab override my.double.config --value=3.14159
See code: src/commands/override.ts
Manage schemas for Prefab configs
USAGE
$ prefab schema NAME --api-key <value> [--json] [--interactive] [--no-color] [--verbose] [--get]
[--set-zod <value>]
ARGUMENTS
NAME name of the schema
FLAGS
--get get the schema definition
--set-zod=<value> set a Zod schema definition
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Manage schemas for Prefab configs
EXAMPLES
$ prefab schema my-schema --set-zod="z.object({url: z.string()})"
$ prefab schema my-schema --get
See code: src/commands/schema.ts
Serve a datafile on a local port
USAGE
$ prefab serve DATA-FILE [--json] [--interactive] [--no-color] [--verbose] [--port <value>]
ARGUMENTS
DATA-FILE file to read
FLAGS
--port=<value> [default: 3099] port to serve on
GLOBAL FLAGS
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Serve a datafile on a local port
You can download a datafile using the `download` command.
You'll need to update your JavaScript (or React) client to point to this server.
e.g. `endpoints: ["http://localhost:3099"],`
EXAMPLES
$ prefab serve ./prefab.test.588.config.json --port=3099
See code: src/commands/serve.ts
Set/update the default value for an environment (other rules still apply)
USAGE
$ prefab set-default [NAME] --api-key <value> [--json] [--interactive] [--no-color] [--verbose]
[--confidential] [--env-var <value>] [--environment <value>] [--value <value>] [--confirm] [--secret]
[--secret-key-name <value>]
ARGUMENTS
NAME config/feature-flag/etc. name
FLAGS
--confidential mark the value as confidential
--confirm confirm without prompt
--env-var=<value> environment variable to use as default value
--environment=<value> environment to change (specify "[default]" for the default environment)
--secret encrypt the value of this item
--secret-key-name=<value> [default: prefab.secrets.encryption.key] name of the secret key to use for
encryption/decryption
--value=<value> new default value
GLOBAL FLAGS
--api-key=<value> (required) Prefab API KEY (defaults to ENV var PREFAB_API_KEY)
--[no-]interactive Force interactive mode
--json Format output as json.
--no-color Do not colorize output
--verbose Verbose output
DESCRIPTION
Set/update the default value for an environment (other rules still apply)
EXAMPLES
$ prefab set-default my.flag.name # will prompt for value and env
$ prefab set-default my.flag.name --value=true --environment=staging
$ prefab set-default my.flag.name --value=true --secret
$ prefab set-default my.config.name --env-var=MY_ENV_VAR_NAME --environment=production
See code: src/commands/set-default.ts
mise install
git submodule init
git submodule update
yarn install
yarn build
bin/dev.js
fish -c "cd ../../prefab-cloud/prefab-cli;bin/dev.js"
yarn version