Skip to main content

Installation

The RedPennon CLI scans your codebase for flag references and reports them. It is the engine behind code references and the GitHub Action.

Install​

npm install -g @redpennon/cli

This installs two equivalent binaries: rp (short) and redpennon.

rp --version
rp help

Authentication​

Commands that talk to the API need an organisation API token (rpa_…), created under Settings → API tokens in the app. See Authentication → Organisation API tokens.

Provide it in priority order:

  1. --api-token rpa_… flag.
  2. RP_API_TOKEN environment variable.
  3. An auth config file resolved from the CLI config directory.
export RP_API_TOKEN=rpa_xxxxxxxxxxxxxxxxxxxxxxxx

To store the token for local use instead, run rp auth login. It reads the token from a hidden prompt (or piped stdin) and writes auth.json to the CLI config directory with mode 0600:

rp auth login # hidden prompt
echo "$REDPENNON_API_TOKEN" | rp auth login # piped stdin
rp auth logout # remove the stored token

rp auth login --api-token rpa_… also works, but the token lands in your shell history. If auth.json is ever readable by group or other users (non-Windows), commands print a warning with the chmod 600 fix. rp status shows only the rpa_ prefix of the token.

rp usages is side-effect-free and can run with --no-api and no token at all; only commands that read or post project data need credentials.

Project and API base URL​

OptionEnvPurpose
--project <key>RP_PROJECT_KEYSelects the project to report against.
--api-url <url>RP_API_URLOverrides the API base URL (self-hosted / development). Must be https://; plain http:// is allowed only for localhost, 127.0.0.1 and [::1].

API requests time out after 30 seconds and are retried (up to 3 attempts, with backoff) on network errors and 5xx responses. 4xx responses fail immediately.

Common commands​

CommandDescription
rp usagesScan the working tree and print flag-key references. Never posts. See Usages.
rp publishScan and post the snapshot to the API from any CI. See Publish.
rp auth login / rp auth logoutStore or remove the API token in the CLI config directory.
rp keysFetch the project's variable keys (backs --only-unused).
rp repo initScaffold a .redpennon/config.yml.
rp statusShow resolved auth, project, and API URL.
rp autocompleteSet up shell completion.