realvault-cli
v1.0.14
Published
Vault CLI - Manage your secrets from the command line
Readme
Vault CLI
The Vault CLI (realvault-cli) is a command-line interface for managing your secrets, projects, and SSH connections securely using the RealVault platform.
Installation
You can install the Vault CLI globally using npm:
npm install -g realvault-cliOr run it directly using npx:
npx realvault-cli <command>Authentication
Before using the CLI, you need to authenticate with your RealVault account.
Login
To log in, run:
vault loginThis will open your browser to authorize the CLI.
Options:
--dev: Use the development environment (localhost).
Check Current User
To see who is currently logged in:
vault whoamiLogout
To log out and clear your local credentials:
vault logoutProject Management
Manage your project's environment variables and secrets.
Initialize Project
Initialize Vault in your current project directory:
vault initThis will prompt you for:
- Project Name: Defaults to the current directory name.
- Target Env File: The file where secrets will be pulled to (e.g.,
.env,.env.local). - Vault ID: (Optional) Link to an existing Vault ID.
Check for Secrets
Scan your project for potential exposed secrets in your code:
vault checkPull Secrets
Pull the latest environment variables from Vault into your local environment file:
vault pullOptions:
-v, --vault <id>: Specify a Vault ID directly.
Push Secrets
Push your local environment variables to Vault:
vault pushOptions:
-v, --vault <id>: Specify a Vault ID directly.
Secret Management
Manage individual secrets stored in your Vault.
List Secrets
List all available secrets:
vault listGet Secret
Get details of a specific secret:
vault get <secret_name>Options:
-s, --show-value: Reveal the decrypted value of the secret.
Add Secret
Add a new secret interactively:
vault addYou will be prompted for the secret name, value, and optional metadata (URL, username).
Delete Secret
Delete a secret:
vault delete <secret_name>Verify Secret
Verify if a secret is valid (checks validity of the stored value if applicable):
vault verify <secret_name>SSH Management
Manage and connect to your SSH servers securely.
List Connections
List all saved SSH connections:
vault ssh listAdd Connection
Add a new SSH connection configuration:
vault ssh addYou will be prompted for:
- Connection Name
- Host/IP
- Port (default 22)
- Username
- OS Type
- Connection Type (SSH Key, Password, etc.)
Connect
Connect to a saved SSH server:
vault ssh connect <connection_name>This will automatically handle key management and establish the SSH connection.
Workspace Management
Accept Invite
Accept an invitation to a shared workspace:
vault invite accept <invite_code>