Skip to content

CLI Commands

Terminal window
npm install -g @rep-protocol/cli
# or
npx @rep-protocol/cli [command]

Validate a .rep.yaml manifest against the JSON schema.

Terminal window
rep validate [--manifest <path>]
FlagDefaultDescription
-m, --manifest <path>.rep.yamlPath to manifest file

Example:

Terminal window
$ rep validate --manifest .rep.yaml
Manifest is valid
Version: 0.1.0
Variables: 11 total
- PUBLIC: 6
- SENSITIVE: 3
- SERVER: 2
Settings configured: 6

Generate TypeScript type definitions from a manifest. Creates strongly-typed overloads for rep.get() and rep.getSecure().

Terminal window
rep typegen [--manifest <path>] [--output <path>]
FlagDefaultDescription
-m, --manifest <path>.rep.yamlPath to manifest file
-o, --output <path>src/rep.d.tsOutput path for generated types

Generated output:

declare module "@rep-protocol/sdk" {
export interface REP {
get(key: "API_URL" | "FEATURE_FLAGS"): string | undefined;
getSecure(key: "ANALYTICS_KEY"): Promise<string>;
// ... other methods
}
}

Scan built JavaScript bundles for accidentally leaked secrets. Uses the same guardrail detection as the gateway (Shannon entropy, known secret formats).

Terminal window
rep lint [--dir <path>] [--pattern <glob>] [--strict]
FlagDefaultDescription
-d, --dir <path>./distDirectory to scan
--pattern <glob>**/*.{js,mjs,cjs}File pattern to scan
--strictfalseExit with error code if warnings found

Example:

Terminal window
$ rep lint --dir ./dist
dist/main.js
high_entropy:42: value has high entropy (5.23 bits/char) — may be a secret
const key = "sk_live_abc123..."
Found 1 potential secret(s) in 1 file(s)

Use cases:

  • CI/CD pipeline step before deployment
  • Pre-commit hook
  • Regular audits of production bundles

Run a local development server with the REP gateway. Loads env vars from a file and starts the gateway.

Terminal window
rep dev [options]
FlagDefaultDescription
-e, --env <path>.env.localPath to .env file
-p, --port <number>8080Gateway port
--proxy <url>Upstream proxy URL (e.g., http://localhost:5173)
--static <path>Serve static files (embedded mode)
--hot-reloadfalseEnable hot reload
--gateway-bin <path>autoPath to gateway binary

Example workflows:

Terminal window
# Proxy mode with Vite
rep dev --env .env.local --proxy http://localhost:5173
# Embedded mode with static files
rep dev --env .env.local --static ./dist --port 8080

The CLI looks for the gateway binary in this order:

  1. Bundled binary (downloaded during npm install)
  2. Custom path via --gateway-bin
  3. rep-gateway in system PATH