modulepackage
0.0.0-20250107081611-ac22db62026c
Repository: https://github.com/truvami/decoder.git
Documentation: pkg.go.dev
# README
đ truvami Decoder đ
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. đ ī¸
đŦ Demo
Check out this demo to see truvami Decoder in action! đ
đ Features
- đ 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.
đĻ Installation
đ§ Binaries
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
đĨī¸ Windows
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
đŗ Docker
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
đ ī¸ Usage
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.
đī¸ Basic Command Structure
decoder [command] [flags]
đ Available Commands
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.
đŠ Global Flags
-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)
đĄ Example Usage
# đ 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