{"id":28915931,"url":"https://github.com/datanoisetv/swupdate-cli","last_synced_at":"2026-04-28T00:31:48.225Z","repository":{"id":299914700,"uuid":"1004621617","full_name":"DatanoiseTV/swupdate-cli","owner":"DatanoiseTV","description":"A command line client for swupdate to perform updates with status reporting on the CLI.","archived":false,"fork":false,"pushed_at":"2025-06-19T00:26:18.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T00:27:10.263Z","etag":null,"topics":["cli","embedded","embedded-linux","linux","swupdate","yocto"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DatanoiseTV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-18T23:25:44.000Z","updated_at":"2025-06-19T00:24:56.000Z","dependencies_parsed_at":"2025-06-19T00:37:13.945Z","dependency_job_id":null,"html_url":"https://github.com/DatanoiseTV/swupdate-cli","commit_stats":null,"previous_names":["datanoisetv/swupdate-cli"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/DatanoiseTV/swupdate-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatanoiseTV%2Fswupdate-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatanoiseTV%2Fswupdate-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatanoiseTV%2Fswupdate-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatanoiseTV%2Fswupdate-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DatanoiseTV","download_url":"https://codeload.github.com/DatanoiseTV/swupdate-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatanoiseTV%2Fswupdate-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260659975,"owners_count":23043473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","embedded","embedded-linux","linux","swupdate","yocto"],"created_at":"2025-06-21T23:06:48.722Z","updated_at":"2026-04-28T00:31:48.218Z","avatar_url":"https://github.com/DatanoiseTV.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SWUpdate CLI Client\n\n[![CI](https://github.com/DatanoiseTV/swupdate-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/DatanoiseTV/swupdate-cli/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/DatanoiseTV/swupdate-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/DatanoiseTV/swupdate-cli)\n[![Go Report Card](https://goreportcard.com/badge/github.com/DatanoiseTV/swupdate-cli)](https://goreportcard.com/report/github.com/DatanoiseTV/swupdate-cli)\n[![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE)\n\nA command-line client for uploading firmware to devices running [SWUpdate](https://sbabic.github.io/swupdate/). This tool provides a simple interface for firmware updates with real-time progress monitoring via WebSocket connections.\n\n## Features\n\n- **Firmware Upload**: Upload `.swu` firmware files to SWUpdate-enabled devices\n- **Real-time Progress**: Monitor update progress through WebSocket connections\n- **JSON Output**: Machine-parseable output for automation and logging\n- **Device Restart**: Optional device restart after successful updates\n- **TLS/SSL Support**: Secure connections with certificate verification\n- **Certificate Management**: Custom CA certificates and client certificate authentication\n- **Error Handling**: Comprehensive error reporting and timeout management\n- **Verbose Logging**: Detailed output for debugging and monitoring\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/DatanoiseTV/swupdate-cli.git\ncd swupdate-cli\ngo build -o swupdate-client swupdate-client.go\n```\n\n### Binary Release\n\nDownload the pre-built static binary for your platform from the [releases page](https://github.com/DatanoiseTV/swupdate-cli/releases).\n\nEach release includes:\n- Static binaries for all platforms (no dependencies required)\n- Checksum files (SHA256, SHA512, MD5) for verification\n- Test coverage report (HTML and text format)\n\n#### Linux (x86_64/amd64)\n```bash\n# Download binary and checksums\nwget https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-linux-x86_64\nwget https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/checksums.sha256\n\n# Verify checksum\nsha256sum -c checksums.sha256 --ignore-missing\n\n# Install system-wide\nsudo install -m 755 swupdate-client-linux-x86_64 /usr/local/bin/swupdate-client\n\n# Or install for current user\nmkdir -p ~/.local/bin\ncp swupdate-client-linux-x86_64 ~/.local/bin/swupdate-client\nchmod +x ~/.local/bin/swupdate-client\n```\n\n#### Linux (ARM64)\n```bash\nwget https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-linux-arm64\nsudo install -m 755 swupdate-client-linux-arm64 /usr/local/bin/swupdate-client\n```\n\n#### Linux (ARM 32-bit)\n```bash\n# ARMv7\nwget https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-linux-armv7\n\n# ARMv6 (Raspberry Pi Zero/1)\nwget https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-linux-armv6\n\nsudo install -m 755 swupdate-client-linux-armv* /usr/local/bin/swupdate-client\n```\n\n#### macOS (Intel)\n```bash\n# Download\ncurl -LO https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-darwin-x86_64\n\n# Make executable\nchmod +x swupdate-client-darwin-x86_64\n\n# Install\nsudo mv swupdate-client-darwin-x86_64 /usr/local/bin/swupdate-client\n\n# Or using Homebrew custom tap (if available)\n# brew install datanoisetv/tap/swupdate-client\n```\n\n#### macOS (Apple Silicon M1/M2/M3)\n```bash\n# Download\ncurl -LO https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-darwin-arm64\n\n# Make executable\nchmod +x swupdate-client-darwin-arm64\n\n# Install\nsudo mv swupdate-client-darwin-arm64 /usr/local/bin/swupdate-client\n```\n\n#### Windows (64-bit)\n```powershell\n# PowerShell - Download\nInvoke-WebRequest -Uri \"https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-windows-x86_64.exe\" -OutFile \"swupdate-client.exe\"\n\n# Verify checksum (PowerShell)\nInvoke-WebRequest -Uri \"https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/checksums.sha256\" -OutFile \"checksums.sha256\"\n(Get-FileHash swupdate-client.exe -Algorithm SHA256).Hash\n\n# Add to PATH or move to a directory in PATH\n# Example: C:\\Program Files\\swupdate-client\\\nNew-Item -ItemType Directory -Force -Path \"C:\\Program Files\\swupdate-client\"\nMove-Item swupdate-client.exe \"C:\\Program Files\\swupdate-client\\\"\n# Add \"C:\\Program Files\\swupdate-client\" to system PATH\n```\n\n#### Windows (32-bit)\n```powershell\n# PowerShell\nInvoke-WebRequest -Uri \"https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-windows-386.exe\" -OutFile \"swupdate-client.exe\"\n```\n\n#### FreeBSD / OpenBSD / NetBSD\n```bash\n# Build from source is recommended for BSD systems\ngit clone https://github.com/DatanoiseTV/swupdate-cli.git\ncd swupdate-cli\ngo build -o swupdate-client swupdate-client.go\nsudo install -m 755 swupdate-client /usr/local/bin/\n```\n\n#### Docker\n```bash\n# Run directly from Docker (example)\ndocker run --rm -v $(pwd):/firmware \\\n  ghcr.io/datanoisetv/swupdate-client:latest \\\n  -ip 192.168.1.100 -file /firmware/update.swu\n```\n\n#### Embedded Linux (Yocto/Buildroot)\nFor embedded systems, download the appropriate architecture:\n- ARMv6: `swupdate-client-linux-armv6`\n- ARMv7: `swupdate-client-linux-armv7`\n- ARM64: `swupdate-client-linux-arm64`\n- x86_64: `swupdate-client-linux-x86_64`\n\n```bash\n# Example for ARMv7 embedded device\nwget -O /usr/bin/swupdate-client https://github.com/DatanoiseTV/swupdate-cli/releases/latest/download/swupdate-client-linux-armv7\nchmod +x /usr/bin/swupdate-client\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# Default: HTTP without TLS (typical for local/embedded devices)\n./swupdate-client -ip 192.168.1.100 -file firmware.swu\n```\n\n### Complete Example\n\n```bash\n./swupdate-client -ip 192.168.1.100 -port 8080 -file firmware.swu -restart -verbose\n```\n\n### JSON Output for Automation\n\n```bash\n./swupdate-client -ip 192.168.1.100 -file firmware.swu -json \u003e update.log\n```\n\n### Command Line Options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `-ip` | `192.168.1.100` | IP address of the SWUpdate device |\n| `-port` | `8080` | Port of the SWUpdate web server |\n| `-file` | (required) | Firmware file (.swu) to upload |\n| `-timeout` | `5m0s` | Timeout for operations |\n| `-verbose` | `false` | Enable verbose output |\n| `-json` | `false` | Output progress and messages in JSON format |\n| `-tls` | `false` | Use HTTPS/WSS instead of HTTP/WS (default is HTTP) |\n| `-insecure` | `false` | Skip TLS certificate verification (only with -tls) |\n| `-ca-cert` | | Path to custom CA certificate file |\n| `-client-cert` | | Path to client certificate file |\n| `-client-key` | | Path to client private key file |\n| `-restart` | `false` | Restart device after successful update |\n\n## JSON Output Format\n\nWhen using the `-json` flag, the client outputs structured JSON messages:\n\n### Log Messages\n```json\n{\n  \"type\": \"upload\",\n  \"level\": \"INFO\", \n  \"message\": \"Uploading firmware: firmware.swu (2.34 MB)\",\n  \"time\": \"2023-12-01T10:30:00Z\"\n}\n```\n\n### WebSocket Events\n```json\n{\n  \"type\": \"status\",\n  \"status\": \"START\",\n  \"level\": \"INFO\"\n}\n```\n\n### Progress Updates\n```json\n{\n  \"type\": \"step\",\n  \"name\": \"kernel\",\n  \"percent\": \"75\"\n}\n```\n\n## Development\n\n### Requirements\n\n- Go 1.19 or later\n- Dependencies managed via Go modules\n\n### Building\n\n```bash\ngo build -o swupdate-client swupdate-client.go\n```\n\n### Testing\n\n```bash\ngo test -v\n```\n\n### Dependencies\n\n- [gorilla/websocket](https://github.com/gorilla/websocket) - WebSocket client implementation\n\n## SWUpdate Server Setup\n\nThis client is designed to work with SWUpdate's built-in web server. By default, it uses HTTP for embedded devices. Ensure your SWUpdate configuration includes:\n\n```\n# Basic HTTP setup (default)\nwebserver = {\n    listen = \":8080\";\n    document_root = \"/www\";\n};\n\n# Optional: HTTPS setup (use with -tls flag)\nwebserver = {\n    listen = \":8443\";\n    document_root = \"/www\";\n    ssl = {\n        cert = \"/etc/ssl/certs/server.crt\";\n        key = \"/etc/ssl/private/server.key\";\n    };\n};\n```\n\n## Error Handling\n\nThe client handles various error conditions:\n\n- **Network timeouts**: Configurable timeout for all operations\n- **File not found**: Validates firmware file exists before upload\n- **Upload failures**: Reports HTTP status codes and error messages\n- **WebSocket disconnection**: Continues operation if WebSocket fails\n- **Device restart failures**: Reports but doesn't fail the update\n\n## Exit Codes\n\n- `0`: Success\n- `1`: Error (file not found, upload failed, etc.)\n\n## Examples\n\n### Basic Firmware Update\n```bash\n./swupdate-client -ip 10.0.0.100 -file my-firmware.swu\n```\n\n### Update with Device Restart\n```bash\n./swupdate-client -ip 10.0.0.100 -file my-firmware.swu -restart\n```\n\n### Automated Update with Logging\n```bash\n./swupdate-client -ip 10.0.0.100 -file my-firmware.swu -json | tee update-$(date +%Y%m%d).log\n```\n\n### Secure Update with TLS\n```bash\n./swupdate-client -ip 10.0.0.100 -file my-firmware.swu -tls -ca-cert ca.crt\n```\n\n### Update with Client Certificate Authentication\n```bash\n./swupdate-client -ip 10.0.0.100 -file my-firmware.swu -tls -client-cert client.crt -client-key client.key\n```\n\n### Update with Custom Timeout\n```bash\n./swupdate-client -ip 10.0.0.100 -file large-firmware.swu -timeout 10m\n```\n\n## License\n\nThis project is licensed under the BSD 3-Clause License with attribution requirement - see the [LICENSE](LICENSE) file for details.\n\n**Important**: Any product that uses this software must include the following acknowledgment visibly in its documentation and any releases:\n\"This product includes software developed by DatanoiseTV / Datanoise UG (haftungsbeschränkt).\"\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Ensure all tests pass\n6. Submit a pull request\n\n## Support\n\nFor issues and questions:\n\n1. Check the [SWUpdate documentation](https://sbabic.github.io/swupdate/)\n2. Review existing issues in this repository\n3. Create a new issue with detailed information about your problem","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatanoisetv%2Fswupdate-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatanoisetv%2Fswupdate-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatanoisetv%2Fswupdate-cli/lists"}