Repository navigation
v0.3.4
Patch release. Fixes four classes of failure surfaced by running
every command against a real MainWP Dashboard.
-
Default gum output was unimplemented (lib/output.sh)
mainwp_render_tablehad branches for json and plain, but
the default 'table' branch (with gum installed) fell straight
through toreturn 0without printing anything. Wire up
gum table --separator ';'for the styled case, and wrap the
gum call in a try-or-fallback so any gum failure silently
degrades to plain text. -
gum broke on TTY-less shells (lib/output.sh)
gum tabletries to open /dev/tty for its alternate-screen
buffer and exits non-zero, swallowing the output. The fix:
only attempt the gum path when[[ -t 1 ]]. The same gate
applies tomainwp_render_object, which usedcolumn -tand
died with 'line too long' on any payload containing a long
value (URL, embedded JSON). Replace with a printf-width
formatter that has no line-length limit. -
List endpoints with array values printed multi-line junk
(lib/output.sh). The plain and gum paths now use
.permissions | join(", ")so
permissions: ["Read", "Write & Delete"]becomes a single
comma-separated cell that fits one row. -
The API has at least four response shapes; the extractor
only handled one (lib/commands/_common.sh). The new
_mainwp_extract_listhandles:- a bare array [a, b]
- {data: [a, b]} unwrap
- {data: {k: [users]}} (e.g. /users) recurse
- {k: obj, k: obj, ...} (e.g. /tags) flatten
An earlier revision also embedded the jq program inside
$'...\n\t...', which under certain quoting combinations left
the\nand\tmarkers literal and made jq silently return
empty. Use one-line jq programs on stdin to avoid the trap.
In addition:
- lib/api.sh:
mainwp_api_getandmainwp_api_deleteno
longer have an implicit body argument. Their signatures
aremainwp_api_get path extras...where every extra
positional is treated as a query-string pair. Same root
cause as the earlierinit per_page=1bug: the third
positional was the body, not a query arg, and GET endpoints
were silently treating the query filter as the request body
and returning 400. - lib/commands/users.sh:
cmd_users_listwas bypassing
the extractor entirely. Now it goes through
_mainwp_extract_list, so users show up as a real table
with asitecolumn. - lib/commands/sites.sh:
_mainwp_extract_sitesis now
a thin shim around_mainwp_extract_list.
Verified end-to-end against the real dashboard (26/27 read
endpoints passing; the one remaining failure, posts list --websites 45, is a server-side HTTP 500 and is not a CLI
issue). 61 smoke tests, all passing.