Skip to content

Improve CLI human output UX#90

Closed
odyslam wants to merge 37 commits into
mainfrom
codex/human-output-ux
Closed

Improve CLI human output UX#90
odyslam wants to merge 37 commits into
mainfrom
codex/human-output-ux

Conversation

@odyslam
Copy link
Copy Markdown
Contributor

@odyslam odyslam commented May 10, 2026

Summary

  • Make default CLI output human-first across command surfaces, including auth, config, workflow, schema, API discovery, dry-run, export, job, artifact, request log, collection, incident, and raw API response views.
  • Add --toon as the compact agent-readable output mode while preserving --json and hidden legacy --format compatibility.
  • Polish the default human UX across the audited command set: source metadata now says Source: Phylax platform index, empty lists say what was not found, mixed search results show all buckets, project/account/deployment/member outputs get dedicated layouts, and human errors include API-provided reasons without raw envelope instructions.
  • Update agent-facing docs, the LLM guide, and smoke checks to use --toon.
  • Bump the workspace patch version from 1.4.2 to 1.4.3.

Reviewer Guide

  • Inspect crates/pcl/common/src/args.rs for the three output modes: default human, --toon, and --json.
  • Inspect crates/pcl/core/src/api.rs for human renderers, next-action filtering, search/project/account/deployment/member formatting, source labels, and cleaned error rendering.
  • Inspect crates/pcl/core/src/config.rs and crates/pcl/core/src/surface.rs for safer human next actions around config and doctor failures.
  • Run cargo run --locked -q -p pcl -- incidents --limit 3 and confirm the default view is a readable table/summary, not the full envelope dump.
  • Also spot-check search --query linea, projects --project-id <id>, releases --project <id>, access --pending, integrations --project <id> --provider slack, api call GET /views/public/incidents --query limit=3 --dry-run, and representative errors like api list --limit 3.
  • Compare --toon and --json on representative commands such as workflows, schema list, api list --filter incidents, auth status, and requests list --limit 3.
  • Check AGENTS.md, README.md, and scripts/agent-smoke.sh for the new agent-facing --toon guidance.

Validation

  • make ci
  • make audit
  • cargo run --locked -q -p pcl -- --version -> pcl 1.4.3
  • Focused human-output regression tests: cargo test -p pcl-core --lib 'human_' -- --nocapture
  • Default-output audit over 928 lines in /tmp/pcl-human-full-audit-final.txt found no legacy/bad UX markers: Details:, Schema: pcl.envelope.v1, Request:, Response:, from offchain, item(s), raw clap error:/Usage:, config delete, Read error.http.body, Use data.*, or blank Body:.

@odyslam odyslam marked this pull request as ready for review May 10, 2026 04:11
@odyslam
Copy link
Copy Markdown
Contributor Author

odyslam commented May 10, 2026

Follow-up commit 6fdea9b completes the broader default-output audit pass.

What changed in this commit:

  • Replaced internal collection metadata like Fetched ... from offchain with human labels: Updated: and Source: Phylax platform index.
  • Added targeted human layouts for project detail, account detail, deployments, integrations, protocol manager state, transfer state, members, invitations, releases, events, and mixed search results.
  • Cleaned successful empty states from generic No results. into concrete text like No assertions found. / No releases found. and removed placeholder next steps when there is no item to inspect.
  • Cleaned human errors so clap parse failures no longer dump raw error:/Usage: blocks, and API failures surface the API-provided reason plus request ID.
  • Accepted uppercase HTTP methods for raw API calls (GET, POST, etc.) because humans type them that way.
  • Updated config/doctor next actions to avoid destructive or irrelevant suggestions in healthy/default human flows.

Validation after this commit:

  • make ci
  • make audit
  • cargo test -p pcl-core --lib 'human_' -- --nocapture
  • 928-line safe-command/default-error audit in /tmp/pcl-human-full-audit-final.txt with no old envelope/bad UX markers.

@odyslam
Copy link
Copy Markdown
Contributor Author

odyslam commented May 10, 2026

Follow-up commit bef3189 fixes the user-project discovery path:

  • Makes pcl projects --mine the primary documented flag and keeps --home as an alias.
  • Adds a dedicated default human renderer for /views/projects/home, so it prints a Your projects table with project, slug, network, visibility, and ID instead of backend field names.
  • Updates next actions and README guidance to point people and agents at pcl projects --mine.
  • Adds parser/request/renderer regression tests for --mine, --home, and the human project-home output.

Local validation after this commit:

  • cargo test -p pcl-core
  • cargo build -p pcl
  • ./target/debug/pcl projects --help
  • ./target/debug/pcl projects --mine
  • ./target/debug/pcl projects --home --dry-run
  • make ci
  • make audit

@odyslam
Copy link
Copy Markdown
Contributor Author

odyslam commented May 11, 2026

Follow-up commit 1450743 is the command-surface DevEx audit pass.

I ran the default command surface and representative read-only/error paths locally, then fixed the remaining rough spots:

  • pcl search no longer sends a bad /search request with no query; it fails locally with useful examples.
  • Project-scoped commands now point users to pcl projects --mine and the relevant command help when --project / --project-id is missing.
  • pcl events now uses the same human workflow error path as the other API workflows instead of raw clap required-argument text.
  • Missing subcommands for api, auth, config, and export now say what to do next instead of only echoing the command description.
  • Unknown/invalid subcommands now get better next actions, including schema get / workflows show hints for common mistakes.
  • apply, build, and download runtime failures now use typed human error envelopes instead of Code: unknown.
  • Auth/whoami next actions now send users to pcl projects --mine.
  • Deployment/project count labels now say 0 contracts / 0 assertions instead of generic item wording.

Validation:

  • make ci
  • make audit
  • final local audit logs: 469 no-flag/default lines, 310 representative workflow lines, and 117 error-path lines scanned with no legacy markers like Details:, Schema:, raw Request:/Response:, from offchain, item(s), raw clap Usage:, Code: unknown, or accidental Use data.* guidance.

@odyslam odyslam requested a review from lean-apple May 12, 2026 23:43
@odyslam odyslam force-pushed the codex/human-output-ux branch from 0de29d7 to 7a33ee7 Compare May 15, 2026 18:58
@odyslam
Copy link
Copy Markdown
Contributor Author

odyslam commented May 23, 2026

Closing this oversized PR in favor of smaller stacked PRs. The current diff is too large to review cleanly; I am preserving the work and will reopen it as a reviewable stack with the generated-client pruning included in the final layer.

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