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