agent-keybank 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_keybank-0.1.0/LICENSE +21 -0
- agent_keybank-0.1.0/PKG-INFO +214 -0
- agent_keybank-0.1.0/README.md +189 -0
- agent_keybank-0.1.0/agent_keybank.egg-info/PKG-INFO +214 -0
- agent_keybank-0.1.0/agent_keybank.egg-info/SOURCES.txt +13 -0
- agent_keybank-0.1.0/agent_keybank.egg-info/dependency_links.txt +1 -0
- agent_keybank-0.1.0/agent_keybank.egg-info/entry_points.txt +2 -0
- agent_keybank-0.1.0/agent_keybank.egg-info/top_level.txt +1 -0
- agent_keybank-0.1.0/keybank/__init__.py +2 -0
- agent_keybank-0.1.0/keybank/__main__.py +3 -0
- agent_keybank-0.1.0/keybank/cli.py +1206 -0
- agent_keybank-0.1.0/keybank/skill/SKILL.md +102 -0
- agent_keybank-0.1.0/pyproject.toml +40 -0
- agent_keybank-0.1.0/setup.cfg +4 -0
- agent_keybank-0.1.0/tests/test_keybank.py +429 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack Ryan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-keybank
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Catalog-backed API key loader for coding agents
|
|
5
|
+
Author: Jack Ryan
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jackaldenryan/agent-keybank
|
|
8
|
+
Project-URL: Repository, https://github.com/jackaldenryan/agent-keybank
|
|
9
|
+
Project-URL: Issues, https://github.com/jackaldenryan/agent-keybank/issues
|
|
10
|
+
Keywords: keybank,api-keys,agents,skills
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# KeyBank
|
|
27
|
+
|
|
28
|
+
Tell an agent “use the development key.” It matches that phrase to a catalog entry and either writes the key into a `.env` file or sets it for the command it is about to run.
|
|
29
|
+
|
|
30
|
+
The same skill can add a new API key from a description. The only thing you paste yourself is the secret, into one file: `~/.keybank/secrets.env`.
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
1. Install the CLI.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pipx install agent-keybank
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`uv tool install agent-keybank` works too.
|
|
41
|
+
|
|
42
|
+
2. Run setup once. It creates `~/.keybank` and asks which coding agents you use, then installs the skill for those agents.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
keybank setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Non-interactive:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
keybank setup --agents all
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
keybank setup --agents claude,codex,cursor
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. Tell an agent what secrets you need. It writes the ids and descriptions. You paste each secret into `~/.keybank/secrets.env`. After that, “use the development key” is enough.
|
|
59
|
+
|
|
60
|
+
## After install
|
|
61
|
+
|
|
62
|
+
Say something like: “I need a development key and a production key for my API, both exposed as `SERVICE_API_KEY`.”
|
|
63
|
+
|
|
64
|
+
The agent adds catalog entries with ids, descriptions, and the runtime name. It does not see the secrets.
|
|
65
|
+
|
|
66
|
+
Open `~/.keybank/secrets.env` and paste the values yourself:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
service-prod=...
|
|
70
|
+
service-dev=...
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Do not ask the agent to open that file. Agents must never read it.
|
|
74
|
+
|
|
75
|
+
From then on you can say:
|
|
76
|
+
|
|
77
|
+
- “Use the development key and put it in this folder’s `.env`.”
|
|
78
|
+
- “Run this script with the production key.”
|
|
79
|
+
- “Add a staging key that maps to `SERVICE_API_KEY`.”
|
|
80
|
+
|
|
81
|
+
## Where keys live
|
|
82
|
+
|
|
83
|
+
The bank is on the machine, not in any git repo. Override the location with `KEYBANK_HOME`.
|
|
84
|
+
|
|
85
|
+
| File | Who may read it | What it holds |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `~/.keybank/catalog.yaml` | You and agents | Id, description, aliases, runtime name, public companions |
|
|
88
|
+
| `~/.keybank/secrets.env` | You and the `keybank` CLI only | The secret for each id |
|
|
89
|
+
|
|
90
|
+
`catalog.yaml` never contains secrets. `secrets.env` is mode `600` and stores values under the catalog id:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
service-prod=...
|
|
94
|
+
service-dev=...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## What setup does
|
|
98
|
+
|
|
99
|
+
`keybank setup` creates `~/.keybank/` with `catalog.yaml` and `secrets.env` if they are missing, then copies the skill into the agent folders you chose.
|
|
100
|
+
|
|
101
|
+
`--agents all` covers Claude Code, Codex, Cursor, OpenCode, Gemini, Factory, Grok, and Amp.
|
|
102
|
+
|
|
103
|
+
Re-run `keybank setup` to refresh the skill. The bank stays put. `pipx upgrade agent-keybank` (or `uv tool upgrade agent-keybank`) refreshes the CLI.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
pipx uninstall agent-keybank
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Uninstall removes the CLI. It does not delete `~/.keybank`.
|
|
110
|
+
|
|
111
|
+
## Commands
|
|
112
|
+
|
|
113
|
+
Discover keys. These print ids and descriptions, never secret values.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
keybank list
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
keybank list --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
keybank show development
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
keybank resolve "personal project"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Load a key into a folder as the runtime name the process expects.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
keybank load development --into ./scripts/my-probe/.env
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
keybank load service-dev platform-work --into ./scripts/my-probe/.env
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
keybank load service-dev --as OTHER_API_KEY --into ./scripts/my-probe/.env
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`--into DIR` writes `DIR/.env`. `--as VAR` renames the secret for one key.
|
|
146
|
+
|
|
147
|
+
Run a command with the key in the process environment and skip writing a file.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
keybank run development -- python script.py
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Add a catalog entry. Then paste the secret into `~/.keybank/secrets.env`. You can also run `keybank set-secret <id>` and type it at a hidden prompt.
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
keybank add service-dev \
|
|
157
|
+
--description "Development environment" \
|
|
158
|
+
--alias dev --alias development \
|
|
159
|
+
--maps-to SERVICE_API_KEY \
|
|
160
|
+
--public SERVICE_API_URL=https://api.dev.example.com
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Other commands: `keybank init`, `keybank remove <id> --yes`, `keybank doctor`, `keybank home`.
|
|
164
|
+
|
|
165
|
+
## Catalog format
|
|
166
|
+
|
|
167
|
+
Agents may read this file. Keep secrets out of it.
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
keys:
|
|
171
|
+
- id: service-prod
|
|
172
|
+
description: Production API, personal project
|
|
173
|
+
aliases: [prod, production]
|
|
174
|
+
maps_to: SERVICE_API_KEY
|
|
175
|
+
public:
|
|
176
|
+
SERVICE_API_URL: https://api.example.com
|
|
177
|
+
|
|
178
|
+
- id: service-dev
|
|
179
|
+
description: Development environment
|
|
180
|
+
aliases: [dev, development]
|
|
181
|
+
maps_to: SERVICE_API_KEY
|
|
182
|
+
public:
|
|
183
|
+
SERVICE_API_URL: https://api.dev.example.com
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`maps_to` is the environment variable the process should see. That is how two keys both become `SERVICE_API_KEY` at use time. `public` holds non-secret companions such as a base URL.
|
|
187
|
+
|
|
188
|
+
Prefer letting an agent run `keybank add`. Hand-edits work if you stick to this shape.
|
|
189
|
+
|
|
190
|
+
## Agent skill
|
|
191
|
+
|
|
192
|
+
The skill is one file bundled with the CLI. It follows the [Agent Skills](https://agentskills.io) standard. `keybank setup` copies it into the personal skill folders for the agents you pick.
|
|
193
|
+
|
|
194
|
+
New agent sessions pick it up from those folders. The skill tells the agent to use the CLI and to stay out of secret files.
|
|
195
|
+
|
|
196
|
+
## Security rules
|
|
197
|
+
|
|
198
|
+
The CLI is the only process that should open `secrets.env`. It never prints secret values.
|
|
199
|
+
|
|
200
|
+
Generated `.env` files are mode `600`. Add `.env` to `.gitignore` in the folder you load into.
|
|
201
|
+
|
|
202
|
+
`keybank run` is the safer option when you do not need a leftover file.
|
|
203
|
+
|
|
204
|
+
Do not put a master `.env` in a git repo root and do not ask an agent to open it.
|
|
205
|
+
|
|
206
|
+
## Tests
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
python3 -m unittest discover -s tests -v
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## License
|
|
213
|
+
|
|
214
|
+
MIT. See [LICENSE](LICENSE). Anyone can use, copy, modify, and distribute this, including commercially.
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# KeyBank
|
|
2
|
+
|
|
3
|
+
Tell an agent “use the development key.” It matches that phrase to a catalog entry and either writes the key into a `.env` file or sets it for the command it is about to run.
|
|
4
|
+
|
|
5
|
+
The same skill can add a new API key from a description. The only thing you paste yourself is the secret, into one file: `~/.keybank/secrets.env`.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
1. Install the CLI.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
pipx install agent-keybank
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`uv tool install agent-keybank` works too.
|
|
16
|
+
|
|
17
|
+
2. Run setup once. It creates `~/.keybank` and asks which coding agents you use, then installs the skill for those agents.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
keybank setup
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Non-interactive:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
keybank setup --agents all
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
keybank setup --agents claude,codex,cursor
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
3. Tell an agent what secrets you need. It writes the ids and descriptions. You paste each secret into `~/.keybank/secrets.env`. After that, “use the development key” is enough.
|
|
34
|
+
|
|
35
|
+
## After install
|
|
36
|
+
|
|
37
|
+
Say something like: “I need a development key and a production key for my API, both exposed as `SERVICE_API_KEY`.”
|
|
38
|
+
|
|
39
|
+
The agent adds catalog entries with ids, descriptions, and the runtime name. It does not see the secrets.
|
|
40
|
+
|
|
41
|
+
Open `~/.keybank/secrets.env` and paste the values yourself:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
service-prod=...
|
|
45
|
+
service-dev=...
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Do not ask the agent to open that file. Agents must never read it.
|
|
49
|
+
|
|
50
|
+
From then on you can say:
|
|
51
|
+
|
|
52
|
+
- “Use the development key and put it in this folder’s `.env`.”
|
|
53
|
+
- “Run this script with the production key.”
|
|
54
|
+
- “Add a staging key that maps to `SERVICE_API_KEY`.”
|
|
55
|
+
|
|
56
|
+
## Where keys live
|
|
57
|
+
|
|
58
|
+
The bank is on the machine, not in any git repo. Override the location with `KEYBANK_HOME`.
|
|
59
|
+
|
|
60
|
+
| File | Who may read it | What it holds |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| `~/.keybank/catalog.yaml` | You and agents | Id, description, aliases, runtime name, public companions |
|
|
63
|
+
| `~/.keybank/secrets.env` | You and the `keybank` CLI only | The secret for each id |
|
|
64
|
+
|
|
65
|
+
`catalog.yaml` never contains secrets. `secrets.env` is mode `600` and stores values under the catalog id:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
service-prod=...
|
|
69
|
+
service-dev=...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## What setup does
|
|
73
|
+
|
|
74
|
+
`keybank setup` creates `~/.keybank/` with `catalog.yaml` and `secrets.env` if they are missing, then copies the skill into the agent folders you chose.
|
|
75
|
+
|
|
76
|
+
`--agents all` covers Claude Code, Codex, Cursor, OpenCode, Gemini, Factory, Grok, and Amp.
|
|
77
|
+
|
|
78
|
+
Re-run `keybank setup` to refresh the skill. The bank stays put. `pipx upgrade agent-keybank` (or `uv tool upgrade agent-keybank`) refreshes the CLI.
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
pipx uninstall agent-keybank
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Uninstall removes the CLI. It does not delete `~/.keybank`.
|
|
85
|
+
|
|
86
|
+
## Commands
|
|
87
|
+
|
|
88
|
+
Discover keys. These print ids and descriptions, never secret values.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
keybank list
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
keybank list --json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
keybank show development
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
keybank resolve "personal project"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Load a key into a folder as the runtime name the process expects.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
keybank load development --into ./scripts/my-probe/.env
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
keybank load service-dev platform-work --into ./scripts/my-probe/.env
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
keybank load service-dev --as OTHER_API_KEY --into ./scripts/my-probe/.env
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`--into DIR` writes `DIR/.env`. `--as VAR` renames the secret for one key.
|
|
121
|
+
|
|
122
|
+
Run a command with the key in the process environment and skip writing a file.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
keybank run development -- python script.py
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Add a catalog entry. Then paste the secret into `~/.keybank/secrets.env`. You can also run `keybank set-secret <id>` and type it at a hidden prompt.
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
keybank add service-dev \
|
|
132
|
+
--description "Development environment" \
|
|
133
|
+
--alias dev --alias development \
|
|
134
|
+
--maps-to SERVICE_API_KEY \
|
|
135
|
+
--public SERVICE_API_URL=https://api.dev.example.com
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Other commands: `keybank init`, `keybank remove <id> --yes`, `keybank doctor`, `keybank home`.
|
|
139
|
+
|
|
140
|
+
## Catalog format
|
|
141
|
+
|
|
142
|
+
Agents may read this file. Keep secrets out of it.
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
keys:
|
|
146
|
+
- id: service-prod
|
|
147
|
+
description: Production API, personal project
|
|
148
|
+
aliases: [prod, production]
|
|
149
|
+
maps_to: SERVICE_API_KEY
|
|
150
|
+
public:
|
|
151
|
+
SERVICE_API_URL: https://api.example.com
|
|
152
|
+
|
|
153
|
+
- id: service-dev
|
|
154
|
+
description: Development environment
|
|
155
|
+
aliases: [dev, development]
|
|
156
|
+
maps_to: SERVICE_API_KEY
|
|
157
|
+
public:
|
|
158
|
+
SERVICE_API_URL: https://api.dev.example.com
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`maps_to` is the environment variable the process should see. That is how two keys both become `SERVICE_API_KEY` at use time. `public` holds non-secret companions such as a base URL.
|
|
162
|
+
|
|
163
|
+
Prefer letting an agent run `keybank add`. Hand-edits work if you stick to this shape.
|
|
164
|
+
|
|
165
|
+
## Agent skill
|
|
166
|
+
|
|
167
|
+
The skill is one file bundled with the CLI. It follows the [Agent Skills](https://agentskills.io) standard. `keybank setup` copies it into the personal skill folders for the agents you pick.
|
|
168
|
+
|
|
169
|
+
New agent sessions pick it up from those folders. The skill tells the agent to use the CLI and to stay out of secret files.
|
|
170
|
+
|
|
171
|
+
## Security rules
|
|
172
|
+
|
|
173
|
+
The CLI is the only process that should open `secrets.env`. It never prints secret values.
|
|
174
|
+
|
|
175
|
+
Generated `.env` files are mode `600`. Add `.env` to `.gitignore` in the folder you load into.
|
|
176
|
+
|
|
177
|
+
`keybank run` is the safer option when you do not need a leftover file.
|
|
178
|
+
|
|
179
|
+
Do not put a master `.env` in a git repo root and do not ask an agent to open it.
|
|
180
|
+
|
|
181
|
+
## Tests
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
python3 -m unittest discover -s tests -v
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
MIT. See [LICENSE](LICENSE). Anyone can use, copy, modify, and distribute this, including commercially.
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-keybank
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Catalog-backed API key loader for coding agents
|
|
5
|
+
Author: Jack Ryan
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jackaldenryan/agent-keybank
|
|
8
|
+
Project-URL: Repository, https://github.com/jackaldenryan/agent-keybank
|
|
9
|
+
Project-URL: Issues, https://github.com/jackaldenryan/agent-keybank/issues
|
|
10
|
+
Keywords: keybank,api-keys,agents,skills
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# KeyBank
|
|
27
|
+
|
|
28
|
+
Tell an agent “use the development key.” It matches that phrase to a catalog entry and either writes the key into a `.env` file or sets it for the command it is about to run.
|
|
29
|
+
|
|
30
|
+
The same skill can add a new API key from a description. The only thing you paste yourself is the secret, into one file: `~/.keybank/secrets.env`.
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
1. Install the CLI.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pipx install agent-keybank
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`uv tool install agent-keybank` works too.
|
|
41
|
+
|
|
42
|
+
2. Run setup once. It creates `~/.keybank` and asks which coding agents you use, then installs the skill for those agents.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
keybank setup
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Non-interactive:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
keybank setup --agents all
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
keybank setup --agents claude,codex,cursor
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. Tell an agent what secrets you need. It writes the ids and descriptions. You paste each secret into `~/.keybank/secrets.env`. After that, “use the development key” is enough.
|
|
59
|
+
|
|
60
|
+
## After install
|
|
61
|
+
|
|
62
|
+
Say something like: “I need a development key and a production key for my API, both exposed as `SERVICE_API_KEY`.”
|
|
63
|
+
|
|
64
|
+
The agent adds catalog entries with ids, descriptions, and the runtime name. It does not see the secrets.
|
|
65
|
+
|
|
66
|
+
Open `~/.keybank/secrets.env` and paste the values yourself:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
service-prod=...
|
|
70
|
+
service-dev=...
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Do not ask the agent to open that file. Agents must never read it.
|
|
74
|
+
|
|
75
|
+
From then on you can say:
|
|
76
|
+
|
|
77
|
+
- “Use the development key and put it in this folder’s `.env`.”
|
|
78
|
+
- “Run this script with the production key.”
|
|
79
|
+
- “Add a staging key that maps to `SERVICE_API_KEY`.”
|
|
80
|
+
|
|
81
|
+
## Where keys live
|
|
82
|
+
|
|
83
|
+
The bank is on the machine, not in any git repo. Override the location with `KEYBANK_HOME`.
|
|
84
|
+
|
|
85
|
+
| File | Who may read it | What it holds |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `~/.keybank/catalog.yaml` | You and agents | Id, description, aliases, runtime name, public companions |
|
|
88
|
+
| `~/.keybank/secrets.env` | You and the `keybank` CLI only | The secret for each id |
|
|
89
|
+
|
|
90
|
+
`catalog.yaml` never contains secrets. `secrets.env` is mode `600` and stores values under the catalog id:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
service-prod=...
|
|
94
|
+
service-dev=...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## What setup does
|
|
98
|
+
|
|
99
|
+
`keybank setup` creates `~/.keybank/` with `catalog.yaml` and `secrets.env` if they are missing, then copies the skill into the agent folders you chose.
|
|
100
|
+
|
|
101
|
+
`--agents all` covers Claude Code, Codex, Cursor, OpenCode, Gemini, Factory, Grok, and Amp.
|
|
102
|
+
|
|
103
|
+
Re-run `keybank setup` to refresh the skill. The bank stays put. `pipx upgrade agent-keybank` (or `uv tool upgrade agent-keybank`) refreshes the CLI.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
pipx uninstall agent-keybank
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Uninstall removes the CLI. It does not delete `~/.keybank`.
|
|
110
|
+
|
|
111
|
+
## Commands
|
|
112
|
+
|
|
113
|
+
Discover keys. These print ids and descriptions, never secret values.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
keybank list
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
keybank list --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
keybank show development
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
keybank resolve "personal project"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Load a key into a folder as the runtime name the process expects.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
keybank load development --into ./scripts/my-probe/.env
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
keybank load service-dev platform-work --into ./scripts/my-probe/.env
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
keybank load service-dev --as OTHER_API_KEY --into ./scripts/my-probe/.env
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`--into DIR` writes `DIR/.env`. `--as VAR` renames the secret for one key.
|
|
146
|
+
|
|
147
|
+
Run a command with the key in the process environment and skip writing a file.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
keybank run development -- python script.py
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Add a catalog entry. Then paste the secret into `~/.keybank/secrets.env`. You can also run `keybank set-secret <id>` and type it at a hidden prompt.
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
keybank add service-dev \
|
|
157
|
+
--description "Development environment" \
|
|
158
|
+
--alias dev --alias development \
|
|
159
|
+
--maps-to SERVICE_API_KEY \
|
|
160
|
+
--public SERVICE_API_URL=https://api.dev.example.com
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Other commands: `keybank init`, `keybank remove <id> --yes`, `keybank doctor`, `keybank home`.
|
|
164
|
+
|
|
165
|
+
## Catalog format
|
|
166
|
+
|
|
167
|
+
Agents may read this file. Keep secrets out of it.
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
keys:
|
|
171
|
+
- id: service-prod
|
|
172
|
+
description: Production API, personal project
|
|
173
|
+
aliases: [prod, production]
|
|
174
|
+
maps_to: SERVICE_API_KEY
|
|
175
|
+
public:
|
|
176
|
+
SERVICE_API_URL: https://api.example.com
|
|
177
|
+
|
|
178
|
+
- id: service-dev
|
|
179
|
+
description: Development environment
|
|
180
|
+
aliases: [dev, development]
|
|
181
|
+
maps_to: SERVICE_API_KEY
|
|
182
|
+
public:
|
|
183
|
+
SERVICE_API_URL: https://api.dev.example.com
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`maps_to` is the environment variable the process should see. That is how two keys both become `SERVICE_API_KEY` at use time. `public` holds non-secret companions such as a base URL.
|
|
187
|
+
|
|
188
|
+
Prefer letting an agent run `keybank add`. Hand-edits work if you stick to this shape.
|
|
189
|
+
|
|
190
|
+
## Agent skill
|
|
191
|
+
|
|
192
|
+
The skill is one file bundled with the CLI. It follows the [Agent Skills](https://agentskills.io) standard. `keybank setup` copies it into the personal skill folders for the agents you pick.
|
|
193
|
+
|
|
194
|
+
New agent sessions pick it up from those folders. The skill tells the agent to use the CLI and to stay out of secret files.
|
|
195
|
+
|
|
196
|
+
## Security rules
|
|
197
|
+
|
|
198
|
+
The CLI is the only process that should open `secrets.env`. It never prints secret values.
|
|
199
|
+
|
|
200
|
+
Generated `.env` files are mode `600`. Add `.env` to `.gitignore` in the folder you load into.
|
|
201
|
+
|
|
202
|
+
`keybank run` is the safer option when you do not need a leftover file.
|
|
203
|
+
|
|
204
|
+
Do not put a master `.env` in a git repo root and do not ask an agent to open it.
|
|
205
|
+
|
|
206
|
+
## Tests
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
python3 -m unittest discover -s tests -v
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## License
|
|
213
|
+
|
|
214
|
+
MIT. See [LICENSE](LICENSE). Anyone can use, copy, modify, and distribute this, including commercially.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
agent_keybank.egg-info/PKG-INFO
|
|
5
|
+
agent_keybank.egg-info/SOURCES.txt
|
|
6
|
+
agent_keybank.egg-info/dependency_links.txt
|
|
7
|
+
agent_keybank.egg-info/entry_points.txt
|
|
8
|
+
agent_keybank.egg-info/top_level.txt
|
|
9
|
+
keybank/__init__.py
|
|
10
|
+
keybank/__main__.py
|
|
11
|
+
keybank/cli.py
|
|
12
|
+
keybank/skill/SKILL.md
|
|
13
|
+
tests/test_keybank.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
keybank
|