Skip to content

refactor: restructure CLI commands and fix API response parsing#92

Merged
nitisht merged 4 commits intoparseablehq:mainfrom
pratik50:refactor/restructureCLI
May 1, 2026
Merged

refactor: restructure CLI commands and fix API response parsing#92
nitisht merged 4 commits intoparseablehq:mainfrom
pratik50:refactor/restructureCLI

Conversation

@pratik50
Copy link
Copy Markdown
Contributor

@pratik50 pratik50 commented May 1, 2026

Summary

Renamed stream to dataset across the PB CLI and fixed multiple API/response mismatches found during real testing with the current Parseable server, added new login methods and commands for pb.


Key Changes

Rename: streamdataset

  • pb streampb dataset
  • Updated CLI help text and internal type naming (Stream*Dataset*)

refactor (feat): login command

  • Used the username, password and Token based logi for self hosted.
  • Implemented token and OAuth loing for Cloud server users.

Feature: added status command

  • This will provide the server connection information, like current pb profile is connected to which server and status.
  • eg. Profile name, connection url, connection status etc.

Feature: added logout command

  • This command will erase the perticular profile from the config file along with all the its info.
  • This command will not make the data to "" or NULL!! now this is written in way it will remove the whole profile from toml list.

Fixes

Dataset stats

  • Fixed size fields parsing (stringuint64)
  • Improved HTTP error handling
  • Proper handling of empty datasets (404 no longer crashes)

Query

  • Switched to json.Marshal for request body generation (safer than raw string templating)

Roles

  • Removed unused Tag field
  • Fixed role list parsing (server returns a map, not an array)
  • Fixed role details parsing (actions are wrapped under { "actions": [...] })

Users

  • Updated user role response struct to correctly handle roles and group_roles

Tail

  • Added reconnect loop so pb tail keeps streaming instead of stopping on disconnect
  • Added helper to detect normal stream end vs real errors

Test

  • Tested all the command on Staging and all are working as expected with all pass checks.

@pratik50 pratik50 self-assigned this May 1, 2026
@nitisht nitisht merged commit a7904fa into parseablehq:main May 1, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants