The CLI

The Mariachi CLI is a simple command-line utility that will let you start working with Mariachi devices in minutes. It is open sourced, so feel free to contribute.

CLI Documentation

The Mariachi CLI is a Python command-line utility that allows you to discover and perform various operations on remote Mariachi devices specified by a base URL. You can use it to send POST requests, start an HTTP server to scan POST requests, upload files to the server, and download files from the server. The utility provides options to control the behavior of these operations.

Options

OptionDescription
--base-url=URLSpecifies the base URL for making HTTP requests. The default base URL is "http://192.168.2.2".
--flashMakes a POST request to the "/flash" endpoint of the specified base URL.
--rebootMakes a POST request to the "/reboot" endpoint of the specified base URL.
--assign-ip=IPMakes a POST request to the "/assign_ip" endpoint of the specified base URL with the provided IP address.
--scanStarts an HTTP server on localhost to scan and display incoming POST requests. The server runs for 5 seconds and logs incoming requests. Use the "--format" option to specify the output format.
--upload=PATHUploads a file or folder specified by the PATH to the base URL. The contents are archived into a tarball before uploading.
--download=FILEDownloads a file specified by FILE from the base URL. The downloaded file is saved in a "downloads" directory and can be optionally extracted.
--format=FORMATSpecifies the output format for responses and scanned requests. Valid values are "text" (default) and "json". Responses and scanned requests are displayed in the specified format.

Examples

            python3 cli.py --base-url="http://192.168.2.201" --flash
        
            python3 cli.py --base-url="http://192.168.2.201" --reboot
        
            python3 cli.py --base-url="http://192.168.2.201" --assign-ip=192.168.2.100
        
            python3 cli.py --scan --format=json
        
            python3 cli.py --base-url="http://192.168.2.201" --upload=/path/to/folder
        
            python3 cli.py --base-url="http://192.168.2.201" --download=example.tar.gz
        

Author

Written by Mariachi

Reporting Bugs

Please report bugs to info@mariachipower.com

Copyright

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.