herdr-secret 0.0.0-stage → 0.1.1

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -2
  3. package/cli.js +93 -0
  4. package/package.json +12 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mazemaker
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.
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # herdr-secret
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/herdr-secret)](https://www.npmjs.com/package/herdr-secret)
4
+ [![test](https://github.com/mazemaker/herdr-secret/actions/workflows/test.yml/badge.svg)](https://github.com/mazemaker/herdr-secret/actions/workflows/test.yml)
5
+ [![license](https://img.shields.io/npm/l/herdr-secret)](https://github.com/mazemaker/herdr-secret/blob/main/LICENSE)
6
+
7
+ Let your coding agents ask you for credentials without the value ever entering their chat.
8
+
9
+ An agent runs `herdr-secret ask`. A form pops up in your [herdr](https://herdr.dev) session,
10
+ you type the value there, and it goes straight into your operating system's credential store.
11
+ The agent only gets back whether you answered.
12
+
13
+ ![An agent asks for a database login; the human fills it in a herdr popup](https://raw.githubusercontent.com/mazemaker/herdr-secret/main/docs/form.png)
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npx herdr-secret@latest
19
+ ```
20
+
21
+ Works on macOS, Linux and Windows. It installs the herdr plugin from
22
+ [GitHub](https://github.com/mazemaker/herdr-secret) (herdr shows what it will run and asks
23
+ first), then walks you through setup:
24
+
25
+ - checks that your credential store works,
26
+ - puts the `herdr-secret` command on your PATH,
27
+ - offers to teach the agents it finds (Claude Code, Codex, OpenCode, Gemini CLI) to ask
28
+ through it instead of asking you to paste credentials,
29
+ - lets you try the form once.
30
+
31
+ `npx herdr-secret uninstall` removes everything setup added.
32
+
33
+ ## Where values go
34
+
35
+ - **macOS:** login Keychain
36
+ - **Windows:** Credential Manager
37
+ - **Linux:** Secret Service (GNOME Keyring, KWallet). Without one, setup asks before falling
38
+ back to 0600 files.
39
+
40
+ Values never pass through a command line or a log, and the popup is not a herdr pane, so an
41
+ agent cannot read it.
42
+
43
+ ## Trust
44
+
45
+ - No dependencies. This package is one small script that finds herdr and Python and hands over
46
+ to the plugin.
47
+ - Published from GitHub Actions with npm provenance: the attestation on each version names the
48
+ commit and workflow run that built it.
49
+ - [What it protects and what it doesn't](https://github.com/mazemaker/herdr-secret#what-this-does-and-doesnt-protect),
50
+ and [how to report a security problem](https://github.com/mazemaker/herdr-secret/blob/main/SECURITY.md).
51
+
52
+ Requires herdr 0.9.5+, Python 3.8+ (the plugin runs on it), and Node 18+ for this installer.
53
+ MIT licensed.
package/cli.js ADDED
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ // herdr-secret from npm.
3
+ // npx herdr-secret@latest install (or update) the herdr plugin, then run its setup
4
+ // npx herdr-secret uninstall undo setup and optionally remove the plugin
5
+ // npx herdr-secret ask|get|list|rm the plugin's own command, once it is installed
6
+ // The plugin itself comes from GitHub through `herdr plugin install`, so herdr shows what it
7
+ // will run before anything does. This file only finds herdr and Python and hands over.
8
+ 'use strict';
9
+ const { spawnSync } = require('child_process');
10
+ const path = require('path');
11
+
12
+ const REPO = 'mazemaker/herdr-secret';
13
+ const ID = 'mazemaker.secret';
14
+ const isWin = process.platform === 'win32';
15
+
16
+ // The wizard and the form handle Ctrl-C themselves; don't let Node exit underneath them.
17
+ process.on('SIGINT', () => {});
18
+
19
+ function fail(msg) {
20
+ console.error(`herdr-secret: ${msg}`);
21
+ process.exit(1);
22
+ }
23
+
24
+ function capture(cmd, args) {
25
+ const r = spawnSync(cmd, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
26
+ return r.status === 0 ? r.stdout : null;
27
+ }
28
+
29
+ function run(cmd, args) {
30
+ const r = spawnSync(cmd, args, { stdio: 'inherit' });
31
+ if (r.error) fail(`could not run ${cmd}: ${r.error.message}`);
32
+ return r.status === null ? 1 : r.status;
33
+ }
34
+
35
+ function findPython() {
36
+ const candidates = isWin ? [['py', '-3'], ['python']] : [['python3']];
37
+ for (const [cmd, ...pre] of candidates) {
38
+ const ok = capture(cmd, [...pre, '-c', 'import sys; print(sys.version_info >= (3, 8))']);
39
+ if (ok && ok.trim() === 'True') return [cmd, ...pre];
40
+ }
41
+ fail(isWin ? 'Python 3.8 or newer is required (python.org installer, which adds the py launcher)'
42
+ : 'Python 3.8 or newer is required (python3 on PATH)');
43
+ }
44
+
45
+ function plugin() {
46
+ const out = capture('herdr', ['plugin', 'list', '--json']);
47
+ if (!out) return null;
48
+ try {
49
+ const plugins = (JSON.parse(out).result || {}).plugins || [];
50
+ return plugins.find((p) => p.plugin_id === ID) || null;
51
+ } catch {
52
+ return null;
53
+ }
54
+ }
55
+
56
+ const USAGE = `herdr-secret (npm)
57
+
58
+ npx herdr-secret@latest install or update the herdr plugin, then run setup
59
+ npx herdr-secret setup [--yes] run setup again
60
+ npx herdr-secret uninstall undo setup, optionally remove the plugin
61
+ npx herdr-secret ask|get|list|rm the plugin's own command (see herdr-secret help)
62
+
63
+ https://github.com/mazemaker/herdr-secret`;
64
+
65
+ function main(argv) {
66
+ if (['-h', '--help', 'help'].includes(argv[0])) {
67
+ console.log(USAGE);
68
+ return 0;
69
+ }
70
+ if (!capture('herdr', ['--version'])) fail('herdr is required: https://herdr.dev');
71
+ const py = findPython();
72
+ const [cmd, ...rest] = argv;
73
+ let p = plugin();
74
+
75
+ if (!cmd || cmd === 'install' || cmd === 'setup') {
76
+ const flags = cmd ? rest : argv;
77
+ if (!p) {
78
+ const code = run('herdr', ['plugin', 'install', REPO]);
79
+ if (code !== 0) process.exit(code);
80
+ } else if ((p.source || {}).kind !== 'local') {
81
+ console.log('herdr-secret is already installed; updating it.');
82
+ run('herdr', ['plugin', 'update', ID]);
83
+ }
84
+ p = plugin();
85
+ if (!p || !p.plugin_root) fail(`herdr did not report the plugin folder; run: herdr plugin action invoke ${ID}.setup`);
86
+ return run(py[0], [...py.slice(1), '-I', path.join(p.plugin_root, 'bin', 'herdr_secret.py'), 'setup', ...flags]);
87
+ }
88
+
89
+ if (!p || !p.plugin_root) fail('the herdr plugin is not installed yet. Run: npx herdr-secret@latest');
90
+ return run(py[0], [...py.slice(1), '-I', path.join(p.plugin_root, 'bin', 'herdr_secret.py'), ...argv]);
91
+ }
92
+
93
+ process.exit(main(process.argv.slice(2)));
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "herdr-secret",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Installer and command for herdr-secret: a herdr popup form where coding agents ask you for credentials.",
5
+ "license": "MIT",
6
+ "author": "mazemaker",
7
+ "homepage": "https://github.com/mazemaker/herdr-secret#readme",
8
+ "repository": { "type": "git", "url": "git+https://github.com/mazemaker/herdr-secret.git", "directory": "npm" },
9
+ "bugs": { "url": "https://github.com/mazemaker/herdr-secret/issues" },
10
+ "keywords": ["herdr", "herdr-plugin", "credentials", "secrets", "keychain", "ai-agents", "coding-agents"],
11
+ "bin": { "herdr-secret": "cli.js" },
12
+ "files": ["cli.js"],
13
+ "engines": { "node": ">=18" }
14
+ }