Skip to content

refactor: CLI cleanup before v1.0.0#54

Open
dean0x wants to merge 4 commits intomainfrom
refactor/cli-cleanup
Open

refactor: CLI cleanup before v1.0.0#54
dean0x wants to merge 4 commits intomainfrom
refactor/cli-cleanup

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Feb 13, 2026

Summary

  • Extract shared CLI utilities from the 638-line init.ts monolith into focused modules:
    • src/cli/utils/cli.ts — shared isClaudeCliAvailable() (was copy-pasted in both init.ts and uninstall.ts)
    • src/cli/utils/installer.tsinstallViaCli(), installViaFileCopy(), copyDirectory(), chmodRecursive()
    • src/cli/utils/post-install.ts — 5 post-install step functions + NodeSystemError guard + pure helpers
  • Migrate uninstall.ts to @clack/prompts — replaced all 38 console.log/console.error calls with clack equivalents for consistent UX across both CLI commands
  • init.ts reduced from 638 to 281 lines (56% reduction); action callback from ~475 to ~215 lines

Test plan

  • npm run build succeeds (8 plugins)
  • npm test — all 67 tests pass (no test changes needed, exports unchanged)
  • node dist/cli.js init --list — renders with clack formatting
  • node dist/cli.js uninstall --help — runs without error
  • Zero console.log calls remaining in uninstall.ts

Dean Sharon added 4 commits February 13, 2026 12:10
- Bump version 0.9.0 → 1.0.0, date CHANGELOG
- Add Vitest test suite (59 tests across 6 files)
- Extract pure functions from init.ts and uninstall.ts for testability
- Add CI workflow (Node 18/20/22 matrix) and CONTRIBUTING.md
- Remove devflow-catch-up and devflow-devlog plugins (superseded by Working Memory hooks)
- Update all docs, registry, and marketplace to reflect 8-plugin architecture
Add platform-aware safe-delete tip after "Available commands" during
init. Suggests trash-cli on macOS/Linux with install/alias hints.
Extract shared utilities from init.ts monolith:
- cli.ts: shared isClaudeCliAvailable()
- installer.ts: installViaCli(), installViaFileCopy(), copyDirectory(), chmodRecursive()
- post-install.ts: installSettings(), installClaudeMd(), installClaudeignore(),
  updateGitignore(), createDocsStructure()

Migrate uninstall.ts from raw console.log to @clack/prompts for
consistent UX across both CLI commands.

init.ts reduced from 638 to 281 lines. No test changes needed —
all 67 tests pass with unchanged exports.
import.meta.dirname only exists in Node 21.7+, causing CI failures
on Node 18 and 20. Use the standard fileURLToPath/dirname pattern.
dean0x pushed a commit that referenced this pull request Feb 13, 2026
Extract shared utilities from init.ts monolith:
- cli.ts: shared isClaudeCliAvailable()
- installer.ts: installViaCli(), installViaFileCopy(), copyDirectory(),
  chmodRecursive()
- post-install.ts: installSettings(), installClaudeMd(),
  installClaudeignore(), updateGitignore(), createDocsStructure()

Migrate uninstall.ts from raw console.log to @clack/prompts for
consistent UX across both CLI commands.

Fix Node 18/20 compat in build-plugins.ts (import.meta.dirname →
fileURLToPath/dirname).

init.ts reduced from 638 to 281 lines. All 67 tests pass unchanged.
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

Comments