{"_id":"582789abbe5c080f00a5a827","project":"568bdc1483d2061900d86cdc","category":{"_id":"582789abbe5c080f00a5a7ff","version":"582789aabe5c080f00a5a7fe","project":"568bdc1483d2061900d86cdc","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-05T15:07:02.028Z","from_sync":false,"order":0,"slug":"documentation","title":"Getting Started"},"__v":0,"parentDoc":null,"user":"568bdbc4fe6fcc0d006dc970","version":{"_id":"582789aabe5c080f00a5a7fe","__v":10,"project":"568bdc1483d2061900d86cdc","createdAt":"2016-11-12T21:29:14.915Z","releaseDate":"2016-11-12T21:29:14.915Z","categories":["582789abbe5c080f00a5a7ff","582789abbe5c080f00a5a800","582789abbe5c080f00a5a801","582789abbe5c080f00a5a802","582789abbe5c080f00a5a803","582789abbe5c080f00a5a804","582789abbe5c080f00a5a805","582789abbe5c080f00a5a806","582789abbe5c080f00a5a807","582789abbe5c080f00a5a808","5827ea984ca29e0f00137a9e","583df597887db62f00644283","583df5d9c622791900e78da5","5845cd8763c11b250037967d","5845d13063c11b2500379681","5859e859e3306d1900126725","587aeb9a01cf3a0f008359eb","587c422af45e2d0f005e200d","587d84dc82f6f30f004ceee5"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta2","version_clean":"0.0.0","version":"0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-21T06:23:03.356Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"![box](https://app.box.com/shared/static/cbkt8zzc0ktla8j3244blcew1pasz4l7.png)\n\n# Installation\n---\n\nFor information on installing the droplit CLI, see: [Install the Command Line Tools](doc:install-command-line-tools) \n\n```\nnpm install droplit-cli -g\n```\n\n# Introduction\n---\n\nThe dropit.io CLI has been designed to be mostly self-documenting. If you run a command it will output any nested commands, command parameters, descriptions and options. For example:\n\n![box](https://app.box.com/shared/static/51zfq0gxnh33z7cdrbho2s99tfzf4r8n.png)\n\nTo see a full list of top-level commands, simply run `droplit` on the command line.\n\n![box](https://app.box.com/shared/static/2kl1v4f9gqdfi638v3eh3j1c4yjn67uv.png)\n\n# Setup\n---\n\nBefore using the CLI, you must login with your droplit.io Developer Account credentials (from [droplit.io portal](https://portal.droplit.io)) by running:\n\n```\ndroplit account authenticate\n```\n\n![box](https://app.box.com/shared/static/tmjyyz850s78q5m3tisj467z9n8gz0xf.png)\n\n## Developer mode\n\nYou can enable developer commands and advanced features\n\n```\ndroplit settings develop true\n```\n\n![box](https://app.box.com/shared/static/bcxsk30fkii1fbwcgrc4h2m91l3b6v31.png)\n\nRunning `droplit` now shows more commands.\n\n![box](https://app.box.com/shared/static/7nistscfxw1p6z1806m95tvskktxrfzo.png)\n\n## Debug mode\n\nDebug mode is a feature that enables diagnostic output when running commands. This lets you see all contents of HTTP requests and responses made to and from the droplit.io API. For example:\n\n![box](https://app.box.com/shared/static/mmed18v01mva96c6ta3jhylyij2e8pn1.png)\n\nYou can enable Debug mode by running:\n\n```\ndroplit settings debug true\n```\n\n![box](https://app.box.com/shared/static/x59alkgpvik3ffzzzy4fltc2xnu7vm2a.png)\n\n# Using the CLI\n---\n\n## Selection\n\nThe droplit.io CLI stores the selected item to browse sub-items in subsequent requests. For example, after you select an ecosystem, you can list environments contained in the ecosystem.\n\n```\ndroplit ecosystem select <ecosystemId>\n```\n\n![box](https://app.box.com/shared/static/yyvhcnq5c3g5rdtztdqz67x6mxjabopp.png)\n\n```\ndroplit environment list\n```\n\n![box](https://app.box.com/shared/static/2z1fotf5fj5vo9kryxau7532o3nu0a2v.png)\n\nHowever, if you need to list environments and do not wish to switch your selection context, you can pass in `ecosystemId` as a flag. Other commands support specifying `ecosystemId` and/or `environmentID` as a flag also.\n\n```\ndroplit list environment <environmentID> --ecosystemID <ecosystemID>\n```\n\n## Alias\n\nSometimes typing full Id’s out can be tedious. We provide a simple system for aliasing different droplit.io resources for your convenience. For more information about Aliases, see this article: [Aliases](doc:aliases)\n\nThis example shows how to Alias a device.\n\n```\ndroplit device alias <deviceId> <alias>\n``` \n\n![box](https://app.box.com/shared/static/w1kbh3c4uy53p3x4eqwrw1agjmxegwd9.png)\n\nThe `alias` can now be used in place of the `deviceId` (not only in the CLI, but anywhere in the droplit.io API). For example:\n\n![box](https://app.box.com/shared/static/03h1jgcdhqv6lxazqh5k8nzv9wdv4vwa.png)\n\n# Common commands\n---\n\n## List ecosystems\n\n```\ndroplit ecosystem list\n```\n\n![box](https://app.box.com/shared/static/71t8tvpd80jqe3i536cwo92gfjg2ljem.png)\n\n## Select ecosystem\n\n```\ndroplit ecosystem select <ecosystemId>\n```\n\n![box](https://app.box.com/shared/static/yyvhcnq5c3g5rdtztdqz67x6mxjabopp.png)\n\n## List environments\n\n```\ndroplit environment list\n```\n\n![box](https://app.box.com/shared/static/2z1fotf5fj5vo9kryxau7532o3nu0a2v.png)\n\n## Select environment\n\n```\ndroplit environment select <environmentId>\n```\n\n![box](https://app.box.com/shared/static/gt4mn9yeaq185mzy8nd5kyphbn91ncw1.png)\n\n## List devices\n\n```\ndroplit device list\n```\n\n![box](https://app.box.com/shared/static/4whfvf64s81jgs6s61tac6zosm5e5d45.png)\n\n## Setting a device service property\n\n```\ndroplit device set <deviceId> <serviceProperty> [value]\n```\n\nThe `serviceProperty` uses the service selector syntax. More about that here: [Service Selectors](doc:service-selectors)\n\n![box](https://app.box.com/shared/static/gszjablgkuklg357bm5trqyrz3a03za3.png)\n\n## Getting the state of a device\n\n```\ndroplit device get <deviceId> <serviceProperty> [--refresh]\n```\n\nThe `refresh` flag make the request blocking and forces the droplit.io cloud to query the device state. \n\n![box](https://app.box.com/shared/static/lvjj57hxyhf0erl3wkxu6n4c23sdz6zu.png)","excerpt":"Ultimate IoT power, at your finger tips.","slug":"command-line-tools","type":"basic","title":"Command Line Tools"}

Command Line Tools

Ultimate IoT power, at your finger tips.

![box](https://app.box.com/shared/static/cbkt8zzc0ktla8j3244blcew1pasz4l7.png) # Installation --- For information on installing the droplit CLI, see: [Install the Command Line Tools](doc:install-command-line-tools) ``` npm install droplit-cli -g ``` # Introduction --- The dropit.io CLI has been designed to be mostly self-documenting. If you run a command it will output any nested commands, command parameters, descriptions and options. For example: ![box](https://app.box.com/shared/static/51zfq0gxnh33z7cdrbho2s99tfzf4r8n.png) To see a full list of top-level commands, simply run `droplit` on the command line. ![box](https://app.box.com/shared/static/2kl1v4f9gqdfi638v3eh3j1c4yjn67uv.png) # Setup --- Before using the CLI, you must login with your droplit.io Developer Account credentials (from [droplit.io portal](https://portal.droplit.io)) by running: ``` droplit account authenticate ``` ![box](https://app.box.com/shared/static/tmjyyz850s78q5m3tisj467z9n8gz0xf.png) ## Developer mode You can enable developer commands and advanced features ``` droplit settings develop true ``` ![box](https://app.box.com/shared/static/bcxsk30fkii1fbwcgrc4h2m91l3b6v31.png) Running `droplit` now shows more commands. ![box](https://app.box.com/shared/static/7nistscfxw1p6z1806m95tvskktxrfzo.png) ## Debug mode Debug mode is a feature that enables diagnostic output when running commands. This lets you see all contents of HTTP requests and responses made to and from the droplit.io API. For example: ![box](https://app.box.com/shared/static/mmed18v01mva96c6ta3jhylyij2e8pn1.png) You can enable Debug mode by running: ``` droplit settings debug true ``` ![box](https://app.box.com/shared/static/x59alkgpvik3ffzzzy4fltc2xnu7vm2a.png) # Using the CLI --- ## Selection The droplit.io CLI stores the selected item to browse sub-items in subsequent requests. For example, after you select an ecosystem, you can list environments contained in the ecosystem. ``` droplit ecosystem select <ecosystemId> ``` ![box](https://app.box.com/shared/static/yyvhcnq5c3g5rdtztdqz67x6mxjabopp.png) ``` droplit environment list ``` ![box](https://app.box.com/shared/static/2z1fotf5fj5vo9kryxau7532o3nu0a2v.png) However, if you need to list environments and do not wish to switch your selection context, you can pass in `ecosystemId` as a flag. Other commands support specifying `ecosystemId` and/or `environmentID` as a flag also. ``` droplit list environment <environmentID> --ecosystemID <ecosystemID> ``` ## Alias Sometimes typing full Id’s out can be tedious. We provide a simple system for aliasing different droplit.io resources for your convenience. For more information about Aliases, see this article: [Aliases](doc:aliases) This example shows how to Alias a device. ``` droplit device alias <deviceId> <alias> ``` ![box](https://app.box.com/shared/static/w1kbh3c4uy53p3x4eqwrw1agjmxegwd9.png) The `alias` can now be used in place of the `deviceId` (not only in the CLI, but anywhere in the droplit.io API). For example: ![box](https://app.box.com/shared/static/03h1jgcdhqv6lxazqh5k8nzv9wdv4vwa.png) # Common commands --- ## List ecosystems ``` droplit ecosystem list ``` ![box](https://app.box.com/shared/static/71t8tvpd80jqe3i536cwo92gfjg2ljem.png) ## Select ecosystem ``` droplit ecosystem select <ecosystemId> ``` ![box](https://app.box.com/shared/static/yyvhcnq5c3g5rdtztdqz67x6mxjabopp.png) ## List environments ``` droplit environment list ``` ![box](https://app.box.com/shared/static/2z1fotf5fj5vo9kryxau7532o3nu0a2v.png) ## Select environment ``` droplit environment select <environmentId> ``` ![box](https://app.box.com/shared/static/gt4mn9yeaq185mzy8nd5kyphbn91ncw1.png) ## List devices ``` droplit device list ``` ![box](https://app.box.com/shared/static/4whfvf64s81jgs6s61tac6zosm5e5d45.png) ## Setting a device service property ``` droplit device set <deviceId> <serviceProperty> [value] ``` The `serviceProperty` uses the service selector syntax. More about that here: [Service Selectors](doc:service-selectors) ![box](https://app.box.com/shared/static/gszjablgkuklg357bm5trqyrz3a03za3.png) ## Getting the state of a device ``` droplit device get <deviceId> <serviceProperty> [--refresh] ``` The `refresh` flag make the request blocking and forces the droplit.io cloud to query the device state. ![box](https://app.box.com/shared/static/lvjj57hxyhf0erl3wkxu6n4c23sdz6zu.png)