Skip to content

[Advanced] nirium CLI: 'pay' and 'serve' commands for x402 #30

Description

@Eras256

Difficulty: Advanced (senior · 7/10). ~12–18h. Node/TypeScript CLI, Stellar keypair handling, x402.

Context

packages/cli is currently minimal. Developers want to (a) pay an x402-protected endpoint straight from the terminal and (b) spin up a protected endpoint to test against — without writing code. Both belong in the existing nirium CLI.

Goal

Two new commands in the existing nirium CLI, fully typed and tested.

Scope / Deliverables

  1. nirium pay <url> [--amount] [--network] — reads the 402 payment requirements, signs the Stellar auth entry from a configured secret, performs the pay→retry, and prints the response plus a tx reference.
  2. nirium serve --price --pay-to [--port] — starts a local x402-protected demo endpoint (reuse the SDK server helper) so a developer can test pay against it.
  3. Config & safety: secret via env or a nirium config store; the secret is never printed; actionable errors on misconfig.
  4. --help for both commands with examples; clean, scriptable output.
  5. Tests: argument parsing + the full 402 flow with the network mocked.
  6. Update the CLI README.

Acceptance criteria

  • nirium pay works end-to-end on testnet against a real facilitator (include a tx hash that resolves on stellar.expert in the PR).
  • No secret leakage in logs or output; typed public surface; lint/CI pass.

Pointers

  • Extend packages/cli; reuse the SDK's x402 client; keep @x402/* versions aligned with the SDK.

Reward

Eligibility is subject to GrantFox review after the campaign (Official Campaign | FWC26). Rewards are decided by GrantFox based on quality and available budget and are not guaranteed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions