Skip to content

Conversation

maxdml
Copy link
Collaborator

@maxdml maxdml commented Sep 2, 2025

  • Add a CLI for workflow management and convenient start/migrate/postgres utilities
  • Update releaser program such that it 1) compiles the CLI against a few common architectures and 2) attach these as assets to the release

Usage

Screenshot 2025-09-03 at 09 56 44

CLI installation

  • Manually by downloading the asset from github
  • Running go install github.com/dbos-inc/dbos-transact-golang/cmd/dbos (note that the version, e.g. @latest, has to be specified if running go install outside of a go project)

Example (go install and local dev build)
Screenshot 2025-09-03 at 09 51 04

Screenshot 2025-09-03 at 09 51 22

Output format

The CLI has a global --json flag, e.g.:
Screenshot 2025-09-03 at 09 55 28

Notes

  • reset destroy / recreates the target database, but does not perform any migration. Migrations will be applied next time a DBOS context is created against that database.
  • init bootstraps a dbos-toolbox application

@maxdml maxdml changed the title draft CLI DBOS CLI Sep 3, 2025
@maxdml maxdml marked this pull request as ready for review September 3, 2025 17:27
Copy link
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This look good--how did we decide to handle inputs and outputs? Based on yesterday's discussion, I think the best option is for the client (and therefore the CLI) to not return any serialized values.

This is a problem for getEvent and eventually readStream as they do nothing else—can we document the need to register non-standard output types for them specifically?

Copy link
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large and good PR, so okay to merge after smaller fixes. We can fix serialization in another PR.

- do not load input/ouputs in list workflows / get workflow
- drop with force
@maxdml
Copy link
Collaborator Author

maxdml commented Sep 4, 2025

This look good--how did we decide to handle inputs and outputs? Based on yesterday's discussion, I think the best option is for the client (and therefore the CLI) to not return any serialized values.

This is a problem for getEvent and eventually readStream as they do nothing else—can we document the need to register non-standard output types for them specifically?

I modified this PR to have the calls to ListWorkflows not load the input/outputs.

I need to think a bit about the client -- right now a few methods do load input/output by default (e.g., RetrieveWorkflow and the handles' GetStatus). To maintain the simple interface we have, I think we can have these disable loading if the context hasn't been launched (== its a client)

With respect to documentation, I'll add that. Generally speaking workflow/step input/outputs have to be "serializable" in the Golang sense, that is, they must be publicly exported. This is because all go encoders use reflection under the hood (and private fields are not, by default, visible to the Reflect package (albeit backdoors exist but are documented as unsafe)

@maxdml maxdml merged commit c5e221c into main Sep 4, 2025
2 checks passed
@maxdml maxdml deleted the cli branch September 4, 2025 01:42
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.

2 participants