# linechat **Repository Path**: iiangs/linechat ## Basic Information - **Project Name**: linechat - **Description**: Chat between code lines. Zero UI. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-04-22 - **Last Updated**: 2026-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LineChat Chat between code lines. Zero UI. A VS Code extension that lets you send and receive messages **directly in your code editor** โ€” no panels, no popups, no context switching. Type a command, hit Enter, it disappears. Messages float beside your code and fade away. ![demo](https://img.shields.io/badge/status-alpha-orange) ## How It Works ``` \\cl zhangsan โ† connect to local server as "zhangsan", hit Enter, line gone \\t lisi hey there โ† send message, line gone, bubble appears: zhangsan>lisi: hey there ``` Incoming messages appear as inline decorations: ```python def hello(): ๐Ÿ’ฌ lisi>zhangsan: hey back! โ† fades in 5s pass ``` Press Enter on an empty line or type `\\d` to dismiss immediately. ## Commands ### Connection | Command | Description | |---------|-------------| | `\\c addr id` | Connect to server | | `\\cl id` | Connect to localhost:9000 | | `\\a alias addr` | Save server alias | | `\\ca alias id` | Connect using alias | | `\\dc` | Disconnect | ### Messaging | Command | Description | |---------|-------------| | `\\t userId msg` | Send message | | `\\r msg` | Reply to last person | | `\\g groupId msg` | Group message | | `\\ut fromId toId msg` | Send as another identity (no switch) | ### Identity | Command | Description | |---------|-------------| | `\\u` | List registered identities | | `\\u zhangsan` | Switch identity (auto-reconnect if online) | ### Friends | Command | Description | |---------|-------------| | `\\add id` | Add friend | | `\\rm id` | Remove friend | | `\\ls` | List friends | ### Control | Command | Description | |---------|-------------| | `\\d` `\\x` `\\h` `\\e` | Dismiss bubbles | | `Empty line + Enter` | Dismiss bubbles | | `\\on` / `\\off` | Enable / pause LineChat | ## Sidebar Panel Click the ๐Ÿ’ฌ icon in the Activity Bar: - **Friends** โ€” manage friend IDs (add/remove) - **Chat Log** โ€” message history in `user1>user2: msg` format, system events as `sys: ...` - Toggle ON/OFF and Clear buttons on the Chat Log panel ## Server LineChat uses a lightweight HTTP polling server. No WebSocket, no dependencies. ### Start ```bash node server.js 9000 ``` ### API | Endpoint | Method | Description | |----------|--------|-------------| | `/auth` | POST | `{ id, token }` โ€” register or authenticate | | `/send` | POST | `{ from, token, to, text }` โ€” send message | | `/poll?id=x&token=x` | GET | Pull pending messages | ### How It Works - First connection with an ID auto-registers it (token saved locally) - Messages are queued on the server, pulled every 1s by clients - Works across NAT/private networks โ€” only needs HTTP access to the server - Default test users: `a`, `b`, `c`, `1`, `2`, `3` (token = id) ## Install from Source ```bash git clone https://github.com/iiangs/linechat.git cd linechat npm install npm run build ``` Then press F5 in VS Code to launch the Extension Development Host. ## Architecture ``` src/ โ”œโ”€โ”€ extension.ts # Entry point, command dispatch โ”œโ”€โ”€ parser.ts # Detects \\ commands in editor lines โ”œโ”€โ”€ bubble.ts # Inline message decorations (auto-fade) โ”œโ”€โ”€ client.ts # HTTP polling client with token auth โ”œโ”€โ”€ log.ts # Chat log panel (TreeView) โ”œโ”€โ”€ friends.ts # Friend ID list (JSON file) โ”œโ”€โ”€ friendsView.ts # Friends sidebar panel โ””โ”€โ”€ aliases.ts # Server alias storage server.js # Standalone HTTP relay server (zero deps) ``` ## Design Philosophy - **Zero UI** โ€” everything happens in code lines - **Zero deps** โ€” client uses Node.js `http`, server is plain Node.js - **Zero config** โ€” type `\\cl myname` and you're in - **Invisible** โ€” messages appear and disappear, your code stays clean ## Author ๆŽ็›†ๅ„ฟ ยท git@iiang.cn ## License MIT