{"__v":32,"_id":"5729461ff51d250e00e2be19","category":{"__v":0,"_id":"5723f854110e570e00486c7a","project":"5723ead0fda3c70e005b88e5","version":"5723eaebeae5090e00ee61f1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-30T00:12:04.115Z","from_sync":false,"order":2,"slug":"http-api","title":"Reference"},"parentDoc":null,"project":"5723ead0fda3c70e005b88e5","user":"5723ea8efda3c70e005b88e3","version":{"__v":3,"_id":"5723eaebeae5090e00ee61f1","project":"5723ead0fda3c70e005b88e5","createdAt":"2016-04-29T23:14:51.190Z","releaseDate":"2016-04-29T23:14:51.190Z","categories":["5723eaebeae5090e00ee61f2","5723f854110e570e00486c7a","572a28f6d10a200e00b1cb14"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.1.0","version":"0.1"},"updates":["57899cde6a16260e006e7cca"],"next":{"pages":[],"description":""},"createdAt":"2016-05-04T00:45:19.362Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The `lever` command is the official command-line interface for Lever. It can be used to manage Lever and even to invoke Lever methods.\n\n# Prerequisites\n\n* Either [Go](https://golang.org/dl/) or [Docker](https://docs.docker.com/engine/installation/).\n* Make\n* Linux or Mac (Windows should work too but it was never tested)\n\n# Installation\n\n```bash\n$ git clone https://github.com/leveros/leveros\n$ cd leveros\n$ make cli\n$ sudo make install-cli\n```\n\n# :wrench: Command: `lever`\n\n`lever [global options] subcommand [command options] [arguments...]`\n\n* :hash: Option: `--env, -E \"dev.lever\"` - The name of the environment to act on. `[$LEVEROS_ENV]`.\n* :hash: Option: `--host, -H` - The address to direct the client to, if different from env name. The CLI attempts to auto-detect the host when the env name ends with .lever, as it is assumed that a local installation is trying to be contacted. `[$LEVEROS_IP_PORT]`.\n* :hash: Option: `--help, -h` - Show help.\n* :hash: Option: `--version, -v` - Show version information.\n\nCommand line interface for Lever OS.\n\n### :arrow-right: Subcommand: `lever deploy [command options] [<dir>]`\n\n* :hash: Option: `--admin \"admin.lever\"` - The admin environment to call.\n\nWhere\n\n* `<dir>` is the directory to deploy. If not specified, it defaults to `.`, the current directory.\n\nDeploy a directory as a Lever service onto the environment specified by the global option `--env`. This command archives the directory with all of its contents and uploads it to Lever. The directory must contain a valid [lever.json](doc:lever-json) specifying the configuration for the service.\n\n### :arrow-right: Subcommand: `lever invoke [command options] <url> [jsonargs...]`\n\n* :hash: Option: `--pretty` - Pretty print the JSON reply. No effect if the reply is of type bytes.\n\nWhere\n\n* `<url>` is the Lever URL to invoke. This can be either absolute (eg `lever://<env>/<service>/[<resource>/]<method>`) or relative (eg `/<service>/[<resource>/]<method>`), in which case the environment set by `--env` is used.\n* `jsonargs...` are the JSON arguments of the method invokation. Please use proper JSON for the args; this includes the quotes for strings (eg in bash `'\"a string\"'`). If the first `jsonarg` is `--`, then args are assumed of type bytes and are read from standard input.\n\nInvoke a Lever method with provided args.\n\n### :arrow-right: Subcommand: `lever stream [command options] <url> [jsonargs...]`\n\n* :hash: Option: `--bytes` - Stdin will be interpreted as byte chunks rather than JSON.\n* :hash: Option: `--pretty` - Pretty print the JSON reply. No effect if the reply is of type bytes.\n\nWhere\n\n* `<url>` is the Lever URL of the streaming method to invoke. This can be either absolute (eg `lever://<env>/<service>/[<resource>/]<method>`) or relative (eg `/<service>/[<resource>/]<method>`), in which case the environment set by `--env` is used.\n* `jsonargs...` are the JSON arguments of the method invokation. Please use proper JSON for the args; this includes the quotes for strings (eg in bash `'\"a string\"'`).\n\nInvoke a Lever streaming method with provided args. The stream communication takes place via standard I/O. While it is possible for the stream itself to be of type bytes, this command does not allow for the args of the invokation to be of type bytes.","excerpt":"This page will introduce you to the lever CLI tool","slug":"cli","type":"basic","title":"Lever CLI"}

Lever CLI

This page will introduce you to the lever CLI tool

The `lever` command is the official command-line interface for Lever. It can be used to manage Lever and even to invoke Lever methods. # Prerequisites * Either [Go](https://golang.org/dl/) or [Docker](https://docs.docker.com/engine/installation/). * Make * Linux or Mac (Windows should work too but it was never tested) # Installation ```bash $ git clone https://github.com/leveros/leveros $ cd leveros $ make cli $ sudo make install-cli ``` # :wrench: Command: `lever` `lever [global options] subcommand [command options] [arguments...]` * :hash: Option: `--env, -E "dev.lever"` - The name of the environment to act on. `[$LEVEROS_ENV]`. * :hash: Option: `--host, -H` - The address to direct the client to, if different from env name. The CLI attempts to auto-detect the host when the env name ends with .lever, as it is assumed that a local installation is trying to be contacted. `[$LEVEROS_IP_PORT]`. * :hash: Option: `--help, -h` - Show help. * :hash: Option: `--version, -v` - Show version information. Command line interface for Lever OS. ### :arrow-right: Subcommand: `lever deploy [command options] [<dir>]` * :hash: Option: `--admin "admin.lever"` - The admin environment to call. Where * `<dir>` is the directory to deploy. If not specified, it defaults to `.`, the current directory. Deploy a directory as a Lever service onto the environment specified by the global option `--env`. This command archives the directory with all of its contents and uploads it to Lever. The directory must contain a valid [lever.json](doc:lever-json) specifying the configuration for the service. ### :arrow-right: Subcommand: `lever invoke [command options] <url> [jsonargs...]` * :hash: Option: `--pretty` - Pretty print the JSON reply. No effect if the reply is of type bytes. Where * `<url>` is the Lever URL to invoke. This can be either absolute (eg `lever://<env>/<service>/[<resource>/]<method>`) or relative (eg `/<service>/[<resource>/]<method>`), in which case the environment set by `--env` is used. * `jsonargs...` are the JSON arguments of the method invokation. Please use proper JSON for the args; this includes the quotes for strings (eg in bash `'"a string"'`). If the first `jsonarg` is `--`, then args are assumed of type bytes and are read from standard input. Invoke a Lever method with provided args. ### :arrow-right: Subcommand: `lever stream [command options] <url> [jsonargs...]` * :hash: Option: `--bytes` - Stdin will be interpreted as byte chunks rather than JSON. * :hash: Option: `--pretty` - Pretty print the JSON reply. No effect if the reply is of type bytes. Where * `<url>` is the Lever URL of the streaming method to invoke. This can be either absolute (eg `lever://<env>/<service>/[<resource>/]<method>`) or relative (eg `/<service>/[<resource>/]<method>`), in which case the environment set by `--env` is used. * `jsonargs...` are the JSON arguments of the method invokation. Please use proper JSON for the args; this includes the quotes for strings (eg in bash `'"a string"'`). Invoke a Lever streaming method with provided args. The stream communication takes place via standard I/O. While it is possible for the stream itself to be of type bytes, this command does not allow for the args of the invokation to be of type bytes.