Skip to content

refactor: simplify public API surface - #7

Merged
zerosnacks merged 11 commits into
masterfrom
chore/simplify-api
Aug 30, 2026
Merged

refactor: simplify public API surface#7
zerosnacks merged 11 commits into
masterfrom
chore/simplify-api

Conversation

@zerosnacks

@zerosnacks zerosnacks commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

Simplifies Argx's public API and removes framework behavior that applications do not need Argx to own.

The result is a smaller, more opinionated surface focused on command-line parsing, configuration, completion, and schema discovery.

Changes

  • Reduce Parser to parse, try_parse, parse_from, and try_parse_from.
  • Remove alternate argument-only and invocation parsing APIs.
  • Remove Argx-owned --output and --fields handling, field projection, output rendering, and the associated parser, schema, help, and completion plumbing.
  • Leave output formatting and result presentation to applications.
  • Remove the public Args marker while preserving the distinction between parser roots and reusable argument groups in the private derive protocol.
  • Move handler schema implementation details behind __private.
  • Simplify Error::InvalidValue by storing its fields directly in the enum variant.
  • Trim configuration implementation types from the crate-root facade.
  • Remove Parser::handle_completion and Parser::render_help; Parser::parse remains the canonical process entry point and handles completion requests automatically.
  • Keep completion generation behind Parser::render_completion instead of exposing a parallel script-generation API.
  • Remove the unsupported native non-Unix argv conversion path and its associated public error variant.
  • Stop pinning private derive/runtime metadata representation in tests.
  • Refresh affected help and compile-fail snapshots.
  • Rewrite and streamline the README and crate documentation around the mainline Argx workflow, including clearer configuration and schema-discovery examples.

Reduce `Parser` to the canonical parse and parse-from entry points, remove the alternate args and invocation parsing surfaces, and stop Argx from owning application output selection.

Remove the built-in `--output` and `--fields` behavior along with the associated invocation, projection, rendering, help, completion, and schema plumbing. Structured result formatting is now left to applications, while Argx remains focused on parsing, schema discovery, handlers, and configuration.

Also trim implementation-facing types from the root API, including the public `Args` marker and configuration aliases that users do not need to name.
Move schema handler plumbing behind `__private` and remove the public `Args` marker while preserving the compile-time distinction between parser roots and reusable argument groups.

Also simplify invalid-value errors by folding their payload directly into `Error::InvalidValue`, and refresh affected help and UI snapshots after the earlier output API removal.
…mpletion::script(). Cli::parse() becomes the single current-process path and still handles completions automatically. The complete example is reordered accordingly.
…cked argument conversion becomes infallible on the supported Unix targets, simplifying generated binding code too.
…-end parser/help/schema/UI coverage remains responsible for observable behavior instead of freezing private metadata representation.
@zerosnacks
zerosnacks merged commit a1f967e into master Aug 30, 2026
11 checks passed
@zerosnacks
zerosnacks deleted the chore/simplify-api branch August 30, 2026 12:46
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