Skip to content

πŸ› οΈ Refactor Orchestration: Migrate Shell Scripts to a Compiled CLI ApplicationΒ #27

@GordonBeeming

Description

@GordonBeeming

πŸ“„ Description

Currently, copilot_here relies on a mix of .sh and .ps1 scripts to orchestrate the Docker container and CLI interactions. While this works, it has become brittle and difficult to maintain. Making changes often feels risky because we lack the safety of a compiled language, and cross-platform compatibility (Windows/Mac/Linux) is harder to guarantee with shell scripts.

We need to move this logic into a unified, solid application structure. This will improve testability, maintainability, and confidence in future changes.

Critical Requirement: The replacement must have near-instant startup time. Any perceptible lag (e.g., waiting for a JIT compiler) will ruin the user experience of the wrapper.

βš–οΈ Technology Options to Evaluate

  1. Native Rust App πŸ¦€
    • Pros: Blazing fast startup, memory safety, produces a single small binary.
    • Cons: Higher learning curve if contributors aren't familiar with Rust.
  2. Native .NET App (via Native AOT) 🟣
    • Pros: Familiar ecosystem (C#), strong tooling.
    • Note: Must use Native AOT (Ahead-of-Time) compilation to eliminate JIT startup time and reduce binary size. Standard .NET runtime is likely too slow for this use case.
  3. Go (Golang) 🐹
    • Pros: Built for CLIs (like Docker/Kubernetes/GH CLI), very fast startup, easy cross-compilation.

βœ… Acceptance Criteria

  • Technology Selection: A decision is made on the language (Rust vs. .NET AOT vs. Go) based on a quick prototype of startup speed.
  • Feature Parity: The new CLI application supports all current script functionality (orchestrating the Docker container, passing arguments, handling input/output).
  • Zero Dependencies: The resulting tool should be a single executable (no requiring the user to install a runtime like Python or Java).
  • Performance: Startup time overhead is negligible (ideally <50ms added over the raw Docker command).
  • CI/CD Pipeline: The build pipeline is updated to compile and release the binary for Windows, Mac (Intel/Silicon), and Linux.
  • Test Coverage: Unit/Integration tests are set up to verify the orchestration logic without running the full container stack every time.

πŸ—‘οΈ Cleanup

  • Remove legacy .sh and .ps1 orchestration scripts from the repo once the migration is verified.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions