CLI (rangeday)

Purpose

A Rust CLI tool in the monorepo that wraps all development, build, test, and deployment operations into a single interface. Primarily designed for AI agents — instead of needing to know which of many tools to invoke, an agent only needs to know rangeday and can discover commands via built-in help.

The CLI lives at cli/ in the monorepo root.

Bootstrap

After cloning the repo, run the platform-specific setup script:

# Linux
./cli/setup-linux.sh
 
# macOS
./cli/setup-macos.sh

The script handles everything from zero: checks for Rust (installs via rustup if missing), compiles the rangeday CLI, and runs a quick verification. After the script completes, rangeday is ready to use.

From there, the CLI manages all other tooling:

rangeday setup check              # see what else is needed for your workflow
rangeday setup android            # install NDK, configure Rust targets, etc.

AI Agent Usage

An AI agent with no prior knowledge of this project needs only one instruction:

Use rangeday for all monorepo operations. Run rangeday help-search <keywords> to find the right command.

Every command carries keyword tags and descriptions, so help-search returns relevant matches even when the agent doesn’t know the exact command name.

Discovery Commands

rangeday help                     # full command reference
rangeday help-search <keywords>   # search commands by keyword
rangeday <command> --help         # help for a specific command

Command Reference

serve — Local Development Servers

rangeday serve server             # start Axum dev server (with auto-reload)
rangeday serve dashboard          # start Dioxus dev server for dashboard (Subsecond)
rangeday serve pwa                # start Dioxus dev server for PWA (Subsecond)
rangeday serve marketing          # start file server + Tailwind watch for marketing site
rangeday serve docs               # start Quartz dev server for docs site (Quartz)
rangeday serve all                # start server + dashboard concurrently

build — Production Builds

rangeday build core               # build libs/core
rangeday build server             # build server binary (release)
rangeday build dashboard          # build dashboard WASM (release)
rangeday build pwa                # build PWA WASM (release)
rangeday build marketing          # build marketing site (Tailwind minify)
rangeday build docs               # build docs static site (Quartz)
rangeday build ios                # cross-compile core → XCFramework + generate Swift bindings
rangeday build android            # cross-compile core → JNI libs + generate Kotlin bindings
rangeday build all                # build everything for current platform

test — Run Tests

rangeday test                     # run all Rust workspace tests
rangeday test core                # test libs/core only
rangeday test server              # test apps/server only
rangeday test dashboard           # test apps/dashboard only
rangeday test pwa                 # test apps/pwa only
rangeday test ios                 # run Swift tests (xcodebuild, macOS only)
rangeday test android             # run Android unit tests (gradlew test)
rangeday test android --device    # run instrumented tests on connected device
rangeday test proto               # buf lint + breaking change detection
rangeday test all                 # run every test across every platform

check — Type-Check and Lint

rangeday check                    # cargo check full workspace
rangeday check clippy             # cargo clippy full workspace
rangeday check proto              # buf lint
rangeday check breaking           # buf breaking (proto backward compat)
rangeday check ios                # swiftlint (macOS only)
rangeday check android            # ktlint
rangeday check docs               # lint roadmap work items (frontmatter + structure)
rangeday check all                # run all checks

fmt — Format Code

rangeday fmt                      # cargo fmt (all Rust)
rangeday fmt ios                  # swift-format (macOS only)
rangeday fmt android              # ktfmt
rangeday fmt all                  # format everything

bindings — UniFFI Generation

rangeday bindings swift           # generate Swift bindings from core (macOS only)
rangeday bindings kotlin          # generate Kotlin bindings from core
rangeday bindings all             # generate both
rangeday bindings check           # verify bindings are up-to-date with core

proto — Protobuf Operations

rangeday proto generate           # buf generate (proto → Rust structs)
rangeday proto lint               # buf lint
rangeday proto breaking           # buf breaking change detection
rangeday proto check              # lint + breaking combined

db — Database Operations

rangeday db migrate               # run pending migrations
rangeday db rollback              # rollback last migration
rangeday db reset                 # drop + recreate + migrate
rangeday db seed                  # seed test/dev data
rangeday db new <name>            # create a new migration file
rangeday db status                # show pending/applied migrations
rangeday db connect               # open psql shell

setup — Environment Bootstrap

rangeday setup check              # verify all required tools are installed
rangeday setup ubuntu             # install/configure deps for Ubuntu
rangeday setup macos              # install/configure deps for macOS
rangeday setup android            # install NDK, configure Rust targets
rangeday setup ios                # install iOS Rust targets, check Xcode (macOS only)

device — Physical Device Management

rangeday device list              # list connected Android devices (adb devices)
rangeday device install android   # build + install debug APK on connected device
rangeday device logs android      # stream adb logcat (filtered to RDP)
rangeday device run ios           # build + run on iOS simulator (macOS only)

release — Tag and Push Releases

Automates semantic versioning. The CLI reads the latest tag for the target, bumps the version, creates an annotated git tag, and pushes it — triggering CI.

Always requires interactive confirmation before tagging and pushing. This prevents accidental releases from both humans and AI agents.

rangeday release server patch     # server-v1.2.3 → server-v1.2.4 (tag + push)
rangeday release server minor     # server-v1.2.4 → server-v1.3.0
rangeday release server major     # server-v1.3.0 → server-v2.0.0
rangeday release ios patch        # ios-v1.0.2 → ios-v1.0.3
rangeday release ios minor        # ios-v1.0.3 → ios-v1.1.0
rangeday release android patch    # android-v1.0.0 → android-v1.0.1
rangeday release all patch        # bump + tag all targets (full release)
rangeday release --dry-run server minor  # show what would be tagged without pushing

Example confirmation prompt:

$ rangeday release server minor

  Target:   server
  Current:  server-v1.2.4
  Next:     server-v1.3.0
  Commit:   a1b2c3d (fix: score dedup key)

  This will tag and push to origin, triggering CI deploy.
  Proceed? [y/N]

Each target (server, ios, android) maintains its own independent version. The CLI finds the latest tag matching the target prefix and increments accordingly. There is no --yes or --force flag — confirmation is always required.

new — Scaffold New Items

rangeday new migration <name>     # alias for db new
rangeday new proto <name>         # create a new .proto file from template

Design Principles

  • Verb-first for actions (serve, build, test, check, fmt) — what you’re doing is the primary axis.
  • Noun-first for domains (db, proto, bindings, device) — what you’re operating on is the primary axis.
  • Platform-aware — commands like build ios and bindings swift detect the current OS and fail with a clear message if run on the wrong platform (e.g., iOS commands on Linux).
  • Sensible defaults — bare rangeday test runs Rust workspace tests (most common). Bare rangeday fmt formats all Rust code (most common).
  • Self-documentinghelp-search searches across command names, descriptions, and keyword tags. An AI agent can always find the right command.

Platform Requirements

Some commands are platform-specific:

  • macOS onlybuild ios, bindings swift, test ios, check ios, fmt ios, device run ios, setup ios
  • Linux/macOS — everything else runs on both

The CLI detects the current OS and provides a clear error if a platform-specific command is run on the wrong system.