Skip to content

Scaffold cli-rust: Rust CLI client for traverse-starter #55

Description

@enricopiovesan

Summary

Create apps/traverse-starter/cli-rust/ — a Rust CLI client that invokes traverse-starter.process from the terminal. Phase 1 uses HTTP polling matching web-react. Shares traverse-core-rs crate with the Linux GTK client (see #59). SSE is the phase 2 upgrade path.

Phase 1 scope (HTTP polling — unblocked)

  • CLI tool: traverse-starter run --note "..." → POST execute → poll → print result
  • Runtime URL + workspace via CLI flags or env vars (TRAVERSE_BASE_URL, TRAVERSE_WORKSPACE)
  • Health check subcommand: traverse-starter health
  • Structured output: human-readable by default, --json flag for machine output
  • Demonstrates Traverse as a programmable backend — agent/CI-friendly

Stack

Concern Choice
Language Rust
CLI clap (derive API)
HTTP reqwest (blocking or async with Tokio)
Output colored for human, serde_json for --json

Directory structure

apps/traverse-starter/cli-rust/
  Cargo.toml
  src/
    main.rs                       # clap entrypoint
    commands/
      run.rs                      # execute + poll loop
      health.rs
    client.rs                     # reqwest HTTP client
    output.rs                     # human + JSON formatters
  tests/
    integration_tests.rs

Commands

traverse-starter run --note "Meeting with Alice about project X"
traverse-starter run --note "..." --json
traverse-starter health
traverse-starter run --base-url http://192.168.1.42:8787 --workspace my-workspace --note "..."

Phase 2 upgrade path (do not implement now)

When Traverse ships #525 / #526 / #527:

Definition of Done

  • cargo build succeeds on macOS and Linux
  • traverse-starter run --note "..." executes, polls, and prints result
  • --json flag outputs machine-readable JSON
  • traverse-starter health prints runtime status
  • --base-url and --workspace flags + env var fallbacks work
  • Integration test against a live runtime (or mock server)
  • README in cli-rust/ covering: build, install, usage examples
  • scripts/ci/repository_checks.sh updated to acknowledge cli-rust/ directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions