blog

New open-sourced beanhub-cli tool for trying out BeanHub Forms locally

October 12, 2023
forms
new-feature
cli
open-source

Not long ago, we announced the new BeanHub Forms feature, which allows you to define your own custom forms for making beancount data entry easier. As we use this feature daily, we soon realized that building a new custom form is not easy because you need to keep pushing new commits to BeanHub with your new form definition doc to try out the changes. It could be more efficient. We need a tool to try your form locally before pushing it to your BeanHub repository. With the idea, beanhub-cli is born.

Test your forms locally with beanhub-cli

Now, to test your forms locally, you can install beanhub-cli by

pip install beanhub-cli

Then, you can run the following command in your BeanHub repository directory like this.

bh form server

And that’s it. This command shall run a local web server at port 8080 by default and open a browser tab for you. It looks like this:

The screenshot of beanhub-cli forms

You can also list the forms via

bh form list

Or, you can verify them via

bh form validate

More than just trying out forms locally

We envision the beanhub-cli tool as a mighty Swiss knife for BeanHub users. For example, you can also run beancount-black formatter, the Beancount code syntax formatter we open-sourced with beanhub-cli format subcommand like this.

bh format main.bean

Or bh fmt for short.

Yes, it’s all open-sourced. You don’t even need a BeanHub account to use it

As we mentioned many times, we built BeanHub on top of open-source projects, so we would like to give back to the community as much as possible. When building the beanhub-cli, we wondered why not make it an open-sourced project so that everybody in the Beancount community could benefit from the tools we built. So yeah, we did. You can find the beanhub-forms project repository here and the beanhub-cli project repository here. We also open-sourced the react web components here – beanhub-web-react. You can find all of our open-sourced projects from our open-sourced projects list.

We need to clarify this doesn’t necessarily mean we won’t add new features to beanhub-cli that are only usable by BeanHub users in the future, but when it makes sense, we are more than happy to make it free and open for all users and the community.

Hope you find the new beanhub-cli tool useful, and please feel free to reach out to us at support@beanhub.io if you have any feedback. Also, please feel free to open new issues or PRs in our open-source project repositories.