<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cznorth</title>
    <description>The latest articles on DEV Community by Cznorth (@winkterm_dev).</description>
    <link>https://dev.to/winkterm_dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3972195%2Facc993e9-2452-48c6-a420-36ee19609631.jpg</url>
      <title>DEV Community: Cznorth</title>
      <link>https://dev.to/winkterm_dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/winkterm_dev"/>
    <language>en</language>
    <item>
      <title>WinkTerm: AI That Shares Your Terminal Session, Not Just Suggests Commands</title>
      <dc:creator>Cznorth</dc:creator>
      <pubDate>Sun, 07 Jun 2026 07:50:13 +0000</pubDate>
      <link>https://dev.to/winkterm_dev/winkterm-ai-that-shares-your-terminal-session-not-just-suggests-commands-2kog</link>
      <guid>https://dev.to/winkterm_dev/winkterm-ai-that-shares-your-terminal-session-not-just-suggests-commands-2kog</guid>
      <description>&lt;p&gt;I have a problem with "AI in the terminal" tools.&lt;/p&gt;

&lt;p&gt;They're almost all the same: a chat sidebar. You ask a question, the AI replies with "try this command", and you copy-paste. The AI never actually sees what your shell sees — it has no idea whether you're root, whether that command succeeded, what &lt;code&gt;$PWD&lt;/code&gt; is, or what the error two lines up was. It's a knowledgeable friend you have to dictate everything to over the phone.&lt;/p&gt;

&lt;p&gt;I wanted a friend who could just reach across and type.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://github.com/Cznorth/winkterm" rel="noopener noreferrer"&gt;WinkTerm&lt;/a&gt;&lt;/strong&gt; — an MIT-licensed AI terminal where &lt;strong&gt;the AI and I share the same PTY&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it actually feels
&lt;/h2&gt;

&lt;p&gt;You're at your shell prompt. You type &lt;code&gt;# what's wrong with this VPN config&lt;/code&gt;. The AI answers in the same terminal, then pre-fills its suggested fix into your input line. You press Enter to run it. Backspace to edit. Ctrl+C to throw it out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ipconfig
&lt;span class="go"&gt;Command 'ipconfig' not found, did you mean: ...
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c"&gt;# what's wrong&lt;/span&gt;
&lt;span class="go"&gt;[WinkTerm] `ipconfig` is a Windows command — on Linux use `ip addr`.
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ip addr█   ← AI wrote this. Press Enter to run.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI sees what you see because it &lt;em&gt;is&lt;/em&gt; in the same session. When it runs a command, the output is real shell output, with real exit codes, in your real &lt;code&gt;cwd&lt;/code&gt;. When you run a command, the AI remembers it as context for the next turn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Sidebar chatbots are great until reality hits — env vars you set last command, a multi-step debugging session, a partially-applied migration. The chatbot has no idea any of that happened. The shared-PTY model means the AI inherits the same context drift your hands do.&lt;/p&gt;

&lt;p&gt;It also keeps you in control. The AI never &lt;em&gt;runs&lt;/em&gt; a command without you pressing Enter (by default). Pre-fill, not auto-execute. You stay the operator.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the box
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shared PTY chat&lt;/strong&gt; — &lt;code&gt;# message&lt;/code&gt; triggers AI inline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sidebar AI panel&lt;/strong&gt; — when you do want a longer conversation, with multi-tab chats and AI-generated titles&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-model&lt;/strong&gt; — Anthropic / OpenAI / Ollama / any OpenAI-compatible endpoint&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH&lt;/strong&gt; — built-in remote connections with file transfer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistent history&lt;/strong&gt; — chat survives reconnects and backend restarts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming resume&lt;/strong&gt; — refresh mid-response without losing tokens&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Agent API&lt;/strong&gt; — Claude Code / Cursor can drive terminals + SSH remotely&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploy any way you want&lt;/strong&gt; — Docker, Win/macOS desktop app, or an Android thin client&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Python, FastAPI, LangGraph for the agent state machine, native PTY (&lt;code&gt;pty&lt;/code&gt;/&lt;code&gt;winpty&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Next.js 14 (App Router) + xterm.js&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol&lt;/strong&gt;: WebSocket for the terminal stream; &lt;code&gt;#&lt;/code&gt; lines are intercepted before they hit the shell and routed to the agent&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Data flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User keyboard input
    │
    ▼
Frontend Terminal (xterm.js)
    │  WebSocket
    ▼
ws_handler.py
    │
    ├── normal input ──► pty_manager.write() ──► shell process
    │
    └── # lines ──► intercept ──► Agent (LangGraph) ──► pty output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agent output is written back as PTY output — it shows up in the same scrollback as everything else. The "AI" is just another writer to the same fd.&lt;/p&gt;

&lt;h2&gt;
  
  
  Status
&lt;/h2&gt;

&lt;p&gt;MIT, ~3.5 months old, runs on my own infra daily. I'd love feedback — especially from people who've also been frustrated by sidebar-style AI terminals.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/Cznorth/winkterm" rel="noopener noreferrer"&gt;https://github.com/Cznorth/winkterm&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>opensource</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
