# Mainflux CLI ## Build From the project root: ``` make cli ``` ## Usage ### Service #### Get the service verison ``` mainflux-cli version ``` ### User management #### Create User ``` mainflux-cli users create john.doe@email.com password ``` #### Login User ``` mainflux-cli users token john.doe@email.com password ``` ### System Provisioning #### Provision Device ``` mainflux-cli things create '{"type":"device", "name":"nyDevice"}' ``` #### Provision Application ``` mainflux-cli things create '{"type":"app", "name":"nyDevice"}' ``` #### Retrieve All Things ``` mainflux-cli things get all --offset=1 --limit=5 ``` #### Retrieve Thing By ID ``` mainflux-cli things get --offset=1 --limit=5 ``` #### Remove Thing ``` mainflux-cli things delete ``` #### Provision Channel ``` mainflux-cli channels create '{"name":"nyChannel"}' ``` #### Retrieve All Channels ``` mainflux-cli channels get all --offset=1 --limit=5 ``` #### Retrievie Channel By ID ``` mainflux-cli channels get --offset=1 --limit=5 ``` #### Remove Channel ``` mainflux-cli channels delete ``` ### Access control #### Connect Thing to a Channel ``` mainflux-cli things connect ``` #### Disconnect Things from a Channel ``` mainflux-cli things disconnect ``` ### Messaging #### Send a message over HTTP ``` mainflux-cli msg send '[{"bn":"some-base-name:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]' ```