truvami Decoder is a command-line interface (CLI) tool written in Go for decoding truvami payloads. This reference implementation supports various payload types, including Nomad XS and different Tag formats. π οΈ
Check out this demo to see truvami Decoder in action! π
- π Payload Decoding: Decode Nomad XS, Tag S/L, and Tag XL payloads with ease.
- π HTTP Server: Start a local HTTP server to decode payloads using RESTful APIs.
- π Flexible Output: Choose between standard console output and JSON format.
- π οΈ Debugging & Verbosity: Enable debugging and verbose output for detailed insights.
- ποΈ Autocompletion: Generate autocompletion scripts for your favorite shell.
- π Cross-Platform: Works on Windows, macOS, and Linux.
You can install the truvami Decoder binary easily using the following command:
# This will install the binary at $(go env GOPATH)/bin/decoder
curl -sSfL https://raw.githubusercontent.com/truvami/decoder/main/install.sh | sh -s -- -b $(go env GOPATH)/bin
# β
Verify the installation by checking the help
decoder --help
For Windows users, you can install the truvami Decoder binary using Chocolatey:
# Install using Chocolatey
choco install truvami-decoder
# β
Verify the installation by checking the help
decoder --help
You can also run the truvami Decoder using Docker:
# Pull the latest Docker image
docker pull ghcr.io/truvami/decoder
# Run the Docker container
docker run -it ghcr.io/truvami/decoder decoder --help
# Run the Docker container to start the HTTP server
docker run -p 8080:8080 ghcr.io/truvami/decoder decoder http --port 8080 --host 0.0.0.0
truvami Decoder provides a variety of commands and options to help you decode payloads efficiently. Below is an overview of the available commands and flags.
decoder [command] [flags]
completion
- ποΈ Generate the autocompletion script for the specified shell.help
- βΉοΈ Display help information about any command.nomadxs
- 𧩠Decode Nomad XS payloads.tagsl
- π·οΈ Decode Tag S / L payloads.tagxl
- π·οΈ Decode Tag XL payloads.http
- π Start local HTTP server to decode payloads.
-d, --debug
- π Display debugging output in the console. (default: false)-h, --help
- βΉοΈ Display help information.-j, --json
- π Output the result in JSON format. (default: false)-v, --verbose
- π’ Display more verbose output in the console. (default: false)
# π Decode a Nomad XS payload with verbose output
decoder nomadxs 1 0002c420ff005ed85a12b4180719142607240001ffbaffc2fc6f09a71d2e
# π Decode a Tag S / L payload and output the result in JSON format
decoder tagsl 1 8002cdcd1300744f5e166018040b14341a -j
# π Start a HTTP server
decoder http --port 8080 --host 0.0.0.0
# π Call HTTP server using curl
curl -XPOST -H "Content-type: application/json" -d '{
"port": 1,
"payload": "8002cdcd1300744f5e166018040b14341a",
"devEui": ""
}' 'http://localhost:8080/tagsl/v1'
# ποΈ Generate autocompletion script for bash
decoder completion bash
For more detailed information on each command, use:
decoder [command] --help