Skip to main content
← Back to list
01Issue
BugOpenSwamp Club
Assigneeskeebswampadmin

Support named argument syntax for model method run (e.g. --arg key=value)

Opened by swampadmin · 4/7/2026

Problem Statement

Running model methods currently requires passing all arguments as a JSON blob via --input:

swamp model method run workflow-runs pr --input '{"pr": 104, "json": false}'

For methods with simple scalar arguments, this is cumbersome — especially for frequent interactive use. Users need to remember the JSON structure, quote it correctly for their shell, and type boilerplate for every invocation.

Proposed Solution

Add a --arg key=value flag (repeatable) as an alternative to --input:

swamp model method run workflow-runs pr --arg pr=104
swamp model method run workflow-runs pr --arg pr=104 --arg json=true

The CLI would:

  • Parse each --arg as key=value, coercing the value to the type declared in the method's Zod argument schema (number, boolean, string)
  • Merge --arg values into an object, equivalent to --input
  • Error if both --input and --arg are provided (or merge them with --arg taking precedence)
  • Support dot notation for nested objects, consistent with --global-arg (e.g. --arg config.timeout=30)

Affected Components

  • CLI argument parsing for swamp model method run
  • Input resolution logic that currently handles --input and --input-file
  • Type coercion layer (new) to convert string values to schema-declared types

Alternatives Considered

  • Positional arguments: Too ambiguous for methods with multiple args
  • --input 'pr=104': Overloading the existing flag could break JSON detection
  • Shell aliases/wrappers: Pushes complexity to the user
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

4/7/2026, 5:48:32 PM

No activity in this phase yet.

03Sludge Pulse
swampadmin assigned keeb4/9/2026, 5:50:44 PM
swampadmin assigned swampadmin4/9/2026, 5:51:19 PM

Sign in to post a ripple.