refactor(cli): replace shell scripts with Node.js entrypoint#260
Merged
Conversation
Centralize all process management into packages/main/src/index.ts, eliminating the dependency on tmux, jq, curl, and bash shell scripts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
scripts/bundle.sh was deleted on main; accept deletion since our lib/ reference cleanup is no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add /api/status endpoint returning server uptime, channel status, and heartbeat info. Add /api/services/channel/:id/start|stop|restart for managing individual channels via API. CLI start now shows all services, status queries live system state (queue, channels, heartbeat), and channel start/stop/restart commands work via the API. Print ASCII banner on every CLI command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace all bash shell scripts (lib/) with pure Node.js modules, centralizing process management into
packages/main/src/index.ts. This eliminates runtime dependencies on tmux, jq, curl, and bash, and adds Docker support with a multi-stage Dockerfile.Changes
packages/main/src/heartbeat.ts— heartbeat assetInterval+fetch(), replacinglib/heartbeat-cron.shpackages/main/src/channels.ts— channel spawner usingchild_process.fork(), replacing logic fromlib/daemon.shpackages/main/src/index.tsstartup/shutdown lifecyclepackages/cli/bin/tinyagi.mjs— replacedelegateToBash()with native PID-file process management for start/stop/restart/statusDockerfile(multi-stage),docker-compose.yml,.dockerignorefor container deploymentscripts/bundle.shandscripts/install.shto removelib/referencesREADME.md— remove tmux/jq prerequisites, removeattachcommand, update directory structurelib/directory (tinyagi.sh, daemon.sh, heartbeat-cron.sh, common.sh, update.sh)Testing
npm run buildcompiles successfully with no errorsChecklist
type(scope): description)