A command-line interface tool for managing Hawkbit, a scalable and modular update server. This tool provides a user-friendly way to interact with Hawkbit without needing to make direct API calls.
hawk-tui is a Go-based CLI application that allows you to manage:
- Targets - Device targets that can receive software updates
- Software Modules - Software components with versions and types
- Distribution Sets - Bundles of software modules that can be deployed
- Rollouts - Phased deployments of distribution sets to targets
- Go 1.16 or higher
# Build the project
make build
# The binary will be created as `ht`
./ht --helpmake cleanThe tool requires authentication with a Hawkbit server. Configuration is provided via environment variables:
HAWKBIT_URL- Hawkbit server URLHAWKBIT_USER- API usernameHAWKBIT_PASS- API password
ht [global-flags] <command> <subcommand> [flags]-v, --verbose- Enable verbose debug logging
Manage device targets.
ht target <subcommand> [flags]
# or use the alias: ht t <subcommand>Subcommands:
-
show(alias:get) - Display detailed information about a target-i, --id- Controller ID of the target (required)--show-token- Display the security token
-
list(alias:ls) - List all targets--short- Output only controller IDs as space-separated list--show-token- Display security tokens
-
create- Create a new target-n, --name- Target name (required)-i, --id- Controller ID (optional, defaults to name)--desc- Description (optional)
-
delete(aliases:remove,rm) - Delete a target--id- Controller ID (required)
-
attr-get- Get a specific target attribute-i, --id- Controller ID (required)-a, --attribute- Attribute to retrieve:name,token(required)
Manage software modules and artifacts.
ht software-module <subcommand> [flags]
# or use the alias: ht sm <subcommand>Subcommands:
-
show(alias:get) - Display detailed information about a software module--id- Module ID (required)
-
list(alias:ls) - List all software modules -
create- Create a new software module--name- Module name (required)--version- Module version (required)--type- Module type (required)--file- Optional artifact file to upload
-
delete(aliases:remove,rm) - Delete a software module--id- Module ID (required)
-
upload-artifact- Upload an artifact to a software module--id- Module ID (required)--file- Path to artifact file (required)
-
delete-artifact- Delete an artifact from a software module--module-id- Module ID (required)--artifact-id- Artifact ID (required)
Manage distribution sets (collections of software modules).
ht distribution-set <subcommand> [flags]
# or use the alias: ht ds <subcommand>Subcommands:
-
show(alias:get) - Display detailed information about a distribution set--id- Distribution set ID (required)
-
list(alias:ls) - List all distribution sets -
create- Create a new distribution set--name- Distribution name (required)--version- Distribution version (required)--type- Distribution type (optional, defaults to 'os')--description- Description (optional)
-
delete(aliases:remove,rm) - Delete a distribution set--id- Distribution set ID (required)
-
assign-software-module(alias:asm) - Assign a software module to a distribution set--dist-id- Distribution set ID (required)--sw-module-id- Software module ID (required)
-
unassign-software-module(alias:usm) - Remove a software module from a distribution set--dist-id- Distribution set ID (required)--sw-module-id- Software module ID (required)
-
show-type- Display information about a distribution set type--id- Distribution set type ID (required)
-
list-types- List all distribution set types -
create-type- Create a new distribution set type--name- Type name (required)--key- Type key (required)
Manage software rollouts (deployments to targets).
ht rollout <subcommand> [flags]
# or use the alias: ht r <subcommand>Subcommands:
-
show(alias:get) - Display detailed information about a rollout--id- Rollout ID (required)
-
list(alias:ls) - List all rollouts -
create- Create a new rollout--name- Rollout name (required)--dist-id- Distribution set ID (required)--target-filter- Target filter query (required)--desc- Description (optional)
-
delete(aliases:remove,rm) - Delete a rollout--id- Rollout ID (required)
-
start- Start a rollout--id- Rollout ID (required)
-
pause- Pause a running rollout--id- Rollout ID (required)
Make direct API calls to Hawkbit.
ht api <endpoint> [flags]Flags:
--method- HTTP method (GET, POST, DELETE, UPDATE) (required)--body- Request body (optional)
ht target create --name my-device --id device-123ht software-module create --name firmware --version 1.0.0 --type osht target listht target show --id device-123 --show-token# Create a software module with a file
ht software-module create --name firmware --version 1.0.0 --type os --file /path/to/firmware.bin
# Create a distribution set
ht distribution-set create --name release-1 --version 1.0
# Assign the software module to the distribution set
ht distribution-set assign-sw --dist-id 1 --sw-module-id 1
# Create a rollout
ht rollout create --name deployment-1 --dist-id 1 --target-filter name==device-*
# Start the rollout
ht rollout start --id 1make buildmake cleanmake helpSee LICENSE file for details.