1.0.12 • Published 6 months ago

@papavault/cli v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Papa Vault CLI

A command-line interface for interacting with the Papa Vault Secret Manager.

Visit papavault.com to learn more about Papa Vault.

Installation

Option 1: Using npm

npm install -g @papavault/cli

Option 2: Using the installation script

curl -fsSL https://raw.githubusercontent.com/papavault/cli/main/install.sh | bash

Option 3: Using npx

npx @papavault/cli

Usage

Authentication

Authenticate with Papa Vault using your API token:

papavault login

You can also provide the token directly:

papavault login --token YOUR_API_TOKEN

Alternative authentication methods:

  • Set the PAPAVAULT_TOKEN environment variable
  • Create a .env.papavault file in your project directory with PAPAVAULT_TOKEN=YOUR_API_TOKEN

Project Configuration

Set up your project and environment for secret syncing:

papavault set-project

This will guide you through selecting a project and environment. The configuration will be saved in a .papavault.json file in your current directory.

You can also specify the project ID and stage directly:

papavault set-project --project-id YOUR_PROJECT_ID --stage YOUR_STAGE

Syncing Secrets

Sync secrets from Papa Vault to your local environment:

papavault sync

This will download all credential files for the configured project and environment.

Important: All files are synced relative to the location of the .papavault.json configuration file. The CLI will search for this file starting from your current directory and moving up through parent directories until it finds one.

For example, if your .papavault.json is in /path/to/project/ and a credential file path is specified as config/secrets.json, the file will be synced to /path/to/project/config/secrets.json.

Handling Special Paths

The CLI handles several special path cases:

  • Absolute Paths: If a credential file path is specified as an absolute path (starting with /), the CLI will automatically convert it to a relative path by removing the leading slash. For example, if a credential file path is specified as /config/secrets.json, it will be treated as config/secrets.json and synced relative to the location of the .papavault.json file.

  • Root Path: If a credential file path is specified as just /, the CLI will place the file directly in the directory where the .papavault.json file is located, using the filename from the credential file.

  • Directory Paths: If a credential file path resolves to a directory, the CLI will automatically append the filename to the path to ensure the file is created correctly.

Troubleshooting Sync Issues

If you encounter issues with the sync command, you can enable debug mode to get more detailed information:

papavault sync --debug

This will output detailed logs about the file paths and operations being performed, which can help identify the root cause of any issues.

Checking Status

Check your current authentication and project status:

papavault status

Listing Projects

List all available projects and their environments:

papavault list-projects

Logging Out

Remove your stored API token:

papavault logout

Configuration File

The CLI uses a .papavault.json file in your project directory to store the project ID and stage:

{
  "projectId": "your-project-id",
  "stage": "your-environment-id"
}

The CLI will search for this file starting from your current working directory and moving up through parent directories. This allows you to run commands from any subdirectory within your project.

Help

For help with any command, use the --help flag:

papavault --help
papavault sync --help
1.0.12

6 months ago

1.0.11

6 months ago

1.0.9

6 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago