Skip to content

Commit d2510b6

Browse files
arimxyerclaude
andauthored
docs: surface pass-cli's AI-agent integration across README and docs (#149)
The AI-agent capabilities (env injection via exec/export/inject, the background agent, and the new `skills` command) were real but buried in docs/05-operations — the README never mentioned AI agents at all, and the docs landing page had no entry. A human or research-agent evaluating pass-cli as "a password manager my AI agent can use safely" couldn't tell it fit. Make it discoverable without rebranding — the command-line 1Password/Bitwarden identity stays primary; agent-readiness is surfaced as a differentiator: - New front-door guide docs/02-guides/ai-agents.md: the safety model plus exec/export/inject, the background agent (POSIX-only), and `skills`. - README: an "AI Agent Ready" feature bullet, a scannable "AI Agent Integration" section (research agents read the raw README directly), and a Documentation link. - Docs landing + Guides grid: Quick Links / Features / card entries. - Scripting Guide: a reciprocal pointer to the agent guide. All copy grounded in shipped behavior; cross-links use the existing ../section/page pattern (reference docs in 05-operations left in place). Claude-Session: https://claude.ai/code/session_014kVLjbUL4F4CkoA7RbMYy8 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 01c7fc2 commit d2510b6

5 files changed

Lines changed: 159 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Pass-CLI is a fast, secure password and API key manager that stores credentials
2424
- **Health Checks**: Built-in `doctor` command for vault verification and troubleshooting
2525
- **Cross-Platform**: Single binary for Windows, macOS (Intel/ARM), and Linux (amd64/arm64)
2626
- **Script-Friendly**: Clean output modes (`--quiet`, `--field`, `--masked`) for shell integration
27+
- **AI Agent Ready**: Purpose-built for AI coding agents — inject secrets into a command's environment with `exec` so they never reach the chat transcript, logs, or files; plus a background agent for promptless access and self-served, version-matched agent skills (`pass-cli skills`)
2728
- **Usage Tracking**: Automatic tracking of where credentials are used across projects
2829
- **Local-First**: Works offline by default, optional cloud sync via rclone
2930
- **Cloud Sync**: Sync vault across devices with rclone (Google Drive, Dropbox, OneDrive, S3, etc.)
@@ -161,6 +162,30 @@ pass-cli doctor
161162

162163
For complete command reference, flags, and examples, see [docs/03-reference/command-reference.md](docs/03-reference/command-reference.md).
163164

165+
## AI Agent Integration
166+
167+
Pass-CLI is built to be driven safely by **AI coding agents** (Claude Code, Cursor, Codex, and similar) — not just humans at a keyboard. An agent can use your real credentials to run real commands **without the secret ever landing in the chat transcript, a log, or a file the agent's harness watches** — the leak path that plagues copy-pasting or `echo`-ing secrets.
168+
169+
```bash
170+
# Hand a secret to a command — injected into the child's environment only,
171+
# never on stdout, the clipboard, or shell history
172+
pass-cli exec --set GITHUB_TOKEN=github -- gh repo list
173+
174+
# Materialize a composite secret (a config file or connection string)
175+
echo 'postgres://app:${pass:db/password}@localhost/app' | pass-cli inject
176+
177+
# Unlock once, then resolve promptlessly for the rest of the session (POSIX)
178+
pass-cli agent start
179+
180+
# The CLI serves its own version-matched agent guide — agents read this first
181+
pass-cli skills get core
182+
pass-cli skills install # drop a discovery stub into ~/.claude/skills or ~/.agents/skills
183+
```
184+
185+
The agent story combines **env injection** (`exec` / `export` / `inject`, with `base64`/`basicauth` value filters), an optional **background agent** that holds the unlocked vault for promptless access, and a **`skills`** command that ships the agent usage guide *inside the binary* so the guidance never drifts from the installed version.
186+
187+
For the full workflow and the safety model, see the [AI Agent Integration guide](docs/02-guides/ai-agents.md).
188+
164189
## Security
165190

