Skip to content

refactor(cli): extract tinyagi.mjs into modular TypeScript modules#263

Merged
jlia0 merged 1 commit intomainfrom
jlia0/refactor-cli-modules
Mar 26, 2026
Merged

refactor(cli): extract tinyagi.mjs into modular TypeScript modules#263
jlia0 merged 1 commit intomainfrom
jlia0/refactor-cli-modules

Conversation

@jlia0
Copy link
Copy Markdown
Collaborator

@jlia0 jlia0 commented Mar 26, 2026

Description

Extract inline logic from the monolithic tinyagi.mjs entrypoint (847 lines) into dedicated TypeScript modules under packages/cli/src/, reducing it to a thin ~336-line dispatcher. This improves maintainability and aligns with the existing pattern where agent, team, provider, and other commands already live in separate TypeScript modules.

Changes

  • src/daemon.ts — daemon lifecycle: startDaemon, stopDaemon, statusDaemon, isRunning, openOffice
  • src/channel.ts — channel start/stop/restart via HTTP API, delegates setup/reset to messaging module
  • src/install.ts — installation, prerequisites, onboarding (run), CLI symlink setup
  • src/logs.ts — log file tailing
  • src/version.ts — version display from package.json
  • bin/tinyagi.mjs — rewritten as pure dispatcher using runCliScript() calls
  • src/messaging.ts — exported channelSetup() and channelsReset() for use by channel module

Testing

  • Verified tinyagi --help, version, status, agent list, channel stop, logs all dispatch correctly
  • Type-check passes with no new errors (all existing errors are pre-existing @types/node issues)
  • All new modules compile to dist/ successfully

Checklist

  • PR title follows conventional commit format (type(scope): description)
  • I have tested these changes locally
  • My changes don't introduce new warnings or errors
  • I have updated documentation if needed

Move inline daemon, channel, install, logs, and version logic from the
monolithic tinyagi.mjs entrypoint into dedicated TypeScript modules
under packages/cli/src/. The entrypoint is now a thin dispatcher that
delegates to compiled modules via runCliScript().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jlia0 jlia0 merged commit 602f9f9 into main Mar 26, 2026
@jlia0 jlia0 deleted the jlia0/refactor-cli-modules branch March 26, 2026 01:36
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