Skip to content

feat: add --describe flag to strategy-builder CLI#2552

Open
hardyjosh wants to merge 8 commits intotemplate-fallbackfrom
describe-registry-v2
Open

feat: add --describe flag to strategy-builder CLI#2552
hardyjosh wants to merge 8 commits intotemplate-fallbackfrom
describe-registry-v2

Conversation

@hardyjosh
Copy link
Copy Markdown
Contributor

Caution

Stacks on #2551. Merge that first.

The registry-side companion work that uses the template-fallback operator (#2551) to produce readable --describe output for existing strategies is in ST0x-Technology/st0x.registry#9 — describe works fine without it, but strategy field names will contain raw ${...} placeholders until that PR lands.

Motivation

CLI users and AI agents need a way to learn a registry's full configuration without reading the underlying .rain YAML files or running the interactive wizard. That discovery loop is currently: curl the registry file → resolve the settings URL → curl each strategy → parse the YAML by hand. Every agent we tested (6/6) burned 4+ tool calls just discovering token addresses.

Solution

Add --describe — emits a full markdown dump of the registry: every strategy, its deployments, required/optional fields (with presets and defaults), select-tokens, deposits, plus usage documentation and the address:calldata output format.

Intended as a self-generating skill. An agent can run once against a registry and have everything it needs to construct non-interactive deploy commands from a natural-language request. Each deployment includes an Example command with the exact flags and placeholders pre-filled.

Also bundled in this PR (small polish items):

  • Each field tagged (required) or (optional, default: X) so it is obvious which flags are mandatory
  • strategy-builder stdout lines are now labelled with # comment headers describing what each transaction does (approve / deploy / meta emission). Safe for cast send pipelines (with a one-line skip) and for stox submit (updated in feat: skip # comment lines in cli submit input ST0x-Technology/st0x.liquidity#578)
  • Usage section documents the # comment convention, the --tokens companion, the cast-send pipe idiom (with comment-skip), the units convention (human-readable decimal), and the build-once guidance for running the binary directly without nix develop noise

Checks

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • New Features

    • Added strategy-builder CLI command with interactive, describe, and tokens modes for deploying order strategies from registry configurations.
  • Bug Fixes

    • Made token logoURI field optional in remote token configurations.
  • Documentation

    • Updated YAML configuration: replaced gui: sections with builder: throughout codebase.
    • Renamed public APIs from GUI-centric to builder-centric terminology across CLI, SDK, and UI components.

Josh Hardy added 8 commits April 15, 2026 22:06
Emits a full markdown dump of a registry: strategies, their deployments,
fields (with presets and defaults), select-tokens, deposits, plus usage
documentation and the address:calldata output format.

Intended use: an AI agent or human can run once to learn everything
needed to construct a non-interactive deploy command for the registry.
The output includes example commands for each deployment with all
required flags filled in as placeholders.
Extend the usage section with:
- cast send pipe example for signing without the stox CLI
- Explicit note that approvals only appear when depositing
- Explanation of how to pick token addresses (block explorer /
  token list) since these are not in the registry itself
- Clarification that --owner must be a signing address

Goal: minimize the upfront context a calling agent needs before
running --describe. Most of what a user would otherwise need to
explain in the prompt is now emitted by the tool itself.
Each deployment with select-tokens now includes a code block showing
how to fetch the actual valid token addresses for that deployment via
raindex strategy-builder --tokens. Avoids inlining hundreds of token
entries in describe output.
- Mark each field as (required) or (optional, default: X)
- Add a units convention note to the usage section
- Add a build-once guidance section (run binary directly, avoid the
  npm install noise from the nix develop shellHook)
- Label calldata stdout lines with # comment headers describing each tx
- Update the cast-send pipe example to skip # comment lines and blank
  lines
- Document the # comment convention in the output format section

The # comment lines are safe for any submitter that skips lines not
matching <address>:<hex> — cast-loop example shows the idiom. The
stox submit parser will be updated in a follow-up PR to do the same.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa2f3945-36a6-4e13-8967-251df9579e05

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch describe-registry-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant