# leetcode-runner-cli Executes leetcode testcases and submits your solution through CLI interface ![Crates.io](https://img.shields.io/crates/v/leetcode-runner-cli) [![GitHub license](https://img.shields.io/github/license/dvishal485/leetcode-runner-cli)](/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/dvishal485/leetcode-runner-cli)](https://github.com/dvishal485/leetcode-runner-cli/issues) ![Leetcode Runner CLI Banner](cli-banner.png) **Disclaimer :** This is not an official Leetcode tool. I am not affiliated with Leetcode in any way. This tool is not endorsed by leetcode. --- ## Installation ### Using Cargo 1. If you have [Cargo installed](https://doc.rust-lang.org/cargo/getting-started/installation.html) on your system then you can install the tool using the following command. ```bash cargo install leetcode-runner-cli ``` ### Using pre-built binaries 1. Go to the [Releases section](https://github.com/dvishal485/leetcode-runner-cli/releases) and download the appropriate binary for your system. 2. Place the binary in appropriate location and add the location in your PATH environment variable. ### Building from source 1. Install [rust from here](https://www.rust-lang.org/tools/install) to compile the source code. 1. Clone the repository and move to the repository directory. ```bash git clone https://github.com/dvishal485/leetcode-runner-cli.git cd leetcode-runner-cli ``` 1. Compile and install the binary. ```bash cargo install --path . ``` #### Platform Specific Instructions Depending on your platform you may need to install certain tools to be able to compile successfully. - On Ubuntu system, you may need to execute `apt-get install pkg-config openssl-dev -y` to be able to compile the program successfully. - Windows user are good to go. --- ## Usage 1. Setup environment variable `LC_COOKIE` with your leetcode session cookie. You may search on internet to know how to setup an environment variable on your system. You can get your session cookie by logging in to leetcode and inspecting the cookie from Request headers in your browser's developer tools. Make sure to put your cookie in double quotes. ```bash export LC_COOKIE="csrftoken=abcdefgh;LEETCODE_SESSION=ijklmnopqrstuvwxyz;" ``` 2. Execute the tool and verify your authentication. ```bash leetcode-runner-cli -a ``` --- ### Commands ```bash leetcode-runner-cli [COMMAND] [OPTIONS