Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

List commands return inconsistent JSON shapes (`r2 buckets list` and `images list` wrap the array)

Aperta
#346 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
json, typescript
Ambito
cli

Direzione di ricerca

Start with the CLI entry points for r2 buckets list and images list, then compare them with list commands such as cf kv namespaces list that emit bare arrays. Check each command's pagination handling and tests before choosing whether pagination metadata belongs on stderr or in a common wrapper. Done means every listed command emits the documented, consistent JSON shape and the relevant CLI output tests cover arrays, objects, and pagination.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary of the issue

Most list commands print a bare JSON array, but a few print the API's wrapper object, so you can't reuse one jq filter across products:

Command stdout
cf kv namespaces list, cf d1 list, cf zones list, cf workers list, cf queues list, cf workflows list, cf vectorize list, cf hyperdrive list, cf ai-gateway gateways list, cf secrets-store stores list, cf accounts list, cf tunnels list, … [ … ]
cf r2 buckets list { "buckets": [ … ] }
cf images list { "continuation_token": …, "images": [ … ] }

For example, cf <product> list | jq '.[].name' works for KV, D1, Queues, etc., but fails for R2 (Cannot index object with number).

Expected behaviour

List commands print a consistent shape. Either always a bare array, with pagination cursors handled by the CLI or reported on stderr, or always the same documented wrapper.

Version of cf used

1.0.0-beta.16

System information and package versions
cf 1.0.0-beta.16 (also checked in the beta.18 package source)
macOS 27.0 arm64, Node 26.8.2, npm 11.19.1
Reproduction (optional)
cf kv namespaces list | jq 'type'   # "array"
cf r2 buckets list    | jq 'type'   # "object"
cf images list        | jq 'type'   # "object"
Relevant error logs (optional)

Related: #105 (other output inconsistencies for scripts and agents), #20 (list pagination).

Lingua principale
TypeScript
Stelle
853
Fork
42
Merge medio
16h 43m
PR unite (30g)
160

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/cf

Tutte le issue di cloudflare/cf

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.