npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@prefab-cloud/prefab

v0.4.4

Published

Prefab CLI

Downloads

385

Readme

Prefab CLI

Usage

$ npm install -g @prefab-cloud/prefab
$ prefab COMMAND
running command...
$ prefab (--version)
@prefab-cloud/prefab/0.4.4 darwin-arm64 node-v20.10.0
$ prefab --help [COMMAND]
USAGE
  $ prefab COMMAND
...

Commands

prefab create 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

prefab download

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

prefab generate-new-hex-key

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

prefab get [NAME]

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

prefab info [NAME]

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

prefab interactive

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

prefab list

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

prefab override [NAME]

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

prefab serve DATA-FILE

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

prefab set-default [NAME]

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