BUX: CLI
Command line application for interacting with BUX

Table of Contents
Installation
Install with brew
brew tap BuxOrg/bux-cli && brew install bux-cli
buxcli
Install using a compiled binary on Linux or Mac (Mac example)
curl -LkSs https://github.com/BuxOrg/bux-cli/releases/download/v0.3.24/bux-cli_macOS_64-bit.tar.gz -o app.tar.gz
tar -zxf app.tar.gz && cd ./app/
./buxcli
Install with go
go get github.com/BuxOrg/bux-cli
cd /$GOPATH/src/github.com/BuxOrg/bux-cli && make install
buxcli
What is BUX?
Read more about BUX
Getting Started
The default configuration will use a config.json and datastore.db
file located in your home directory (~/bux-cli/).
It is recommended to make changes to the ~/bux-cli/config.json file.
You can override this location by using the --config flag.
buxcli <command> --config=/path/to/config.json
Start by creating a new xpriv using the xpriv command.
buxcli xpriv new
Next, create a new xpub using the xpub command.
buxcli xpub new <xpriv> --metadata='{ "name": "xpub_1", "description": "my xpub description"}'
Now you can create a new destination using the destination command.
buxcli destination new <xpub> --metadata='{ "name": "destination_1", "description": "my destination description"}'
Finally, you can record a transaction using the transaction command.
buxcli transaction record <xpub> --txid=<tx_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'
Commands
destination
Create a new destination using optional metadata (view example)
buxcli destination new <xpub> --metadata='{ "name": "destination_1", "description": "my destination description"}'
Get an existing destination from id (view example)
buxcli destination get <destination_id> <xpub_id>
Get an existing destination from locking script (view example)
buxcli destination get <locking_script> <xpub_id>
Get an existing destination from address (view example)
buxcli destination get <address> <xpub_id>
Get help for the destination command
buxcli destination --help
transaction
Record a transaction using a Transaction ID into BUX (view example)
buxcli transaction record <xpub> --txid=<tx_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'
Record a transaction using hex into BUX (view example)
buxcli transaction record <xpub> --hex=<tx_hex> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'
Record a transaction using hex and a previously generated draft id into BUX (view example)
buxcli transaction record <xpub> --hex=<tx_hex> --draft=<draft_id> --metadata='{ "name": "transaction_1", "description": "my transaction description"}'
Get transaction information from BUX (view example)
buxcli transaction info <xpub_id> --txid=<tx_id>
Get transaction information from BUX and WhatsOnChain (view example)
buxcli transaction info <xpub_id> --txid=<tx_id> -w
Get help for the transaction command
buxcli transaction --help
xpub
Create a new xpub with optional metadata (view example)
buxcli xpub new <xpriv> --metadata='{ "name": "xpub_1", "description": "my xpub description"}'
Get an existing xpub record from key (view example)
buxcli xpub get <xpub>
Get an existing xpub record from xpub id (view example)
buxcli xpub get <xpub_id>
Get an existing xpub record using metadata (view example)
buxcli xpub get -m=<metadata_json>
Get help for the xpub command
buxcli xpub --help
xpriv
Create a new xpriv key (view example)
buxcli xpriv new
Get information about an existing xpriv key (view example)
buxcli xpriv info <xpriv>
Get help for the xpriv command
buxcli xpriv --help
Documentation
Get started with the examples. View the generated golang godocs.
All the generated command documentation can be found in docs/commands.
Supported Operating Systems
- Linux
- Mac
- Windows (coming soon)
Custom Configuration
The configuration file should be located in your $HOME/buxcli folder and named config.json.
View the example config file.
You can also specify a custom configuration file using --config "~/folder/path/config.json"
Local Database (Cache)
The database is located in your $HOME/buxcli folder.
To clear the entire database:
buxcli --flush-cache
Run commands ignoring local cache:
buxcli some_command --no-cache
Package Dependencies
Application Deployment
goreleaser for easy binary deployment to GitHub and can be installed via: brew install goreleaser.
The .goreleaser.yml file is used to configure goreleaser.
Use make release-snap to create a snapshot version of the release, and finally make release to ship to production.
The release can also be deployed to a homebrew repository: homebrew-bux-cli.
Makefile Commands
View all makefile commands
make help
List of all current commands:
all Runs multiple commands
build Build all binaries (darwin, linux, windows)
clean Remove previous builds and any test cache data
clean-mods Remove all the Go mod cache
coverage Shows the test coverage
darwin Build for Darwin (macOS amd64)
diff Show the git diff
gen-docs Generate documentation from all available commands (fresh install)
generate Runs the go generate command in the base of the repo
gif-render Render gifs in .github dir (find/replace text etc)
godocs Sync the latest tag with GoDocs
help Show this help message
install Install the application
install-go Install the application (Using Native Go)
install-releaser Install the GoReleaser application
lint Run the golangci-lint application (install if not found)
linux Build for Linux (amd64)
release Full production release (creates release in Github)
release Runs common.release then runs godocs
release-snap Test the full release (build binaries)
release-test Full production test release (everything except deploy)
replace-version Replaces the version in HTML/JS (pre-deploy)
tag Generate a new tag and push (tag version=0.0.0)
tag-remove Remove a tag if found (tag-remove version=0.0.0)
tag-update Update an existing tag to current commit (tag-update version=0.0.0)
test Runs lint and ALL tests
test-ci Runs all tests via CI (exports coverage)
test-ci-no-race Runs all tests via CI (no race) (exports coverage)
test-ci-short Runs unit tests via CI (exports coverage)
test-no-lint Runs just tests
test-short Runs vet, lint and tests (excludes integration tests)
test-unit Runs tests and outputs coverage
uninstall Uninstall the application (and remove files)
update-linter Update the golangci-lint package (macOS only)
update-terminalizer Update the terminalizer application
vet Run the Go vet application
windows Build for Windows (amd64)
Examples & Tests
All unit tests and examples run via GitHub Actions and
uses Go version 1.18.x. View the configuration file.
Run all tests (including integration tests)
make test
Code Standards
Read more about this Go project's code standards.
Usage
View all the examples and see the commands above
All the generated command documentation can be found in docs/commands.
Maintainers
Contributing
View the contributing guidelines and please follow the code of conduct.
How can I help?
All kinds of contributions are welcome 🙌!
The most basic way to show your support is to star 🌟 the project, or to raise issues 💬.
You can also support this project by becoming a sponsor on GitHub 👏
or by making a bitcoin donation to ensure this journey continues indefinitely! 🚀

License
