keypin 0.3.0 → 0.5.0
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.
- package/README.md +24 -21
- package/{chunk-p51dggc1.js → chunk-a9k9235c.js} +523 -333
- package/chunk-j6kpw8ge.js +65 -0
- package/main.js +6 -28
- package/package.json +1 -1
- package/chunk-8agfxsqt.js +0 -31
package/README.md
CHANGED
|
@@ -36,6 +36,16 @@ bun add -g keypin
|
|
|
36
36
|
In 1Password, open **Settings → Developer**. Under **Integrate with the 1Password SDKs**, select **Integrate with
|
|
37
37
|
other apps**. 1Password then asks you to approve each keypin command.
|
|
38
38
|
|
|
39
|
+
## Use with an agent
|
|
40
|
+
|
|
41
|
+
The keypin skill tells a coding agent how to use keypin: keep values out of chat and files, and hand each approval
|
|
42
|
+
back to you. It works with Claude Code, Codex, Cursor and other agents that read skills.
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npx skills add caiopizzol/keypin # this project
|
|
46
|
+
npx skills add caiopizzol/keypin -g # all your projects
|
|
47
|
+
```
|
|
48
|
+
|
|
39
49
|
## Quick start
|
|
40
50
|
|
|
41
51
|
Register a project. `keypin init` writes a commented `keypin.toml` for you to fill in:
|
|
@@ -48,35 +58,28 @@ keypin init
|
|
|
48
58
|
A key looks like this:
|
|
49
59
|
|
|
50
60
|
```toml
|
|
51
|
-
[
|
|
52
|
-
kind = "1password"
|
|
61
|
+
[1password]
|
|
53
62
|
account = "my.1password.com"
|
|
54
|
-
vault = "Private"
|
|
55
|
-
|
|
56
|
-
[keys.api-token]
|
|
57
|
-
env = "API_TOKEN"
|
|
58
|
-
owner = "my-project"
|
|
59
63
|
|
|
60
|
-
[keys.
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
[keys.API_TOKEN] # the variable your program reads
|
|
65
|
+
rotate_every = "90d"
|
|
66
|
+
dev = "op://Private/my-project dev api token/credential" # read by keypin run
|
|
63
67
|
|
|
64
|
-
[keys.
|
|
65
|
-
|
|
66
|
-
item = "my-project prod api token"
|
|
68
|
+
[keys.API_TOKEN.prod] # read by keypin publish
|
|
69
|
+
from = "op://Private/my-project prod api token/credential"
|
|
67
70
|
|
|
68
|
-
[[keys.
|
|
71
|
+
[[keys.API_TOKEN.prod.publish]] # where publish writes it
|
|
69
72
|
to = "github-actions"
|
|
70
73
|
repo = "me/my-project"
|
|
71
74
|
```
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
Each `op://` reference is a 1Password secret reference: in the item, open the field's menu and select **Copy Secret
|
|
77
|
+
Reference**. Add a `rotated` date to the item. Now use it:
|
|
75
78
|
|
|
76
79
|
```sh
|
|
77
80
|
keypin status # every key, when it's due, and any problem
|
|
78
81
|
keypin run -- npm run dev # run a command with the dev keys
|
|
79
|
-
keypin publish
|
|
82
|
+
keypin publish API_TOKEN # write the prod value to the GitHub secret
|
|
80
83
|
```
|
|
81
84
|
|
|
82
85
|
## Commands
|
|
@@ -86,13 +89,13 @@ keypin init [folder] # register a project and write a keypin.toml
|
|
|
86
89
|
keypin unregister [folder] # stop listing a project (its keypin.toml stays)
|
|
87
90
|
keypin status [--json] # every key, when it's due, and any problem
|
|
88
91
|
keypin discover [folder] # every key name a project uses, where it's set, and a draft map
|
|
89
|
-
keypin run -- <command> # run a command with the project's dev keys
|
|
90
|
-
keypin publish <
|
|
91
|
-
keypin rotate <
|
|
92
|
+
keypin run -- <command> # run a command with the project's dev keys (--env for another)
|
|
93
|
+
keypin publish <VARIABLE> # check each destination's account, then write the key
|
|
94
|
+
keypin rotate <VARIABLE> # replace a Cloudflare API token, then revoke the old one
|
|
92
95
|
```
|
|
93
96
|
|
|
94
97
|
`publish` and `rotate` show a plan and wait for you to type `yes`. `--yes` skips that only for routine updates. It
|
|
95
|
-
never approves a first write, a changed account or vault item, or a revoke.
|
|
98
|
+
never approves a first write, a changed account or vault item, or a revoke. `keypin --help` lists the exit codes.
|
|
96
99
|
|
|
97
100
|
## Docs
|
|
98
101
|
|