# Mainflux CLI ## Build From the project root: ``` make cli ``` ## Usage ### Service #### Get the version of Mainflux services ``` mainflux-cli version ``` ### Users management #### Create User ``` mainflux-cli users create john.doe@email.com password ``` #### Login User ``` mainflux-cli users token john.doe@email.com password ``` #### Retrieve User ``` mainflux-cli users get ``` #### Update User ``` mainflux-cli users update '{"metadata":{"field1":"value1"}}' ``` #### Update User Password ``` mainflux-cli users password ``` ### System Provisioning #### Create Thing (type Device) ``` mainflux-cli things create '{"name":"myDevice"}' ``` #### Create Thing (type Application) ``` mainflux-cli things create '{"name":"myDevice"}' ``` #### Update Thing ``` mainflux-cli things update '{"id":"", "name":"myNewName"}' ``` #### Remove Thing ``` mainflux-cli things delete ``` #### Retrieve a subset list of provisioned Things ``` mainflux-cli things get all --offset=1 --limit=5 ``` #### Retrieve Thing By ID ``` mainflux-cli things get ``` #### Create Channel ``` mainflux-cli channels create '{"name":"myChannel"}' ``` #### Update Channel ``` mainflux-cli channels update '{"id":"","name":"myNewName"}' ``` #### Remove Channel ``` mainflux-cli channels delete ``` #### Retrieve a subset list of provisioned Channels ``` mainflux-cli channels get all --offset=1 --limit=5 ``` #### Retrieve Channel By ID ``` mainflux-cli channels get ``` ### Access control #### Connect Thing to Channel ``` mainflux-cli things connect ``` #### Disconnect Thing from Channel ``` mainflux-cli things disconnect ``` #### Retrieve a subset list of Channels connected to Thing ``` mainflux-cli things connections ``` #### Retrieve a subset list of Things connected to Channel ``` mainflux-cli channels connections ``` ### Messaging #### Send a message over HTTP ``` mainflux-cli messages send '[{"bn":"Dev1","n":"temp","v":20}, {"n":"hum","v":40}, {"bn":"Dev2", "n":"temp","v":20}, {"n":"hum","v":40}]' ```