Skip to content
/ pacli Public

pacli is a secure, local-first secrets manager that stores your passwords, API keys, and SSH credentials with encryption and master password protection - no cloud dependencies required.

License

Notifications You must be signed in to change notification settings

imShakil/pacli

Repository files navigation

pacli-logo


🔐 pacli - Secrets Management CLI

Build Status pre-commit.ci status PyPI version PyPI Downloads Python Versions License security:bandit

pacli is a secure, local-first secrets manager that stores your passwords, API keys, and SSH credentials with encryption and master password protection - no cloud dependencies required.

Features

  • Securely store and manage secrets locally
  • Master password protection
  • Support separate options for token, password, and SSH connections
  • Add, retrieve, update, and delete secrets
  • Copy secrets directly to your clipboard
  • SSH connection management with key file support
  • URL shortening with LinklyHQ integration
  • Export list of secrets into JSON or CSV file
  • Easy-to-use command-line interface

Installation

pip install pacli-tool

Usage

To see all available commands and options:

pacli --help

Common Commands

Command Description
init Initialize pacli and set a master password
add Add a secret with a label
get Retrieve secrets by label
get-by-id Retrieve a secret by its ID
update Update old secret by label
update-by-id Update old secret by its ID
list List all saved secrets
delete Delete a secret by label
delete-by-id Delete a secret by its ID
ssh Connect to SSH server using saved credentials
short Shorten URLs using LinklyHQ service
cc Copy stdin content to clipboard
change-master-key Change the master password without losing data
export Export secrets to JSON or CSV format
version Show the current version of pacli

Examples

Adding and Retrieving Secrets

# Initialize pacli (run once)
pacli init

# Add a password
pacli add --pass github

# Add a token
pacli add --token api-key

# Add SSH connection
pacli add --ssh ec2-vm user:192.168.1.100

# Add SSH connection with key file
pacli add --ssh ec2-vm user:192.168.1.100 --key ~/.ssh/id_rsa

# Retrieve a secret
pacli get github

# Connect via SSH
pacli ssh ec2-vm

# Export secrets to JSON
pacli export --format json --output my_secrets.json

# Export secrets to CSV
pacli export --format csv --output my_secrets.csv

# Shorten a URL
pacli short https://example.com/very/long/url

# Shorten with custom name and copy to clipboard
pacli short https://example.com -n "My Link" --clip

# Copy file content to clipboard
cat file.txt | pacli cc

# Copy command output to clipboard
echo "Hello World" | pacli cc

# Copy API response to clipboard
curl -s https://api.example.com/data | pacli cc

Display Format

  • Credentials are shown as: username:password
  • SSH connections are shown as: user:ip or user:ip (Key: /path/to/key)

Copy to Clipboard

To copy a secret directly to your clipboard, use the --clip option:

pacli get google --clip

Pipeline Usage

Use pacli cc to copy any command output or file content to clipboard:

# Copy file contents
cat ~/.ssh/id_rsa.pub | pacli cc

# Copy command output
ls -la | pacli cc

# Copy JSON response
curl -s https://api.github.com/user | pacli cc

For more information, use pacli --help or see the documentation.

Tips

Avoid Master Password Prompts

To avoid entering your master password repeatedly, you can set it as an environment variable:

# For current session only
export PACLI_MASTER_PASSWORD="your-master-password"

# Or add to your shell profile for permanent use
echo 'export PACLI_MASTER_PASSWORD="your-master-password"' >> ~/.bashrc  # For bash
echo 'export PACLI_MASTER_PASSWORD="your-master-password"' >> ~/.zshrc   # For zsh

Security Note: Adding the password to your shell profile makes it persistent but less secure. Use the session-only approach for better security.

URL Shortening Setup

To use the URL shortening feature, set up your LinklyHQ credentials as environment variables:

# Set LinklyHQ credentials
export PACLI_LINKLYHQ_KEY="your_api_key"
export PACLI_LINKLYHQ_WID="your_workspace_id"

# Add to your shell profile for permanent use
echo 'export PACLI_LINKLYHQ_KEY="your_api_key"' >> ~/.bashrc
echo 'export PACLI_LINKLYHQ_WID="your_workspace_id"' >> ~/.bashrc

Visits here to get your credentials.

Demo

demo

About

pacli is a secure, local-first secrets manager that stores your passwords, API keys, and SSH credentials with encryption and master password protection - no cloud dependencies required.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages