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.0.tar.gz (5.8 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.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: keypop-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for keypop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2575fcbfa9631a413008762754084df4b888f96335a437c7466d86e9cdb9f55c
MD5 dc9a5dca0b5d338bc8c22238d674f878
BLAKE2b-256 0f338fd99756e95528e03d32be225c31418470a93b140d09548a1b2da4446aba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: keypop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for keypop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9235445d00df2c88d4e3c05e287d2bf92cdf01fec2e0acc2ef51e3f2fbd3d7bf
MD5 d201835a3a2a4f14b4d9f247cf8dbcca
BLAKE2b-256 a96b990afcc1078336956d69f88303c1ec04b5a428903274b9dfc8859659a414

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