Class

CredentialsCommand

CredentialsCommand()

Constructor

# new CredentialsCommand()

Provides a secure alternative to plaintext token files by resolving secrets from environment variables, the OS keychain (macOS Keychain, Linux libsecret/keyring), or — as a deprecated fallback — legacy plaintext files. Supports get, store, setup, and git-helper actions.

Command-line tool for managing secrets via the OS keychain.

View Source cli/commands/credentials.ts, line 204

Example
```sh
# Resolve the npm token (prints to stdout)
credentials --action get --name npm

# Store a custom secret in the keychain
credentials --action store --name my-api --service "my-app:api" --account "default" --value "secret123"

# Interactive one-time enrollment
credentials --action setup

# Configure the OS-native git credential helper
credentials --action git-helper
```

Extends

Members

Logger

# log

Static logger for the Command class.

Static logger for the Command class.

Inherited From:

View Source cli/command.ts, line 29

Methods

# async protected checkRequirements() → {Promise.<void>}

Retrieves the list of dependencies and compares it against the required dependencies for the command.

Checks if all required dependencies are present.

sequenceDiagram participant Command participant getDependencies participant Set Command->>getDependencies: Call getDependencies-->>Command: Return {prod, dev, peer} Command->>Set: Create Set from prod, dev, peer Set-->>Command: Return unique dependencies Command->>Command: Compare against requirements alt Missing dependencies Command->>Command: Add to missing list end Note over Command: If missing.length > 0, handle missing dependencies
Overrides:

View Source cli/command.ts, line 65

A promise that resolves when the check is complete.

Promise.<void>

# async execute() → {Promise.<(R|string|void)>}

This method handles the overall execution flow of the command, including parsing arguments, setting up logging, checking for version or help requests, and running the command.

Executes the command.

sequenceDiagram participant Command participant UserInput participant Logging participant getPackageVersion participant printBanner Command->>UserInput: parseArgs(inputs) UserInput-->>Command: Return ParseArgsResult Command->>Command: Process options Command->>Logging: setConfig(options) alt version requested Command->>getPackageVersion: Call getPackageVersion-->>Command: Return version else help requested Command->>Command: help(args) else banner requested Command->>printBanner: Call end Command->>Command: run(args) alt error occurs Command->>Command: Log error end Command-->>Command: Return result
Overrides:

View Source cli/command.ts, line 118

A promise that resolves with the command's result.

Promise.<(R|string|void)>

# protected help(args) → {void}

This method should be overridden in derived classes to provide specific help information.

Provides help information for the command.

Parameters:
Name Type Description
args ParseArgsResult

The parsed command-line arguments.

Overrides:

View Source cli/command.ts, line 83

void

# abstract protected run(answers) → {Promise.<(R|string|void)>}

This method should be implemented in derived classes to define the command's behavior.

Runs the command with the provided arguments.

Parameters:
Name Type Description
answers ParseArgsResult

The parsed command-line arguments.

Overrides:

View Source cli/command.ts, line 209

A promise that resolves with the command's result.

Promise.<(R|string|void)>