You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: --json output mode for whoami / list-path / resolve
Add a --json flag to the read-side commands so other tools can parse
structured output instead of scraping the emoji-decorated default text:
python cli.py whoami --json
python cli.py list-path /Documents --json
python cli.py resolve /Documents/foo.pdf --json
Output shapes:
whoami → {"logged_in": bool, "user": {email, uuid, rootFolderId}|null}
list-path → drive_service.list_folder_with_paths verbatim
({current_path, folders[], files[]})
resolve → drive_service.resolve_path verbatim
({type, uuid, path, metadata})
Errors are emitted as {"error": "<msg>"} on stderr with exit code 1, also
under --json. The default human-readable output is unchanged when --json
is absent.
Motivation: CrispSorter (sibling project) wants to drive list/stat
operations from Rust without subprocess text-scraping. With --json the
Rust side does plain serde_json::from_slice on the CLI output and gets
typed structs back. The same pattern would help any other tool that
wants to script around internxt-cli (jq pipelines, other languages, CI).
Verified live: `python cli.py whoami --json` against a logged-in account
returns valid JSON; downstream Rust deserialisation tests in CrispSorter
pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments