Skip to content

chore: add sudo trust prompt before managed settings write#96

Merged
dean0x merged 2 commits intomainfrom
chore/sudo-trust-prompt
Mar 9, 2026
Merged

chore: add sudo trust prompt before managed settings write#96
dean0x merged 2 commits intomainfrom
chore/sudo-trust-prompt

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Mar 8, 2026

Summary

  • Surfaces the sudo requirement earlier in devflow init with a p.note() explaining what managed settings does, why sudo is needed, and a copy-pasteable verification prompt for another Claude Code session
  • Adds a p.select() with explicit "Yes, continue" / "No, fall back to settings.json" options before any sudo prompt appears
  • Removes the now-redundant inner p.confirm("Use sudo?") from installManagedSettings() to avoid double-prompting

Test plan

  • npm run build && npm test — all tests pass
  • node dist/cli.js init → choose User scope → choose Managed settings → verify the note + select prompt appears before any sudo prompt
  • Select "No, fall back to settings.json" → verify settings.json contains deny list entries (no sudo prompt)
  • Select "Yes, continue" → verify sudo prompt appears and managed-settings.json is written
  • Ctrl+C on the new select prompt → verify clean exit with "Installation cancelled."

Dean Sharon added 2 commits March 9, 2026 00:37
Surface the sudo requirement earlier in init with a clear explanation,
verification prompt, and explicit fallback option. Remove the redundant
inner sudo confirm from installManagedSettings().
@dean0x dean0x merged commit ca48967 into main Mar 9, 2026
4 checks passed
@dean0x dean0x deleted the chore/sudo-trust-prompt branch March 9, 2026 08:09
dean0x added a commit that referenced this pull request Mar 9, 2026
## Summary
- Add 6 unit tests for `installManagedSettings()` covering all testable
code paths (unsupported platform, template read failure, direct write,
merge with existing settings, EACCES non-TTY, non-EACCES errors)
- Update CHANGELOG `[Unreleased]` with sudo trust prompt (#96) and test
coverage entries

## Test plan
- [x] `npm test` — all 191 tests pass (was 185)
- [x] No regressions in existing tests
- [x] Build passes

Co-authored-by: Dean Sharon <deanshrn@gmain.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant