Skip to main content

Simple CLI tool for storing and managing API keys

Project description

keypop

Simple CLI tool for storing and managing API keys securely.

Installation

Using pipx (recommended)

pipx install keypop

Using pip

pip install keypop

Quick Start

# Add your first key
keypop add openrouter sk-xxx...

# Get a key (masked by default) or export to .env
keypop get openrouter

keypop get openrouter --to-env .env

# List all keys
keypop list

# Export all keys to .env file
keypop export .env

# Update a key
keypop update openai sk-new-key

# Remove a key
keypop remove openai

Commands

add

Add a new API key.

keypop add              # Interactive mode
keypop add <name> <key>  # Non-interactive mode

Examples:

keypop add openai sk-abc123
keypop add github ghp_xxxxxxxxxxxx

If a key with the same name exists, you'll be prompted to overwrite.


get

Get a stored API key by name.

keypop get <name> [--unmasked] [--to-env <file>]

Options:

  • --unmasked - Show the full key instead of masked version
  • --to-env <file> - Write key to .env file (format: NAME=KEY)

Examples:

keypop get openai
keypop get openai --unmasked
keypop get openai --to-env .env.local

list

List all stored keys.

keypop list

Output:

NAME       KEY
------------------------------
openai     sk-abc***23
github     ghp_xxx***yz

update

Update an existing key's value.

keypop update <name> [new_key]

Options:

  • Interactive mode if no arguments provided
  • Non-interactive mode with name and new_key
  • If key doesn't exist, prompts to create new one

Examples:

keypop update openai sk-new-key
keypop update openai        # Interactive mode

remove

Remove a stored key.

keypop remove <name>

You'll be prompted for confirmation before deletion.

Example:

keypop remove openai

export

Export all keys to a .env file.

keypop export [file]

Options:

  • file - Target file path (default: .env)

Example:

keypop export .env
keypop export .env.production

Output format:

openai=sk-abc123
github=ghp_xxxxx

--version

Show version information.

keypop --version

Output: keypop CLI v0.1.0


Configuration

  • Storage location: ~/.config/keypop/keys.json
  • Created automatically on first use

Security

Prevent keys from saving in shell history

When using keypop in interactive mode, keys are typed as input and may be saved in your shell history. To prevent this:

  1. Open your shell config file:

    nano ~/.zshrc   # for Zsh
    # or
    nano ~/.bashrc  # for Bash
    
  2. Add this line at the end:

    export HISTIGNORE="*keypop*"
    
  3. Save and apply:

    source ~/.zshrc   # for Zsh
    # or
    source ~/.bashrc  # for Bash
    

Now all commands containing "keypop" will be ignored in your history.

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keypop-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keypop-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file keypop-0.1.1.tar.gz.

File metadata

  • Download URL: keypop-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for keypop-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b7730fc1ea21e1e71eda17099f344548d8df4725a6fdace283f0f129b81e8688
MD5 06b5cd193b73a4c55a320d44c1519200
BLAKE2b-256 83f49f32fc96ba8368e70985beb720bc988d9b2b788b69c6b76b1a593067c465

See more details on using hashes here.

File details

Details for the file keypop-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: keypop-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for keypop-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27e090680f564623b57be2f23a36e256abb6d74dc87949dea43b999f550dc386
MD5 0b528bc35d3aa23afb422a2d64058cfd
BLAKE2b-256 e96ae949ac420702f9118d3e903b2d976c6e0bfc7e1318e865d09d7d1eee1666

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page