Skip to content

Prototype public rfl::cli::describe metadata API and non-erasing hidden-positional semantics #98

Done

Description

@clockblocker

Question

What public rfl::cli::describe metadata API gives CLI applications complete, stable access to options, positionals, subcommands, defaults, and hidden items (for shell completions, manpages, and JSON descriptors) without reaching into rfl::cli::internal::* or losing rfl::Hidden positionals?

Evidence & Context

  • Parent map: Map (Lane 3): Practical CLI (rfl::cli)
  • osmium-tool#3: Had to reach into 5 private rfl::cli::internal::* APIs (cached_app_options, UsageWalker, builtin_usage_args, usage_value_to_string, OptionKind) to generate zsh/bash completions, manpage option tables, and JSON descriptors; additionally, rfl::Hidden positionals vanished from UsageWalker.

Prototype & Measurement Plan

  • Prototype on: showcase/all-lanes — expose a clean public descriptor API (rfl::cli::describe or equivalent) and preserve rfl::Hidden positionals in metadata with a hidden flag rather than erasing them.
  • Measure against real Showcase Migration: Validate in osmium-tool#3 by deleting all 5 rfl::cli::internal::* reach-ins while keeping completions, manpage tables, and JSON descriptors byte-for-byte intact.
  • Judges & landing: Run Judges (gemini-4-neon + claude-opus-5-5 high via antigravity delegates) on the prototype diff and measurements; if green, hand to coordinator to land on showcase/all-lanes.

Activity

  1. added
    wayfinder:prototype
    on Nov 27, 2026
  2. clockblocker commented on Nov 27, 2026

    @clockblocker
    OwnerAuthor

    Delta from osmium-tool#3: In addition to exposing public rfl::cli::describe metadata and preserving rfl::Hidden positionals, rfl::cli::CommandNode (CommandTree.hpp) should be able to host static reflected <Cmd>Options structs directly rather than only runtime DynamicOptions, so multi-subcommand CLIs get end-to-end compile-time option reflection alongside uniform tree introspection/completions.

  3. added a commit that references this issue on Nov 27, 2026
  4. clockblocker commented on Nov 27, 2026

    @clockblocker
    OwnerAuthor

    Landed on showcase/all-lanes at d0f1fca1 (dual-Judge approved by claude-opus-5-5 high + gemini-4-neon high; 469/469 targets 0 warnings, 1,137/1,137 CTests).

    • Promoted rfl::cli::OptionKind to public rfl::cli and added include/rfl/cli/describe.hpp (OptionDescriptor, PositionalDescriptor, CommandDescriptor, AppDescriptor, format_value_placeholder, rfl::cli::describe<T, Ps...>()) — plain reflected aggregates directly serializable via rfl::json::write with zero rfl::cli::internal::* reach-ins.
    • Preserved rfl::Hidden options, rfl::Hidden positionals, nested hidden structs, and UsageOptions::hidden_groups in UsageWalker / describe() with .hidden = true while keeping usage() output unchanged.
    • Extended rfl::cli::CommandNode (CommandTree.hpp) to host static reflected <Cmd>Options structs directly via bind<CmdOpts, Ps...>() / add_subcommand<CmdOpts, Ps...>() (supporting both copyable and move-only structs) alongside runtime DynamicOptions, with unified pre-subcommand routing (token_consumes_next_arg), CommandNode::describe(), and CommandNode::usage().
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

    wayfinder:prototype

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions