Skip to content

🔧 [P1] Split main.rs monolith into modular structure #131

Closed

Description

@ajianaz

Problem

crates/uteke-cli/src/main.rs is 1028 lines containing:

  • 15+ print functions (human-readable formatters)
  • 3 agent init functions with ~250 lines of embedded markdown templates
  • Command dispatch logic
  • Logging setup
  • Main function

The embedded markdown templates alone are 250+ lines of string literals.

Also: Dead code

  • Line 1014: let _ = count; — leftover variable
  • print_json uses .unwrap() on serialization

Proposed Structure

crates/uteke-cli/src/
├── main.rs          # Entry point + command dispatch (<200 lines)
├── output.rs        # All print_* functions (human + JSON formatters)
├── init.rs          # init_pi(), init_claude(), init_cursor()
├── templates/       # Markdown templates as separate files
│   ├── pi.md
│   ├── claude.md
│   └── cursor.md
└── config.rs        # (existing)

Templates loaded via include_str! at compile time.

Acceptance Criteria

  • main.rs < 200 lines
  • No module exceeds 300 lines
  • Templates in separate files, loaded via include_str!
  • Dead code removed
  • All CLI commands work identically
  • Shell completions unaffected

Effort: ~1 day

Activity

  1. added
    enhancement
    priority:low
    v0.0.14
    and removed on Jun 9, 2026
  2. modified the milestones: v0.0.8 — Architecture & Security, on Jun 11, 2026
  3. added
    v0.1.0
    and removed
    v0.0.14
    on Jun 11, 2026
  4. added a commit that references this issue on Jun 11, 2026
  5. added 5 commits that reference this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:lowscope:cliv0.1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions