<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[leetcode-cli]]></title><description><![CDATA[leetcode-cli]]></description><link>https://leetcode-cli.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 01:09:18 GMT</lastBuildDate><atom:link href="https://leetcode-cli.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I Built a LeetCode CLI That Tracks Your Solve Time and Saves Solution Versions]]></title><description><![CDATA[The Problem
If you've ever grinded LeetCode, you know the pain:

Constantly switching between browser and editor

No way to track how long problems actually take you

Losing your brute-force solution after optimizing

No timer to simulate real interv...]]></description><link>https://leetcode-cli.hashnode.dev/leetcode-cli</link><guid isPermaLink="true">https://leetcode-cli.hashnode.dev/leetcode-cli</guid><category><![CDATA[TypeScript]]></category><category><![CDATA[cli]]></category><category><![CDATA[leetcode]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[datastructure]]></category><category><![CDATA[DSA]]></category><category><![CDATA[algorithms]]></category><dc:creator><![CDATA[Samanuai]]></dc:creator><pubDate>Tue, 13 Jan 2026 19:00:18 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-the-problem">The Problem</h2>
<p>If you've ever grinded LeetCode, you know the pain:</p>
<ul>
<li><p>Constantly switching between browser and editor</p>
</li>
<li><p>No way to track how long problems actually take you</p>
</li>
<li><p>Losing your brute-force solution after optimizing</p>
</li>
<li><p>No timer to simulate real interview pressure</p>
</li>
</ul>
<p>I solved all of this by building <strong>leetcode-cli</strong> — a full LeetCode workflow that runs entirely in your terminal.</p>
<p><img src="https://github.com/night-slayer18/leetcode-cli/raw/main/docs/demo.gif" alt="Demo" /></p>
<hr />
<h2 id="heading-what-it-does">What It Does</h2>
<h3 id="heading-list-and-solve-problems">📋 List and Solve Problems</h3>
<pre><code class="lang-bash">leetcode list -d medium        <span class="hljs-comment"># Filter by difficulty</span>
leetcode show 1                <span class="hljs-comment"># View problem</span>
leetcode pick 1                <span class="hljs-comment"># Generate solution file</span>
leetcode <span class="hljs-built_in">test</span> 1                <span class="hljs-comment"># Test locally</span>
leetcode submit 1              <span class="hljs-comment"># Submit to LeetCode</span>
</code></pre>
<p>Files are auto-organized by difficulty and category:</p>
<pre><code class="lang-plaintext">leetcode/
├── Easy/
│   └── Array/
│       └── 1.two-sum.java
└── Medium/
    └── String/
        └── 3.longest-substring.java
</code></pre>
<h3 id="heading-interview-timer">⏱️ Interview Timer</h3>
<p>Practice under real pressure with difficulty-based defaults:</p>
<pre><code class="lang-bash">leetcode timer 1               <span class="hljs-comment"># Easy: 20min, Medium: 40min, Hard: 60min</span>
leetcode timer 1 -m 30         <span class="hljs-comment"># Custom: 30 minutes</span>
leetcode timer --stats         <span class="hljs-comment"># See your solve time history</span>
</code></pre>
<p>The timer tracks your times so you can measure improvement over weeks.</p>
<h3 id="heading-solution-snapshots">📸 Solution Snapshots</h3>
<p>Save different approaches and compare them:</p>
<pre><code class="lang-bash">leetcode snapshot save 1 <span class="hljs-string">"brute-force"</span>
<span class="hljs-comment"># ... optimize your solution ...</span>
leetcode snapshot save 1 <span class="hljs-string">"optimized"</span>
leetcode snapshot diff 1 1 2   <span class="hljs-comment"># Compare the two</span>
leetcode snapshot restore 1 brute-force  <span class="hljs-comment"># Go back if needed</span>
</code></pre>
<p>Never lose a working solution again.</p>
<h3 id="heading-collaborative-coding">👥 Collaborative Coding</h3>
<p>Practice with a partner using room codes:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Person 1</span>
leetcode collab host 1         <span class="hljs-comment"># Creates room: ABC123</span>

<span class="hljs-comment"># Person 2</span>
leetcode collab join ABC123

<span class="hljs-comment"># Both solve, then compare</span>
leetcode collab compare
</code></pre>
<p>Great for mock interviews with friends.</p>
<h3 id="heading-workspaces">📁 Workspaces</h3>
<p>Keep different contexts separate:</p>
<pre><code class="lang-bash">leetcode workspace create interview -w ~/lc-interview
leetcode workspace create daily -w ~/lc-daily
leetcode workspace use interview
</code></pre>
<p>Each workspace has its own config, timer history, and snapshots.</p>
<h3 id="heading-git-sync">🔄 Git Sync</h3>
<p>Auto-backup solutions to GitHub:</p>
<pre><code class="lang-bash">leetcode config --repo https://github.com/you/leetcode-solutions.git
leetcode sync
</code></pre>
<hr />
<h2 id="heading-installation">Installation</h2>
<pre><code class="lang-bash">npm install -g @night-slayer18/leetcode-cli
</code></pre>
<p>Or with Docker:</p>
<pre><code class="lang-bash">docker pull nightslayer/leetcode-cli:latest
</code></pre>
<h2 id="heading-quick-start">Quick Start</h2>
<pre><code class="lang-bash">leetcode login     <span class="hljs-comment"># Paste your LeetCode cookies</span>
leetcode daily     <span class="hljs-comment"># Get today's challenge</span>
leetcode pick 1    <span class="hljs-comment"># Start solving</span>
</code></pre>
<hr />
<h2 id="heading-why-i-built-this">Why I Built This</h2>
<p>I was tired of:</p>
<ol>
<li><p>Opening Chrome just to see the problem</p>
</li>
<li><p>Not knowing if I was getting faster</p>
</li>
<li><p>Losing my first approach after refactoring</p>
</li>
</ol>
<p>Now my entire LeetCode workflow lives in the terminal, and I have data on my improvement.</p>
<hr />
<h2 id="heading-links">Links</h2>
<ul>
<li><p><strong>GitHub:</strong> <a target="_blank" href="https://github.com/night-slayer18/leetcode-cli">night-slayer18/leetcode-cli</a></p>
</li>
<li><p><strong>npm:</strong> <a target="_blank" href="https://www.npmjs.com/package/@night-slayer18/leetcode-cli">@night-slayer18/leetcode-cli</a></p>
</li>
<li><p><strong>Docs:</strong> <a target="_blank" href="http://night-slayer18.github.io/leetcode-cli">night-slayer18.github.io/leetcode-cli</a></p>
</li>
</ul>
<hr />
<p>If this helps your LeetCode grind, give it a ⭐ on GitHub!</p>
<p>What features would you want to see next? Let me know in the comments 👇</p>
]]></content:encoded></item></channel></rss>