Skip to content

[codex] Add curl GET data payload support#9

Merged
subsetpark merged 2 commits into
flowglad-mainfrom
codex/curl-get-data-urlencode
May 6, 2026
Merged

[codex] Add curl GET data payload support#9
subsetpark merged 2 commits into
flowglad-mainfrom
codex/curl-get-data-urlencode

Conversation

@subsetpark

@subsetpark subsetpark commented May 6, 2026

Copy link
Copy Markdown

Summary

Adds just-bash curl support for the canonical real-curl query-building form:

curl -G URL --data-urlencode 'query=...'

Implemented behavior:

  • -G / --get switches data payloads onto the URL query string while keeping the request as GET.
  • -d / --data, --data-raw, --data-binary, and --data-urlencode accumulate in invocation order and join with &.
  • --data-urlencode supports name=content, =content, and plain content forms.
  • Query encoding now uses the RFC 3986 unreserved set, including %20 for spaces and percent-encoding for *, =, &, ', and /.
  • Non--G data payloads default to POST and set Content-Type: application/x-www-form-urlencoded unless the caller already supplied one.
  • The package version is bumped to 2.14.5.

Also resolves existing repo lint blockers in sqlite dot-command code by sanitizing a forwarded dot-command error message and applying the formatter’s sqlite test change.

Deferred intentionally:

  • @filename payload forms for --data-urlencode and -d are not implemented in this PR. They now fail clearly instead of silently doing the wrong thing.
  • The --data newline-stripping distinction from --data-raw / --data-binary remains a v1 divergence.

Validation

  • PNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash exec vitest run src/commands/curl
  • PNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash exec vitest run src/commands/sqlite3/sqlite3.dot-commands.test.ts
  • PNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash typecheck
  • PNPM_HOME=/Users/zax/.local/share/pnpm pnpm lint

subsetpark added 2 commits May 6, 2026 14:58
Implement -G/--get query-string data handling for curl, with ordered accumulation for -d/--data, --data-raw, --data-binary, and --data-urlencode.

Supported --data-urlencode forms: name=content, =content, and content, using RFC 3986 unreserved encoding so spaces become %20 and characters such as *, &, =, ', and / are percent-encoded.

Defer @filename payload forms intentionally: --data-urlencode @file/name@file and -d @file now fail clearly instead of silently doing the wrong thing. The --data newline-stripping distinction from --data-raw/--data-binary remains intentionally unimplemented for this v1.
@subsetpark subsetpark marked this pull request as ready for review May 6, 2026 22:02
@flowglad-review-service

Copy link
Copy Markdown

Review Summary

Severity Count
Must-fix 0
Should-fix 0
Note 0

0 comments posted · Model: claude-sonnet-4-6 (sonnet) · Tokens: 9748 in / 6354 out · Cache: 160528 created / 738973 read · Context: 56 items · Review mode: agentic · Turns: 15 · Tool calls: 16 · Forced submit: yes · Tool mix: read_file=11, search_codebase=5

@subsetpark subsetpark merged commit 88edd83 into flowglad-main May 6, 2026
3 checks passed
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