166191
**Encryption**:
@@ -205,6 +230,7 @@ For complete security details, best practices, and migration guides, see [docs/0
205230
**Essential Guides**:
206231
- [Getting Started](docs/01-getting-started/quick-start.md) - First-time setup and basic workflows
207232
- [Usage Guide](docs/03-reference/command-reference.md) - Complete command reference, TUI shortcuts, configuration
233+
- [AI Agent Integration](docs/02-guides/ai-agents.md) - Let AI coding agents use your credentials safely (env injection, background agent, `skills`)
208234
- [Installation](docs/01-getting-started/quick-install.md) - All installation methods and package managers
209235
- [Recovery Phrase](docs/02-guides/recovery-phrase.md) - BIP39 recovery phrase setup and vault recovery
210236
- [Security](docs/03-reference/security-architecture.md) - Encryption details, best practices, migration guides

docs/02-guides/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Task-oriented guides for common pass-cli workflows and features.
77

88
{{< cards >}}
99
{{< card link="basic-workflows" title="Basic Workflows" icon="cursor-click" subtitle="Daily operations - list, update, delete, generate credentials" >}}
10+
{{< card link="ai-agents" title="AI Agent Integration" icon="sparkles" subtitle="Let AI coding agents use your credentials without leaking them" >}}
1011
{{< card link="recovery-phrase" title="Recovery Phrase" icon="shield-check" subtitle="BIP39 recovery phrase setup and vault recovery" >}}
1112
{{< card link="keychain-setup" title="Keychain Setup" icon="key" subtitle="Configure OS keychain integration for password storage" >}}
1213
{{< card link="usage-tracking" title="Usage Tracking" icon="chart-bar" subtitle="Automatic credential usage tracking by working directory" >}}

docs/02-guides/ai-agents.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: "AI Agent Integration"
3+
weight: 6
4+
toc: true
5+
---
6+
7+
pass-cli is built to be driven safely by **AI coding agents** (Claude Code,
8+
Cursor, Codex, Continue, and similar) — not just humans at a keyboard. An agent
9+
can use your real credentials to run real commands **without the secret ever
10+
landing in the chat transcript, a log, CI output, or a file the agent's harness
11+
watches**.
12+
13+
This is the differentiator: most ways of handing a secret to an agent — pasting
14+
it, `echo`-ing it, capturing it into a shell variable — leak it into the
15+
conversation log the moment they happen. pass-cli exists to move a secret from
16+
your encrypted vault into the process that needs it through a channel the
17+
transcript never sees.
18+
19+
## The safety model
20+
21+
> **Never let a secret value reach the transcript, a log, or a watched file.**
22+
> Once a secret is in the conversation log on disk it is compromised and must be
23+
> rotated.
24+
25+
Everything below is a way to satisfy that rule. The default — `exec` — passes
26+
the secret **only** through a child process's environment, so it never touches
27+
stdout, the clipboard, or shell history.
28+
29+
## Hand a secret to a command — `exec`
30+
31+
The primary tool. Runs a command with credentials injected as environment
32+
variables; pass-cli writes nothing of its own to stdout, and the child's exit
33+
code is propagated unchanged.
34+
35+
```bash
36+
# Explicit mapping: ENV_NAME=service
37+
pass-cli exec --set GITHUB_TOKEN=github -- gh repo list
38+
39+
# Multiple credentials at once
40+
pass-cli exec --set AWS_ACCESS_KEY_ID=aws-id --set AWS_SECRET_ACCESS_KEY=aws-secret -- aws s3 ls
41+
42+
# Convenience form: derive the env name from the service (openai-api -> OPENAI_API)
43+
pass-cli exec openai-api -- python train.py
44+
```
45+
46+
`exec` is read-only: it records no usage and triggers no sync push, so it is safe
47+
to call on a hot path.
48+
49+
## Composite and derived secrets — `export` and `inject`
50+
51+
- **`export`** prints shell statements to load credentials into the current
52+
shell (`eval "$(pass-cli export --set GITHUB_TOKEN=github)"`). A weaker
53+
boundary than `exec` — prefer `exec` when you only need to launch a command.
54+
- **`inject`** renders a template, replacing `${pass:service/field}` references
55+
with values — the tool for a config file or a connection string that *embeds* a
56+
secret:
57+
58+
```bash
59+
echo 'postgres://app:${pass:db/password}@localhost/app' | pass-cli inject
60+
```
61+
62+
References support value filters — `base64`, `base64url`, and `basicauth`
63+
(`base64("user:pass")` for an HTTP `Authorization: Basic` header) — so an agent
64+
never has to shell out to `base64` and risk the value on stdout:
65+
66+
```bash
67+
echo 'Authorization: Basic ${pass:api | basicauth}' | pass-cli inject
68+
```
69+
70+
## Promptless access — the background agent
71+
72+
For a session where an agent resolves many credentials, the optional background
73+
agent unlocks the vault once and holds it in memory, so `exec`/`export`/`inject`
74+
need **no master-password prompt and no key derivation** on each call:
75+
76+
```bash
77+
pass-cli agent start # unlock once, then background itself
78+
pass-cli exec --set GITHUB_TOKEN=github -- gh repo list # resolves via the agent, no prompt
79+
pass-cli agent stop # zero secrets and stop
80+
```
81+
82+
It serves resolved field **values only** — the master password and derived key
83+
never leave the agent process — and auto-locks after inactivity (`--idle`,
84+
default 15m) and always after `--max-ttl` (default 8h). When no agent is running,
85+
every command **transparently falls back** to opening the vault directly, so the
86+
agent is a pure optimization, never a dependency. POSIX only for now; on Windows
87+
commands fall back to direct-open. See the [Background Agent](../05-operations/agent)
88+
reference for details.
89+
90+
## Self-describing: `pass-cli skills`
91+
92+
pass-cli ships an **agent usage guide inside the binary**, so an agent can load
93+
version-matched guidance straight from the CLI — the instructions never drift
94+
from the installed version:
95+
96+
```bash
97+
pass-cli skills get core # safe-usage guide: exec/export/inject/agent/list/get + leak traps
98+
pass-cli skills get core --full # also include the full command reference
99+
pass-cli skills list # list every skill shipped with this version
100+
```
101+
102+
To make an agent discover pass-cli automatically, install a small discovery stub
103+
into its skills directory:
104+
105+
```bash
106+
pass-cli skills install # auto-detects ~/.claude/skills or ~/.agents/skills
107+
```
108+
109+
The stub is intentionally thin — it points the agent at `pass-cli skills get
110+
core`, and the real, version-matched guidance stays in the binary. See
111+
[AI Agent Skills](../05-operations/agent-skills) for the full command.
112+
113+
## Quickstart for agents
114+
115+
An agent working on a user's machine can bootstrap in three commands:
116+
117+
```bash
118+
pass-cli skills get core # learn the safe-usage rules
119+
pass-cli list -q # discover available service names (no secrets)
120+
pass-cli exec --set API_KEY=some-service -- <cmd> # run a command with the secret injected
121+
```
122+
123+
## Learn more
124+
125+
- [Command Reference](../03-reference/command-reference) — every command and flag
126+
- [Background Agent](../05-operations/agent) — the promptless daemon in depth
127+
- [AI Agent Skills](../05-operations/agent-skills) — the `skills` command
128+
- [Scripting Guide](scripting-guide) — non-agent automation and output modes

docs/02-guides/scripting-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ toc: true
66

77
Automate pass-cli with scripts using quiet mode, JSON output, and environment variable integration.
88

9+
> **Using an AI coding agent?** See the [AI Agent Integration](ai-agents) guide for the safe way to hand secrets to agents — injected into a command's environment, never through the chat transcript.
10+
911
## Output Modes
1012

1113
Pass-CLI supports multiple output modes for different use cases.

docs/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Welcome to the **pass-cli** documentation. A secure, cross-platform, always-free
1717
- [Quick Start](01-getting-started/quick-start) - First-time setup and initialization (5 minutes)
1818
- [Quick Install](01-getting-started/quick-install) - Installation instructions for all platforms
1919
- [Command Reference](03-reference/command-reference) - Complete command reference
20+
- [AI Agent Integration](02-guides/ai-agents) - Let AI coding agents use your credentials safely
2021
- [Recovery Phrase](02-guides/recovery-phrase) - BIP39 recovery phrase setup and usage
2122
- [Backup & Restore Guide](02-guides/backup-restore) - Manual vault backup management
2223
- [TOTP & 2FA Support](02-guides/totp-guide) - Store and generate 2FA codes
@@ -30,6 +31,7 @@ Welcome to the **pass-cli** documentation. A secure, cross-platform, always-free
3031
- **Cross-Platform**: Works on Windows, macOS, and Linux
3132
- **Keychain Integration**: Optional OS keychain support for automatic unlocking
3233
- **Interactive TUI**: Beautiful terminal UI built with tview
34+
- **AI Agent Ready**: Hand secrets to AI coding agents via env injection — never through the chat transcript
3335
- **Clipboard Support**: Secure clipboard integration with auto-clear
3436
- **Usage Tracking**: Per-credential usage statistics
3537
- **Audit Logging**: HMAC-signed audit logs for all operations

0 commit comments

Comments
 (0)