Coreflux CLI Tool Documentation
The Coreflux CLI Tool (coreflux-cli
) is a command-line interface for securely managing configurations on the Coreflux MQTT Broker. With this CLI, administrators can modify broker settings, manage users, update passwords, list, alter, add, and remove models, and display user details, ensuring efficient and secure broker management.
Overview
Purpose
The Coreflux CLI Tool simplifies administrative tasks for Coreflux MQTT Broker management, allowing for quick, command-based modifications and configuration reviews.
Main Features
- Broker Configuration: Modify MQTT Broker settings such as ports, IP bindings, and TLS configurations.
- User Management: Add, remove and update user accounts and passwords.
- Model Management: Add, alter, remove and list models for LOT integration in the broker.
- Secure Access: All commands require root password verification for added security.
Installation
The coreflux-cli tool is distributed as an executable file and supports multiple platforms:
- Windows [Link]
- Linux [Link]
- Linux ARM [Link]
Requirements
- Root Authentication: Commands require root password authentication for security
- MQTT Broker Access: Ensure the specified directory path to the MQTT Broker is accessible for the CLI to manage user data
Usage Overview
The CLI tool supports the following commands:
-
User Management:
add user
: Adds a new user to the configurationremove
: Removes an existing user from the configurationchangepass
: Changes the password of an existing usershowusers
: Displays all users and their passwords in the configuration file
-
Broker Configuration:
configureBroker
: Modify broker settings such as ports, IP bindings, and TLS configurations.
-
Model Management:
manageModels
: Manage LOT models by adding, altering, removing or listing them.
Each command follows the general syntax:
Note: For each command, specify the
--path
option if the Coreflux MQTT Broker directory path is different from the default path.
Commands
Broker Configuration
Modifies the configuration of the Coreflux MQTT Broker, including ports, IP bindings, and TLS certificate details.
Syntax:
Options:-
-n|
or--name
: Specify the new name for the broker- Example:
coreflux-cli configureBroker -n MQTTBrokerNew
- Example:
-
-p
or--port
: Set the MQTT Communication port- Example:
coreflux-cli configureBroker -p 8883
- Example:
-
-w
or--websocketPort
: Set the Websocket Communication port- Example:
coreflux-cli configureBroker --websocketPort 1421
- Example:
-
-d
or--debug
: Enable or disable detailed debugging logs- Example:
coreflux-cli configureBroker -d true
- Example:
-
-a
or--allowAnonymous
: Allow or disallow anonymous login- Example:
coreflux-cli configureBroker -a false
- Example:
-
-ip
or--bindIpAddress
: Set the IP address for MQTT communication binding- Example:
coreflux-cli configureBroker --bindIpAddress 0.0.0.0
- Example:
-
-c
or--certPath
: Path to the TLS certificate- Example:
coreflux-cli configureBroker --certPath "/path/to/certificate.pem"
- Example:
-
-cp
or--certPassword
: Password for the TLS certificate.- Example:
coreflux-cli -cp MySecurePassword
- Example:
-
-P
or--path
: Path to the Coreflux MQTT Broker directory- Example:
coreflux-cli --path "C:\Users\YourUser\AppData\Roaming\corefluxhub\YourBroker\Coreflux\bin"
- Example:
User Management
Add User
Creates a new user on the Coreflux MQTT Broker.
Syntax:
Options:
-u
or--username
: Specify the new username-p
or--password
: Set a password for the new user- Example:
coreflux-cli adduser -u newUser -p newPass
- Example:
-path
or--path
: Optional. Specify an alternate path to the Coreflux MQTT Broker directory- Example:
coreflux-cli adduser -u newUser -p newPass -path C:\Users\YourUser\AppData\Roaming\corefluxhub\YourBroker\Coreflux\bin
- Example:
Remove User
Deletes a user from the configuration.
Syntax:
Options:
-u
or--username
: Username of the user to delete- Example:
coreflux-cli remove newUser
- Example:
-path
or--path
: Optional. Path to the Coreflux MQTT Broker directory- Example:
coreflux-cli remove newUser -path C:\Users\YourUser\AppData\Roaming\corefluxhub\YourBroker\Coreflux\bin
- Example:
Change Password
Updates the password of an existing user.
Syntax:
Options:
-u
or--username
: Specify the username-p
or--password
: Set a new password for the user- Example:
coreflux-cli changepass -u newUser -p anotherNewPass
- Example:
-path
or--path
: Optional. Specify a path to the broker directory- Example:
coreflux-cli changepass -u newUser -p anotherNewPass -path C:\Users\YourUser\AppData\Roaming\corefluxhub\YourBroker\Coreflux\bin
- Example:
Show Users
Lists all users and their passwords stored in the configuration.
Syntax:
Options:
-path
or--path
: Optional. Path to the Coreflux MQTT Broker directory- Example:
coreflux-cli showusers -path C:\Users\YourUser\AppData\Roaming\corefluxhub\YourBroker\Coreflux\bin
- Example:
Model Management
Add Model
Adds a new LOT model to the configuration.
Syntax:
Options:
-c
or--config
: Configuration string for the model.-p
or--path
: Optional. Path to the Coreflux directory.- Example:
coreflux-cli manageModels addModel -c "DEFINE MODEL newModel WITH TOPIC "Coreflux/Topic"
- Example:
Alter Model
Updates an existing model's configuration.
Syntax:
Options:
-n
or--name
: Name of the model to update.-c
or--config
: New configuration for the model.-p
or--path
: Optional. Path to the Coreflux directory.- Example:
coreflux-cli manageModels alterModel -n <ExistentModel> -c <NewModelConfiguration>
- Example:
Remove Model
Deletes a LOT model from the configuration.
Syntax:
Options:-n
or--name
: Name of the model to delete.-p
or--path
: Optional. Path to the Coreflux directory.
List Models
Displays all defined LOT models.
Syntax:
Options:-p
or--path
: Optional. Path to the Coreflux directory.
Additional Details
Root Password Verification
Each command requires root password verification. On command execution, you'll be prompted to enter the root password, which is validated against the root user in the configuration file.
Hidden Password Input
For security, the password prompt for root access hides input characters, showing an asterisk for each character typed.
Model Handling
If a model with incorrect or incomplete syntax is added (e.g., missing double quotes for topics, invalid keywords, or unrecognized configurations), it will still be saved to the configuration file, however, the model will not be recognized or executed by Coreflux Broker. Always verify the syntax of your models before adding or altering them using the LOT documentation.