Skip to content

CLI Tool Implementation #2

@Kinflou

Description

@Kinflou

CLI Tool Implementation

Priority

P2 (Medium) - User-facing interface

Labels

  • cli
  • tooling
  • ux
  • P2

Estimated Effort

2 weeks

Description

Create a command-line interface for Comline that provides common development workflows. This makes the tool accessible to developers.

Current State

No CLI exists. The crate is library-only currently.

Acceptance Criteria

  • CLI binary builds and installs (cargo install comline)
  • Core commands implemented:
    • comline init - Scaffold new project
    • comline build - Compile schemas
    • comline check - Validate without building
    • comline generate - Run code generators
    • comline diff - Compare schema versions
    • comline clean - Remove build artifacts
  • Help text for all commands
  • Colored output and progress indicators
  • Exit codes for CI/CD integration
  • Shell completions (bash, zsh, fish)

Tasks

Setup

  • Create cli/ crate in workspace
  • Add clap for argument parsing
  • Design command structure
  • Add colored output with colored crate

Commands

comline init

  • Create comline.toml template
  • Create directory structure
  • Generate example schema
  • Initialize git repository (optional)

comline build

  • Parse schemas
  • Compile to IR
  • Generate CAS objects
  • Run code generators
  • Show build summary

comline check

  • Parse and validate schemas
  • Show errors/warnings
  • Fast validation (no codegen)

comline generate

  • Discover installed generators
  • Run specific generator
  • Output to configured paths

comline diff

  • Compare two schema versions
  • Show changes summary
  • Predict version bump

comline clean

  • Remove build artifacts
  • Clear CAS cache
  • Reset state

UX Enhancements

  • Progress bars for long operations
  • Colored output (errors in red, success in green)
  • Emoji indicators (optional, configurable)
  • Watch mode (--watch flag for hot-reload)
  • Verbose mode (-v, -vv, -vvv)
  • Quiet mode (-q)

Documentation

  • --help for all commands
  • Man pages
  • Completion scripts
  • CLI guide in docs

Example Usage

# Initialize new project
comline init my-api
cd my-api

# Build schemas
comline build

# Generate TypeScript bindings
comline generate --target typescript

# Check for errors
comline check

# See what changed
comline diff v0.1.0 v0.2.0

Dependencies

Blocks

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2 - MediumcliCommand line interfacetoolingDeveloper toolinguxUser experience

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions