vision: extract bin/disinto into focused lib/ modules #284

Closed
opened 2026-04-06 09:21:34 +00:00 by dev-bot · 1 comment
Collaborator

Problem

bin/disinto is 3000+ lines — a monolithic CLI that handles compose generation, Forgejo provisioning, ops repo setup, agent hiring, release management, secrets, and more. This makes it hard to test, review, and modify individual sections.

Extractable sections identified

Lines Section Target
166-373 Docker compose generation lib/compose.sh
375-555 Dockerfile/Caddyfile/staging/pipeline generation lib/generators.sh
564-949 setup_forge() — Forgejo provisioning (386 lines) lib/forge-setup.sh
950-1095 setup_ops_repo() — ops repo setup (146 lines) lib/ops-setup.sh
1096-1253 push_to_forge() — forge push + webhook setup lib/forge-push.sh
1398-1724 install_cron() + Woodpecker OAuth/token generation lib/ci-setup.sh
2519-2819 disinto_hire_an_agent() (301 lines) lib/hire-agent.sh
2828-2938 disinto_release() (111 lines) lib/release.sh

bin/disinto would source these and remain the CLI dispatcher (~200 lines).

Considerations

  • Functions share local variables (admin_token, forge_url, etc.) — extraction requires passing these as arguments or exporting them
  • The smoke test runs disinto init end-to-end — extraction must not break that
  • Each extracted module should be independently testable
## Problem bin/disinto is 3000+ lines — a monolithic CLI that handles compose generation, Forgejo provisioning, ops repo setup, agent hiring, release management, secrets, and more. This makes it hard to test, review, and modify individual sections. ## Extractable sections identified | Lines | Section | Target | |-------|---------|--------| | 166-373 | Docker compose generation | lib/compose.sh | | 375-555 | Dockerfile/Caddyfile/staging/pipeline generation | lib/generators.sh | | 564-949 | setup_forge() — Forgejo provisioning (386 lines) | lib/forge-setup.sh | | 950-1095 | setup_ops_repo() — ops repo setup (146 lines) | lib/ops-setup.sh | | 1096-1253 | push_to_forge() — forge push + webhook setup | lib/forge-push.sh | | 1398-1724 | install_cron() + Woodpecker OAuth/token generation | lib/ci-setup.sh | | 2519-2819 | disinto_hire_an_agent() (301 lines) | lib/hire-agent.sh | | 2828-2938 | disinto_release() (111 lines) | lib/release.sh | bin/disinto would source these and remain the CLI dispatcher (~200 lines). ## Considerations - Functions share local variables (admin_token, forge_url, etc.) — extraction requires passing these as arguments or exporting them - The smoke test runs disinto init end-to-end — extraction must not break that - Each extracted module should be independently testable
dev-bot added the
vision
label 2026-04-06 09:21:34 +00:00

done by sub-issues

done by sub-issues
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#284
No description provided.