CLI companion for Zap credential manager - inject secrets as environment variables
Project description
Zap CLI
CLI companion for Zap credential manager - inject secrets from development sessions as environment variables.
What is Zap?
Zap is a secure credential manager with a desktop app that helps you manage API keys, tokens, and other secrets. The CLI allows you to inject these secrets directly into your development environment without exposing them in your codebase.
Installation
pip install zapc
Quick Start
1. Create a Session (Desktop App Required)
# Open Zap desktop app to create a new session
zap start
In the Zap desktop app:
- Go to Dev Mode
- Create a new session with your secrets
- The session file is automatically created
2. List Available Sessions
zap list
3. Set Session for Your Project
cd your-project/
zap use my-dev-session
This creates a zap.json file in your project directory.
4. Run Commands with Injected Secrets
# All secrets are injected as environment variables
zap run -- npm start
zap run -- python app.py
zap run -- cargo run
Commands
zap start
Opens the Zap desktop app to create a new session.
zap list [SESSION_NAME]
Lists all available sessions or secrets in a specific session.
# List all sessions
zap list
# List secrets in a specific session
zap list my-dev-session
zap use <SESSION_NAME>
Sets the current session for your project.
zap use my-dev-session
zap run -- <COMMAND>
Runs a command with secrets injected as environment variables.
# Run with current session (from zap.json)
zap run -- npm start
# Run with specific session (override)
zap run --session other-session -- python app.py
# Show loaded environment variables (verbose)
zap run -v -- npm test
# Add prefix to environment variable names
zap run --prefix MY_APP -- npm start
zap status
Shows the current session status for your project.
zap status
zap stop <SESSION_NAME>
Stops a specific session (deletes the session file).
zap stop my-dev-session
zap clear
Clears all active sessions.
zap clear
How It Works
-
Desktop App creates encrypted session files in:
- macOS:
~/Library/Application Support/com.devtool.zap/sessions/ - Windows:
%APPDATA%/com.devtool.zap/sessions/ - Linux:
~/.config/com.devtool.zap/sessions/
- macOS:
-
CLI reads these session files and decrypts secrets using AES-GCM encryption
-
Secrets are converted to environment variables:
Database Password→DATABASE_PASSWORDapi-key→API_KEYmy.secret.value→MY_SECRET_VALUE
-
Your commands run with these environment variables automatically available
Security
- ✅ Secrets are encrypted using AES-GCM with 256-bit keys
- ✅ Session keys are unique per session
- ✅ No secrets are stored in plaintext
- ✅ Environment variables only exist during command execution
- ✅ No internet connection required
Requirements
- Python 3.8 or higher
- Zap desktop app (for creating sessions)
Example Workflow
# 1. Create session with your API keys in Zap desktop app
zap start
# 2. In your project directory, set the session
cd my-web-app/
zap use production-keys
# 3. Run your development server with secrets loaded
zap run -- npm run dev
# 4. Check what's loaded
zap status
# 5. When done, stop the session
zap stop production-keys
License
MIT
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zapc-0.1.0.tar.gz.
File metadata
- Download URL: zapc-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
657c7e23bef9e6ac9e72a464a814d4c39d1fd1743a742b54a940a03da70a40ee
|
|
| MD5 |
b49cfb9d413f789016f95b1ba4a0f1a5
|
|
| BLAKE2b-256 |
af8d72c90a817fe96cd6a12782ad01a6c20ba0594ff232c5f2dce359230ab3ae
|
File details
Details for the file zapc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zapc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac685b0653d17d98a8496121bc9fe8c911216e50d027521732d92c185fdfa50b
|
|
| MD5 |
d529a5eecf8d708d4d2461dc6bab4cd2
|
|
| BLAKE2b-256 |
6239a4a114786d7fa80993a2d2a16b350ff7bd2531905a3999c2d86dde514f94
|