@stitchaxis/latchkey 0.1.0 → 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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/cli.js";
package/dist/cli.js CHANGED
@@ -181,19 +181,40 @@ program
181
181
  .action(async () => {
182
182
  const argv = process.argv;
183
183
  const runIdx = argv.indexOf("run");
184
- const sepIdx = argv.indexOf("--", runIdx);
185
- if (sepIdx < 0 || sepIdx === argv.length - 1) {
186
- console.error("Usage: latchkey run [--yes|-y] [--sandbox] -- <command> [args...]");
184
+ const after = runIdx >= 0 ? argv.slice(runIdx + 1) : [];
185
+ const knownFlags = new Set(["--yes", "-y", "--sandbox"]);
186
+ const sepIdx = after.indexOf("--");
187
+ let between;
188
+ let cmdParts;
189
+ if (sepIdx >= 0) {
190
+ between = after.slice(0, sepIdx);
191
+ cmdParts = after.slice(sepIdx + 1);
192
+ }
193
+ else {
194
+ // PowerShell / some shells drop bare `--`. Accept:
195
+ // latchkey run --yes node -e "..."
196
+ between = [];
197
+ cmdParts = [];
198
+ let seenCmd = false;
199
+ for (const a of after) {
200
+ if (!seenCmd && knownFlags.has(a))
201
+ between.push(a);
202
+ else {
203
+ seenCmd = true;
204
+ cmdParts.push(a);
205
+ }
206
+ }
207
+ }
208
+ if (cmdParts.length === 0) {
209
+ console.error("Usage: latchkey run [--yes|-y] [--sandbox] [--] <command> [args...]");
187
210
  process.exitCode = 1;
188
211
  return;
189
212
  }
190
- const between = argv.slice(runIdx + 1, sepIdx);
191
213
  const sandbox = between.includes("--sandbox");
192
214
  const autoYes = between.includes("--yes") ||
193
215
  between.includes("-y") ||
194
216
  process.env.LATCHKEY_APPROVE === "1" ||
195
217
  process.env.LATCHKEY_APPROVE === "yes";
196
- const cmdParts = argv.slice(sepIdx + 1);
197
218
  const cmd = cmdParts[0];
198
219
  const args = cmdParts.slice(1);
199
220
  if (sandbox) {
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@stitchaxis/latchkey",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local-first encrypted vault for AI API keys",
5
5
  "type": "module",
6
6
  "bin": {
7
- "latchkey": "./dist/cli.js"
7
+ "latchkey": "bin/latchkey.js"
8
8
  },
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
11
11
  "files": [
12
+ "bin",
12
13
  "dist"
13
14
  ],
14
15
  "publishConfig": {