Skip to content

Conversation

@ThomasK33
Copy link
Member

Summary

  • Migrate CLI to commander for structured subcommand handling and auto-generated help
  • Add mux api subcommand that exposes oRPC procedures via trpc-cli
  • Proxy API calls to the running mux server via HTTP instead of initializing services locally
  • Improve help output with hierarchical schema descriptions for complex Zod types

Generated with mux

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 force-pushed the cli-api-orpc-proxy branch 2 times, most recently from 34bae5e to 9602beb Compare December 3, 2025 12:00
@ThomasK33
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 added this pull request to the merge queue Dec 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 3, 2025
Replace manual argv parsing with commander.js to provide proper
subcommand handling, automatic help generation, and conventional
-v/--version flags. Adds trpc-cli as a dependency (likely for future
oRPC CLI tooling).
Integrates trpc-cli to expose the oRPC router as CLI commands,
enabling scripted interactions without running the full desktop
app or server. Services are lazily initialized only when the api
subcommand is invoked to avoid startup overhead for other commands.
Instead of initializing services locally, the api subcommand now
proxies oRPC procedure calls to a running mux server. This avoids
the heavyweight service initialization when using the CLI and
ensures consistent behavior with the server.

Key changes:
- Add proxifyOrpc utility that wraps an oRPC router to forward
  calls via HTTPRPCLink to a remote server
- Lazily import trpc-cli only when api command is invoked
- Remove inline service context creation from CLI entry point
- Enhance Zod 4 schema descriptions for better CLI help output
Enhance the proxifyOrpc schema description system to produce readable,
hierarchical help output for complex Zod schemas. Previously, the CLI
showed raw JSON Schema (anyOf, oneOf) for unions and nested objects.

Key changes:
- Add hierarchical YAML-like formatting for nested objects
- Separate required/optional fields with clear headers
- Handle discriminated unions by showing variant labels
- Detect common discriminators (type/kind/tag) in plain unions
- Replace complex fields with z.any().describe() to prevent trpc-cli
  from appending JSON Schema noise to descriptions
- Convert void/undefined inputs to empty object schema for proper
  JSON Schema conversion
- Preserve _zod property for Zod 4 detection in trpc-cli
- Simplify api.ts by removing function wrapper and module-level init
- Rename "oRPC API" to "mux API" for consistency
@ThomasK33 ThomasK33 added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit 85cf87e Dec 3, 2025
15 checks passed
@ThomasK33 ThomasK33 deleted the cli-api-orpc-proxy branch December 3, 2025 16:48
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