feat(flow-ai): issue Flow reads via flowbio CLI api get instead of curl - #9
Merged
Merged
Conversation
Records the approved design to replace curl-based Flow reads with the flowbio CLI's read-only 'api get' passthrough, so the CLI owns authentication and reads stop re-prompting for approval. Captures the two deliberate curl remnants (run POST, byte download), the shared version pin bump to 0.9.0, hook removal, and the new auth guidance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Flow reads are moving from curl to the flowbio CLI's 'api get' command, which resolves the token itself. That produces a stable, secret-free command prefix Claude Code can allowlist by normal means, so the opt-in PreToolUse hook that auto-approved the curl reads is no longer needed. Deletes the hook, its test, and the hooks manifest; drops the hook test from CI; and replaces the README's env-var opt-in with allowlist guidance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reads now run through the flowbio CLI's read-only 'api get' passthrough, which resolves the token from ~/.config/flow/api-token itself. This lets the CLI own authentication, so read commands carry no embedded secret and share a stable, allowlistable prefix. - §3 configuration rewritten for 'flowbio api get <PATH> --param k=v --json', CLI-resolved base URL and auth, and new authentication guidance shown on auth failure / when auth is expected. - §4.1 runner preflight now gates the first CLI call of any kind (read or upload), with the shared pin bumped 0.7.0 -> 0.9.0 (first release carrying 'api get' plus the upload commands). No curl fallback for reads. - §1 token discipline rescoped: only the pipeline-run curl references the token directly; reads and uploads never handle it. - §6/§7 querying and output patterns updated (--param, drop the flow-ai read User-Agent). §8 error handling flips to the --json envelope, trusting the server status_code + message over the coarse exit code. Pipeline runs and file downloads stay on curl (api get is GET-only and returns text, unsuitable for binary downloads). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rewrites the worked examples and endpoint references so every GET read uses 'flowbio api get <PATH> --param k=v --json | jq' instead of curl. The file download (Example 7) and pipeline run (Examples 22-23) keep curl, since api get is GET-only and returns text; their discovery reads still convert to api get. - examples.md: all 17 read recipes converted; --data-urlencode -> --param; ?owned/?log query strings -> --param; auth preamble rewritten (the CLI attaches the token itself, no header to prepend). - endpoints/pipelines.md: GET-auth prose no longer tells the agent to attach an Authorization header on reads (the CLI does it); run-POST User-Agent bumped to flow-ai/0.10.0. - endpoints/downloads.md: authenticated download documents attaching the token to its curl directly (second curl remnant). - endpoints/data.md, samples.md: upload pins bumped 0.7.0 -> 0.9.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the read-mechanism migration across the supporting material: - evals: read scenarios now assert 'flowbio api get … --json' with the CLI resolving the token (no hand-rolled Authorization header or flow-ai User-Agent); --data-urlencode -> --param; the 'HTTP 200 with nulls' framing reframed as 'a successful read returning nulls'; upload pins bumped 0.7.0 -> 0.9.0; stale SKILL.md section refs corrected to §6. - README: token-file note and versioning section reflect CLI-owned auth and the UA surviving only on the run/download curls; lockstep grep updated to the current version. - plugin.json bumped 0.9.0 -> 0.10.0; CHANGELOG documents the migration, the hook removal, the shared pin bump, and the breaking no-curl-fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rage) Round-1 review findings (all recommended/optional; verdict APPROVED): - Make emitted read commands byte-identical to the README permission allowlist by dropping the quotes around the pinned spec (uvx --from flowbio==0.9.0 …). Claude Code prefix-matches the raw string, so the quoted form would never match the unquoted allowlist entry and reads would keep prompting — defeating the change's purpose. Added a note by the allowlist so the quoting can't drift again. - Add eval coverage for the two new spec-central negative paths: a read with no runner present (017), and auth guidance when a caller-scoped read has no token (018). - Rescope the README pre-release lockstep grep so it stops flagging the evals' flow-ai/<version> placeholder and historical release numbers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
@claude please review this PR |
Live testing revealed two issues surfaced by the move to api get: 1. The skill's long-standing claim that /me returns 'HTTP 200 with a record of nulls' for a missing/invalid token is stale — the current Flow API returns 401 (verified via both curl and the CLI, for absent and garbage tokens). Search endpoints (/samples/search etc.) DO still silently treat a bad token as anonymous and return a misleading owned=true count, which is why owned-scoped queries are still gated on a successful /me. Corrected the model across SKILL §8 (already had the 401/403 row), examples.md (12, 14, preamble), endpoints/users.md and samples.md, and evals 001-004 + 018. This is a pre-existing inaccuracy (API drift) that the auth-guidance feature depends on getting right. 2. Reads pipe through jq (flowbio api get ... --json | jq ...). Claude Code auto-approves a piped command only when every segment is allowlisted and offers no one-click 'don't ask again' for multi-segment commands, so the documented allowlist now also includes Bash(jq:*) — otherwise reads keep prompting despite the flowbio api get rule. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The
flow-aiskill previously performed every Flow read withcurl, embedding the token via$(< ~/.config/flow/api-token)— a command substitution Claude Code won't prefix-allowlist, so every read re-prompted for approval (a bespoke opt-in hook existed solely to suppress those prompts).This reworks reads onto the flowbio CLI's new read-only passthrough,
flowbio api get <PATH> --param k=v --json. The CLI resolves the token itself (from~/.config/flow/api-token, or anonymous), so read commands carry no embedded secret and share a stable, allowlistable prefix — which lets the hook be deleted entirely.Changes
flowbio api getacrossSKILL.md,examples.md(17 recipes), and the endpoint reference; discovery reads inside the pipeline-run flow move too.hooks/flow-read-approve.sh+ test +hooks.json) and its CI wiring; README now documents the recommendedpermissions.allowentries.0.7.0→0.9.0(first release carryingapi getalongside the upload commands — one pin for reads and uploads).--jsonenvelope, trusting the serverstatus_code+messageover the coarse exit code.0.9.0→0.10.0; CHANGELOG entry added.Deliberately kept on curl
POST /pipelines/versions/<id>/run(confirmation-gated;api getis GET-only) andGET /downloads/<id>/<file>(raw bytes;api getreturns text). Both keep token discipline via$(< … ).Breaking
Reads now require a runner (uv/pipx/flowbio) just like uploads — no curl fallback. On a machine with none, reads stop with an install message.
Verification
scripts/validate_skills.pypasses; 18 eval JSON files valid (added017-read-no-runner,018-auth-guidance-when-expected).flowbio api getagainst the public API: catalog fetch,--paramfiltered search, and the error envelope (count=99999→ exit 5 +{"message", "status_code": 400}).Out of scope
Adding a POST/mutation passthrough to the flowbio CLI; changing the upload flows beyond the pin bump; bulk multi-file (zip) downloads. A pre-existing missing CHANGELOG
0.9.0entry (clip-analysis release) was not backfilled.🤖 Generated with Claude Code