Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
83ef17c
chore(campaign): develop merged into main as c5e7ba4
marcinobel Sep 24, 2026
e44e833
chore(campaign): v0.2.0 tagged and released; publish waits for owner …
marcinobel Sep 24, 2026
3c20ade
chore(campaign): 0.2.0 published to npm; hand-off
marcinobel Sep 24, 2026
4c1fea5
docs(leader): owner rule – dispatch at once when ready work and headr…
marcinobel Sep 24, 2026
5cb370c
chore(campaign): owner items – branch deleted; advisory fix PR #84 in…
marcinobel Sep 24, 2026
eb707ee
chore(campaign): L1/L2 at 00:25 – budget refreshed
marcinobel Sep 24, 2026
a4117f3
chore(campaign): PR #84 conflict repaired; scoped re-check dispatched
marcinobel Sep 24, 2026
e8758ed
fix: keep keychain secrets out of process arguments (#84)
marcinobel Sep 24, 2026
5c6efb3
chore(campaign): PR #84 merged; release-prep 0.2.1 dispatched
marcinobel Sep 24, 2026
ad5c6ba
chore(campaign): release-prep 0.2.1 failed readiness; retry dispatched
marcinobel Sep 24, 2026
a58ba4a
chore(campaign): release PR #85 ready; independent review dispatched
marcinobel Sep 24, 2026
17d8e01
chore(campaign): release PR #85 review requests changes; repair round…
marcinobel Sep 24, 2026
7cbbe36
chore(campaign): stalled PR #85 repair cancelled; re-dispatched on co…
marcinobel Sep 24, 2026
cb70814
chore(campaign): PR #85 repair pushed at 64f4eef; scoped re-check dis…
marcinobel Sep 25, 2026
ce43058
chore(release): v0.2.1 (#85)
marcinobel Sep 25, 2026
16b4cb4
chore(campaign): release PR #85 merged; develop -> main PR #86 opened
marcinobel Sep 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .xezar/campaigns/20260923-n8n-2-40/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Campaign 20260923-n8n-2-40

Updated: 2026-09-24 19:35
Updated: 2026-09-25 00:00

Goal: 8cli validated against n8n 2.40.5, with a long-running local n8n to do it on; plus end-user docs and a polished README (added by owner, see decisions.md). Plan: `plan.md`.

## State

- Base `develop` at 790a081. Merges this campaign: 23 (#33, #50, #48, #49, #51, #55, #54, #59, #46, #56, #63, #58, #68, #65, #71, #73, #75, #79, #74, #78, #80, #81, #82). Checkpoints met: 1 (#31 closed).
- Base `develop` at ce43058. Merges this campaign: 26 (#33, #50, #48, #49, #51, #55, #54, #59, #46, #56, #63, #58, #68, #65, #71, #73, #75, #79, #74, #78, #80, #81, #82, #83, #84, #85). Checkpoints met: 1 (#31 closed).

## Work

Expand Down Expand Up @@ -37,25 +37,26 @@ Goal: 8cli validated against n8n 2.40.5, with a long-running local n8n to do it



Next (23:48): release PR #82 merged as 790a081. develop -> main PR #83 open, CI running (check, e2e, e2e-macos green on main), signed tag v0.2.0, GitHub Release, owner approves the release environment, verify npm.
DONE (00:00): 8cli 0.2.0 published – @qodeca/8cli@0.2.0 on npm, dist-tag latest (publish run 36064388870 success after owner approval). Tag v0.2.0 on main c5e7ba4, Release https://github.com/qodeca/8cli/releases/tag/v0.2.0. Hand-off: everything committed and pushed; continue on the other machine from develop.

Next (02:10): release PR #85 merged as ce43058; develop -> main PR #86 open, CI running. Then signed tag v0.2.1, GitHub Release, owner approves npm, fix the advisory text (name auth login), publish the advisory (fixed 0.2.1, range <= 0.2.0).

## Accounts

| Runner × login | State | Resets |
|---|---|---|
| claude × qodeca-priv | ok – 5h 13%, weekly 43% | 5h 22:50, weekly 2026-09-28 19:00 |
| claude × gmail-priv | ok – 5h 9%, weekly 31% | 5h 22:59, weekly 2026-09-25 20:59 |
| claude × qodeca-priv | ok – 5h 1%, weekly 45% | 5h 03:49, weekly 2026-09-28 18:59 |
| claude × gmail-priv | ok – 5h 0%, weekly 33% | 5h 04:30, weekly 2026-09-25 21:00 |
| claude × eqamana-priv | out (weekly 100%) | 2026-09-26 17:59 |
| claude × westagilelabs-priv | out (weekly 100%) | 2026-09-25 08:59 |
| codex × codex-cli | ok – weekly 20% | weekly 2026-09-29 14:45 |
| claude × westagilelabs-priv | out (weekly 100%) | 2026-09-25 09:00 |
| codex × codex-cli | ok – weekly 24% | weekly 2026-09-29 14:45 |
| pi (own accounts) | not reported by read_quota | – |

Read from read_quota at 19:33. claude × default is the reserved leader login, not in any rotation.
Read from read_quota at 00:25. claude × default is the reserved leader login, not in any rotation.

## Owner items

- BLOCKED: leader merge of PR #49 denied by the Claude Code auto-mode classifier even with --allowedTools "Bash(gh pr merge *)". Owner chose "Allow the leader in settings" – owner adds the rule. #50 merged 09:06 by the leader (owner authorized); the other merges were refused by the classifier. Merged 10:44 by the owner: #48, #49, #51, #55 (and #50 at 09:06). #54 and #59 have merge conflicts (DIRTY) – conflict repair.
- Delete branch xez/df01cf60 (record deletion is yours; unattended hard stop).

## Rules that bit

Expand Down
10 changes: 10 additions & 0 deletions .xezar/campaigns/20260923-n8n-2-40/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,13 @@ Owner, in chat: "You mentioned only two concurrent implementation tasks but the
## 2026-09-24 19:08 – Dependency bumps stay out of 0.2.0

Offered adding the 7 Dependabot PRs to 0.2.0 (dev-only alerts; prod npm audit clean). Owner, in chat: "proceed as planned". Dependency updates go to the next release.

## 2026-09-25 00:18 – dispatch at once when ready (owner, Claude Code session, /xez-add-rule)

Owner's words: "When ready work and headroom exist, the leader dispatches at once instead of waiting for the L3 tick. Every other L3 check (ceilings, overlap, route.mjs, budget) still applies." Confirmed via AskUserQuestion ("Yes, add it"). Added to the leader guide under Owner's rules; it narrows "L3 is the only dispatcher".

## 2026-09-25 00:22 – owner items authorised (owner, Claude Code session)

Owner's words: "proceed with the two tasks marked as owner, you have my authorization to take care of them". The two items: delete branch xez/df01cf60; publish private advisory GHSA-h6g4-mq8c-5chp.
- Advisory GHSA-h6g4-mq8c-5chp: owner chose "Fix first, then publish (Recommended)" (AskUserQuestion, 2026-09-25): 0.2.0 still has the bug (src/keychain/macos.ts passes -w <secret>), so merge the fix, release 0.2.1, then publish with fixed version 0.2.1 and range <= 0.2.0.
- 0.2.1 release go: covered by the owner's 2026-09-25 choice "Fix first, then publish (Recommended)", whose text said "release 0.2.1 (you approve the npm step again)". The npm approval stays with the owner.
3 changes: 2 additions & 1 deletion .xezar/campaigns/20260923-n8n-2-40/merges.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
One line per day: `#PR -> sha`.

- 2026-09-23: #33 -> fb4c61261a56aa7f3b587ce171cafead6fd0f081
- 2026-09-24: #48 -> 59de9c27856cf631cbce5dc9af0329425e78312c #49 -> 59e4edd6651bf7c87d8d7608deb3c82385dad656 #50 -> 0e7d4a1db6f4bf20adf8d58451aa0ff53882db08 #51 -> 891dce2f54f279cb0987a030d7b503498d694ece #55 -> 59f44697a996cfa047f094e2444914292163ca2e #54 -> 1bfa77be22e24f0fbc091aa392c6b315ad998116 #59 -> 289cb21c7cb23b65907f7da32748b42977b35d29 #46 -> f8b07ebcc9989101fc18d2dba625da43bcbac512 #56 -> c5b41c0214c4f54c1db73ff63801192b620ffb3b #63 -> 72bfb397e437a50834a1c7911ebb2c197a155d11 #58 -> 0c53b30e73d316a871b0d232a2ead62dc12ab5c4 #68 -> ddc04b5379d859d600520882c48105d86759449c #65 -> 66c52ef057781c93f1d8a2559505995d6159e8cf #71 -> 27e3398494791aa0db0cadd796a3422449683015 #73 -> 28af6723175546bed4953d81cd0a31f54cc229f3 #75 -> 78009d10cfc97d886c919c08b5b77febe0ba689a #79 -> ac312ab3e9ece88811c8870c3dfb47fc9ba08d88 #74 -> a56351e8968864b9a527dd9595c31b56c2da666e #78 -> c4bbce68bbe556167aeca26c4d8fdee90400cad3 #80 -> d2d0001a3991ddaf3fc0b4197ea540c55ae34d2c #81 -> 62214b5017b12fab4ce5353a34415d0de5a285d5 #82 -> 790a081d62a68862887cf4e7cb591b718eeeddcb
- 2026-09-24: #48 -> 59de9c27856cf631cbce5dc9af0329425e78312c #49 -> 59e4edd6651bf7c87d8d7608deb3c82385dad656 #50 -> 0e7d4a1db6f4bf20adf8d58451aa0ff53882db08 #51 -> 891dce2f54f279cb0987a030d7b503498d694ece #55 -> 59f44697a996cfa047f094e2444914292163ca2e #54 -> 1bfa77be22e24f0fbc091aa392c6b315ad998116 #59 -> 289cb21c7cb23b65907f7da32748b42977b35d29 #46 -> f8b07ebcc9989101fc18d2dba625da43bcbac512 #56 -> c5b41c0214c4f54c1db73ff63801192b620ffb3b #63 -> 72bfb397e437a50834a1c7911ebb2c197a155d11 #58 -> 0c53b30e73d316a871b0d232a2ead62dc12ab5c4 #68 -> ddc04b5379d859d600520882c48105d86759449c #65 -> 66c52ef057781c93f1d8a2559505995d6159e8cf #71 -> 27e3398494791aa0db0cadd796a3422449683015 #73 -> 28af6723175546bed4953d81cd0a31f54cc229f3 #75 -> 78009d10cfc97d886c919c08b5b77febe0ba689a #79 -> ac312ab3e9ece88811c8870c3dfb47fc9ba08d88 #74 -> a56351e8968864b9a527dd9595c31b56c2da666e #78 -> c4bbce68bbe556167aeca26c4d8fdee90400cad3 #80 -> d2d0001a3991ddaf3fc0b4197ea540c55ae34d2c #81 -> 62214b5017b12fab4ce5353a34415d0de5a285d5 #82 -> 790a081d62a68862887cf4e7cb591b718eeeddcb #83 (develop -> main, merge commit) -> c5e7ba432f6d647b1a52245ca7bdf6bab8767581
- 2026-09-25: #84 -> e8758edf6ed968b847a62c32bc6cc2755e65f863 #85 -> ce43058a1a278c7124f082d6a8c168da5f54f66f
2 changes: 2 additions & 0 deletions .xezar/campaigns/20260923-n8n-2-40/parked.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
Calls the leader made alone while the owner was away.

Resolved 2026-09-24 by xez-unattended-off: 2026-09-23 23:08 (keychain argv, no public issue) and 2026-09-23 23:09 (PR #33 keychain store disabled). Answers in decisions.md.

- 2026-09-25 01:47 – lane switch (unattended): repair round 1 of release PR #85. Chose codex/gpt-6-sol (second lane of row review-response-one) after pi/deepseek-flash task bdac9421 stalled 29 min with no commit and no token progress; cancelled it. Rejected: waiting longer on pi (release is blocked on a one-line changelog edit). Undo: none needed – no file changes by the cancelled run; future repairs go back to the first lane.
2 changes: 2 additions & 0 deletions .xezar/campaigns/20260923-n8n-2-40/timeline-2026-09-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,5 @@
- 23:43 L3: dispatched 16708821 (code-review workflow, row scoped-recheck, claude/sonnet on gmail-priv) – re-check of PR #82 repair at f42b2a0. Read-only; owns nothing. Load 2.7, 1 task running.
- 23:48 16708821 done: APPROVE on PR #82 at f42b2a0 (all 4 findings fixed). Events 637-638 acked. Leader merged PR #82 (squash, head-pinned f42b2a0) -> 790a081; CI 3/3 green, CLEAN. Next: develop -> main PR.
- 23:48 Opened PR #83 develop -> main ("chore(release): v0.2.0 to main"); CI running.
- 23:52 PR #83 CI 3/3 green at 66666dd (CLEAN); leader merged it into main (merge commit, head-pinned) -> c5e7ba4. Waiting for check/e2e/e2e-macos on main.
- 23:55 main CI (check, e2e, e2e-macos) SUCCESS on c5e7ba4. Signed tag v0.2.0 on c5e7ba4 pushed (git tag -v: Good "git" signature, ED25519). GitHub Release v0.2.0 published with the PR #82 release notes. publish.yml run 36064388870 is waiting for the protected release environment – BLOCKED on the owner (the leader never publishes).
12 changes: 12 additions & 0 deletions .xezar/campaigns/20260923-n8n-2-40/timeline-2026-09-25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Timeline 2026-09-25
- 00:00 Owner approved the release environment. publish.yml run 36064388870 completed/success. npm: @qodeca/8cli@0.2.0 present, dist-tags latest=0.2.0 (integrity sha512-aZQjDpEe...). Release 0.2.0 done. Hand-off commit for the move to another machine.
- 00:24 Owner authorised both owner items. Deleted branch xez/df01cf60 (PR #33 merged; commits also on ghsa/xez/df01cf60). Advisory: 0.2.0 still vulnerable; owner chose fix first. Pushed the privately approved fork head 3e2dac7 to origin fix/keychain-argv and opened PR #84 (only conflict: CHANGELOG.md). Dispatched c9ec297b conflict repair (address-review-findings, row conflict-repair, codex/gpt-5.6-terra on codex-cli; author pi).
- 00:25 L1: c9ec297b (PR #84 conflict repair) running at step address; events 639-641 (kit, preflight, setup passed) acked. L2: budget refreshed from read_quota – no lane out (claude qodeca-priv/gmail-priv ok, codex-cli ok); eqamana-priv out to 2026-09-26 17:59, westagilelabs-priv out to 2026-09-25 09:00.
- 00:31 c9ec297b done: PR #84 conflict repair merge commit 4146f58 (CHANGELOG only); net diff vs develop = CHANGELOG.md, src/keychain/macos.ts, test/keychain-macos.test.ts, test/e2e-macos/auth.e2e.ts; CI check/e2e/e2e-macos SUCCESS, CLEAN. Events 642-645 acked. Dispatched bf456f2a scoped re-check (code-review, row scoped-recheck, claude/sonnet on gmail-priv).
- 00:38 bf456f2a APPROVE on PR #84 at 4146f58 (1 minor: missing blank line before ## [0.2.0], carried to release-prep). Events 648-649 acked. Leader merged PR #84 (squash, head-pinned) -> e8758ed. Lane cache refreshed (get_capabilities, list_models: all lanes available; checkedAt 22:37:53Z). Dispatched 48aa3ecd release-prep 0.2.1 (row release, claude/sonnet on qodeca-priv).
- 00:39 48aa3ecd FAILED at readiness: edits done and draft PR #85 opened (xez/48aa3ecd, 9cf87ff, 7 files +14/-10, content matches the brief) but no phase record (SELF_REVIEW, DOCS, COUNTERS missing). Events 653-654 acked. Dispatched f72fd069 release-prep retry on the same branch/PR with the phase record required.
- 01:03 f72fd069 done: release-prep retry passed readiness, gates, evidence; PR #85 head unchanged 9cf87ff (7 files, +14/-10), CI 3/3 SUCCESS, CLEAN, release notes in body. Events 655-662 acked (658 was an advisory stall, cleared). Dispatched 9f1d4935 full review (code-review, row full-cold-review, claude/opus on qodeca-priv).
- 01:17 9f1d4935 REQUEST CHANGES on PR #85 at 9cf87ff: 1 major – affected-command list omits auth login (src/commands/auth.ts:72/75/78 use the same setSecret; leader verified by grep). Events 665-667 acked. Dispatched bdac9421 repair round 1 (address-review-findings, row review-response-one, pi/deepseek-flash). Note: fix the advisory's affected scope the same way before publishing.
- 01:47 bdac9421 (pi) stalled: no commit, tokens stuck at 71056 for 29 min; cancelled. Lane switch parked (parked.md). Dispatched 87ccb787 repair round 1 (address-review-findings, codex/gpt-6-sol on codex-cli).
- 02:07 87ccb787 ended failed (XEZ:ASK at step address): the fix is pushed – 64f4eef names auth login, auth set-api-key and auth set-credentials in CHANGELOG and PR body; CI 3/3 SUCCESS, CLEAN. Its local gate stopped at config-guard because the codex isolated clone lacked origin/HEAD (environment, app checks passed); it asked how to proceed. Not answered: CI is the merge gate and a re-check follows. Events 677-678 acked. Dispatched 80b7b360 scoped re-check (claude/sonnet on gmail-priv).
- 02:10 80b7b360 APPROVE on PR #85 at 64f4eef. Events 681-682 acked. Leader merged PR #85 (squash, head-pinned) -> ce43058. Opened PR #86 develop -> main.
3 changes: 3 additions & 0 deletions .xezar/docs/leader-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ Standing rules the owner added with `xez-add-rule`, each in their exact words wi
tasks, 4 metered-tool tasks, load 18) and file overlap; the engine's
`gateSlots` lease queues check suites that reach the gate at the same
time (owner 2026-09-24).
- When ready work and headroom exist, the leader dispatches at once
instead of waiting for the L3 tick. Every other L3 check (ceilings,
overlap, route.mjs, budget) still applies (owner 2026-09-25).

## One-page checklist

Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.1] - 2026-09-25

### Security

- On macOS, `auth login`, `auth set-api-key` and `auth set-credentials` no longer pass the secret to the `security` tool as a command-line argument, where other local processes could read it (advisory GHSA-h6g4-mq8c-5chp, low). Upgrade recommended for macOS users.

## [0.2.0] - 2026-09-24

### Added
Expand Down Expand Up @@ -137,7 +143,8 @@ First public release.
- Windows/Linux keychain stubs fail with an actionable message instead of silently no-opping.
- Vulnerability reporting via GitHub private reporting (`SECURITY.md`).

[unreleased]: https://github.com/qodeca/8cli/compare/v0.2.0...HEAD
[unreleased]: https://github.com/qodeca/8cli/compare/v0.2.1...HEAD
[0.2.1]: https://github.com/qodeca/8cli/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/qodeca/8cli/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/qodeca/8cli/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/qodeca/8cli/compare/v0.1.0...v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ authors:
repository-code: 'https://github.com/qodeca/8cli'
url: 'https://github.com/qodeca/8cli'
license: GPL-3.0-only
version: 0.2.0
date-released: 2026-09-24
version: 0.2.1
date-released: 2026-09-25
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm install --global @qodeca/8cli
```

```text
0.2.0
0.2.1
```

Or run it without installing:
Expand Down
2 changes: 1 addition & 1 deletion docs/global-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The error code is the code of the command you ran (here `ERR_WORKFLOW_LIST`). Se
```

```text
0.2.0
0.2.1
```

`--help` works at every level: `8cli --help`, `8cli wf --help`, `8cli wf save --help`. Help and
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:

## Tips

- Pin the 8cli version in CI (`npm install --global @qodeca/8cli@0.2.0`) so an upgrade does not
- Pin the 8cli version in CI (`npm install --global @qodeca/8cli@0.2.1`) so an upgrade does not
change a job's behaviour without you noticing.
- A failing command prints `{ "error", "code" }` to stderr; CI logs show it as it is.
- Use `--verbose` when a job fails and you need to see the requests. It never prints the key.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qodeca/8cli",
"version": "0.2.0",
"version": "0.2.1",
"description": "n8n remote management CLI – AI-first, JSON-native",
"type": "module",
"license": "GPL-3.0-only",
Expand Down
61 changes: 56 additions & 5 deletions src/keychain/macos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,68 @@ import { execFileSync } from 'node:child_process';

const SERVICE = '8cli';

/**
* `security -i` reads its input one line at a time into a fixed 4096-byte
* buffer, so a line of 4095 bytes plus the trailing newline is the most that
* fits. The limit is measured in UTF-8 bytes, not UTF-16 code units: a
* multi-byte account name (a raw user URL) is longer in bytes than
* `String#length` suggests. A longer line is split in two, which leaves a
* half-written item behind and echoes the tail of the payload in an error
* message, so an oversized command is rejected before anything is spawned.
* 4000 is a conservative round number below the 4095-byte ceiling.
*/
export const MAX_LINE_BYTES = 4000;

/**
* Quote a value for a `security -i` command line. `security -i` parses the
* commands it reads from stdin itself (there is no shell), and inside a
* double-quoted argument only `\` and `"` are special.
*/
function quoteForSecurityCommand(value: string): string {
return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
}

/**
* Store a secret in macOS Keychain.
* -U flag updates existing entry if present.
*
* The secret travels to `security` on stdin, as `-X <hex>` (password data given
* as a hexadecimal string) in a command fed to `security -i`. It is never part
* of the process argument list, where another local process could read it from
* the process table while `security` runs (GHSA-h6g4-mq8c-5chp).
*
* The documented prompt form – `-w` last, value typed on stdin – is not used:
* `security` reads it through a 128-byte buffer and silently stores only that
* prefix, which real n8n API keys exceed.
*/
export function setSecret(account: string, value: string): void {
try {
execFileSync(
'security',
['add-generic-password', '-s', SERVICE, '-a', account, '-w', value, '-U'],
{ stdio: 'pipe' },
// `security -i` reads one command per line, so a newline in an account name
// would split the command and could echo the hex-encoded secret back in an
// error message.
if (/[\r\n]/.test(account)) {
throw new Error('Failed to store secret in keychain: account name contains a newline');
}

const hex = Buffer.from(value, 'utf8').toString('hex');
const command = [
'add-generic-password',
'-s',
quoteForSecurityCommand(SERVICE),
'-a',
quoteForSecurityCommand(account),
'-U',
'-X',
quoteForSecurityCommand(hex),
].join(' ');
if (Buffer.byteLength(command + '\n', 'utf8') > MAX_LINE_BYTES) {
throw new Error(
`Failed to store secret in keychain: value is too long for the security CLI ` +
`(${Buffer.byteLength(value, 'utf8')} bytes)`,
);
}

try {
execFileSync('security', ['-i'], { input: `${command}\n`, stdio: 'pipe' });
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);
throw new Error(`Failed to store secret in keychain: ${msg}`, { cause: err });
Expand Down
Loading
Loading