{"_id":"59d5649bdecc8e0010f6f977","project":"568bdc1483d2061900d86cdc","version":{"_id":"59a72290d61777001b6c42c3","project":"568bdc1483d2061900d86cdc","__v":19,"createdAt":"2017-08-30T20:39:44.453Z","releaseDate":"2017-08-30T20:39:44.453Z","categories":["59a7236e3fe4d90025117c10","59a72eb6cb0db3001b84cfe2","59a734eb757d030019b85af8","59c0243b1b2d07001a9d2b76","59c035e42126e10028effb12","59c06c40df5b3c0010584a13","59c1a5852cabe5002641a3e7","59c2fb00b2b45c0010b7a3d7","59c32ceb9aea850010ac4130","59c32e6e190c90003cb0d12f","59c33affb2b45c0010b7aa23","59c7dfa457bd8200105444dc","59c7e975c50cf30010d712a0","59cffdef0cd4dd0010294d54","59d0622ca91a810032c8f60c","59d06733c1aec60026253065","59d174d44ac471001a07b123","59d5a5e323e6e800103defb2","59ecf1d8ed507c001c52b255"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.0","version":"0"},"category":{"_id":"59d174d44ac471001a07b123","project":"568bdc1483d2061900d86cdc","version":"59a72290d61777001b6c42c3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-10-01T23:05:56.293Z","from_sync":false,"order":5,"slug":"real-time-monitoring","title":"Real Time Monitoring"},"user":"58cc41f21751ce2f003be3b7","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-04T22:45:47.848Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Overview\n\nThe Droplit Trace CLI is a cross platform command line tool that allows users to trace droplit.io events in real time. It is built on the Droplit WebSocket SDK.\n\nThe overall functionality of the Trace CLI is the same as the Droplit command line console, except that the Trace CLI tracks events in real time, and the normal Droplit CLI does not.\n\n![droplit-trace-console](https://app.box.com/shared/static/osrbwk8ulxccqankvxbrl4bhkyx41nkb.png)\n\n# Installation\n---\n\nInstall the Droplit Trace CLI using the same setup instructions as those listed for the Droplit command line console, depending on the type of operating system (Windows, Mac OS, or Linux/Embedded). The name of the Trace CLI package is slightly different than the package name for the normal Droplit CLI, so use the following command when installing the Trace CLI from NPM.\n\n```\nnpm install droplit-trace-cli -g\n```\n\n# Logging In\n\nUsers can log into the Droplit Trace CLI using their developer account credentials from the [Droplit portal](https://portal.droplit.io). This involves a similar command to the one which logs into into the normal Droplit CLI. If the user has already authenticated into the normal Droplit CLI, it is not necessary to authenticate a second time.\n\n```\ndroplit-trace account authenticate\n```\n\nThe Trace CLI, by default, does not run in interactive mode. To enable interactive mode after authentication, use the following command.\n\n```\ndroplit-trace connect\n```\n\n![trace-interactive](https://app.box.com/shared/static/g96ryimv5yuu6e2ad53x15uefvo79d6c.png)\n\n# Top-Level Commands\n\nSimilar to the normal Droplit CLI, run `droplit-trace` on the command line to see a list of top-level commands.\n\n![top-level-commands](https://app.box.com/shared/static/0mg9kw2xjw6gq1qzm04p4cnesopb3n7y.png)\n\n# Subscribing to Resources\n\nDirectly subscribe to resources for monitoring using the following command. Resources are usually devices and other containers.\n\n```\ndroplit-trace subscribe <resourceType> <resourceId>\n```\n\n![resource-subscribe](https://app.box.com/shared/static/ubjkht8imucf8j1xr3avqh8dnqu1ikcn.png)\n\nThe web socket connection must be open to subscribe to resources. Interactive mode, if enabled, has more options available.\n\n![trace-interactive-options](https://app.box.com/shared/static/oezbfzwhg6dmlg3c8hyjfm3gdfrt0rfe.png)\n\n# Exiting Interactive Mode\n\nExit the interactive CLI, if running, by pressing `esc` and typing `close`.\n\n![trace-interactive-exit](https://app.box.com/shared/static/u6v5urtlxdcs4qomwrev8vstez11cifi.png)","excerpt":"","slug":"trace-command-line-console","type":"basic","title":"Trace Command Line Console"}

Trace Command Line Console


# Overview The Droplit Trace CLI is a cross platform command line tool that allows users to trace droplit.io events in real time. It is built on the Droplit WebSocket SDK. The overall functionality of the Trace CLI is the same as the Droplit command line console, except that the Trace CLI tracks events in real time, and the normal Droplit CLI does not. ![droplit-trace-console](https://app.box.com/shared/static/osrbwk8ulxccqankvxbrl4bhkyx41nkb.png) # Installation --- Install the Droplit Trace CLI using the same setup instructions as those listed for the Droplit command line console, depending on the type of operating system (Windows, Mac OS, or Linux/Embedded). The name of the Trace CLI package is slightly different than the package name for the normal Droplit CLI, so use the following command when installing the Trace CLI from NPM. ``` npm install droplit-trace-cli -g ``` # Logging In Users can log into the Droplit Trace CLI using their developer account credentials from the [Droplit portal](https://portal.droplit.io). This involves a similar command to the one which logs into into the normal Droplit CLI. If the user has already authenticated into the normal Droplit CLI, it is not necessary to authenticate a second time. ``` droplit-trace account authenticate ``` The Trace CLI, by default, does not run in interactive mode. To enable interactive mode after authentication, use the following command. ``` droplit-trace connect ``` ![trace-interactive](https://app.box.com/shared/static/g96ryimv5yuu6e2ad53x15uefvo79d6c.png) # Top-Level Commands Similar to the normal Droplit CLI, run `droplit-trace` on the command line to see a list of top-level commands. ![top-level-commands](https://app.box.com/shared/static/0mg9kw2xjw6gq1qzm04p4cnesopb3n7y.png) # Subscribing to Resources Directly subscribe to resources for monitoring using the following command. Resources are usually devices and other containers. ``` droplit-trace subscribe <resourceType> <resourceId> ``` ![resource-subscribe](https://app.box.com/shared/static/ubjkht8imucf8j1xr3avqh8dnqu1ikcn.png) The web socket connection must be open to subscribe to resources. Interactive mode, if enabled, has more options available. ![trace-interactive-options](https://app.box.com/shared/static/oezbfzwhg6dmlg3c8hyjfm3gdfrt0rfe.png) # Exiting Interactive Mode Exit the interactive CLI, if running, by pressing `esc` and typing `close`. ![trace-interactive-exit](https://app.box.com/shared/static/u6v5urtlxdcs4qomwrev8vstez11cifi.png)