Skip to main content

Simple CLI tool for storing and managing API keys

Project description

keypop

PyPI version Python versions License Downloads

Simple CLI tool and Python library for storing and managing API keys securely.

Features

  • CLI — easy commands: keypop add openai sk-xxx
  • Python Library — use in scripts: import keypop; keypop.get_key("openai")
  • Export — migrate to .env files

Installation

Using pipx (recommended)

pipx install keypop

Using pip

pip install keypop

Quick Start

CLI

Add a key

keypop add openai sk-xxx

Get a key

keypop get openai

List all keys

keypop list

Export to .env

keypop export .env

Update a key

keypop update openai sk-new-key

Remove a key

keypop remove openai

Python Library

pip install keypop
import keypop

# Get single key
api_key = keypop.get_key("openai")

# Get all keys as dict
keys = keypop.all_keys()

CLI Commands

add

Add a new API key.

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

get

Get a stored API key.

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

Options:

  • --unmasked — show full key
  • --to-env — write to .env file

list

List all stored keys.

keypop list

update

Update an existing key.

keypop update <name> [new_key]

remove

Remove a stored key.

keypop remove <name>

export

Export all keys to .env file.

keypop export [file]

version

Show version.

keypop --version

Configuration

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

Security

Prevent keys from saving in shell history

Add to ~/.zshrc or ~/.bashrc:

export HISTIGNORE="keypop"

Then run: source ~/.zshrc


License

MIT License — see LICENSE (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.2.0.tar.gz (6.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.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for keypop-0.2.0.tar.gz
Algorithm Hash digest
SHA256 60b9cf482eff24901d07fb340661405df86d7f274d99909c1d1b992c4005ff80
MD5 6f357dd0c5a09b6b1d698e7ba47e82dd
BLAKE2b-256 d7c4843daf70a09abef991719945c71e2b86719ea9bcc36dd2ce1e1f58adcdee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: keypop-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 397e28175cbed5dc4ea92b5f70ba0921b6d28f945e977c8d356d5130ebe74943
MD5 c99bd50850ea406b3eb9a990d27f83aa
BLAKE2b-256 89bb18f347984c46d619ac4e8d52a01fffc6222caecdca62c5d17ad1fa660d73

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