时地方

This commit is contained in:
coco
2026-07-21 14:53:24 +08:00
parent 8b94d76799
commit 1b8027e61c
308 changed files with 61360 additions and 10 deletions
File diff suppressed because it is too large Load Diff
+86
View File
@@ -0,0 +1,86 @@
---
title:
source: "https://gist.githubusercontent.com/karpathy/442a6bf555914893e9891c11519de94f/raw/ac46de1ad27f92b28ac95459c782c07f6b8c964a/llm-wiki.md"
author:
published:
created: 2026-04-07
description:
tags:
- "clippings"
---
```
# LLM Wiki
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
## The core idea
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
The idea here is different. Instead of just retrieving from raw documents at query time, the LLM **incrementally builds and maintains a persistent wiki** — a structured, interlinked collection of markdown files that sits between you and the raw sources. When you add a new source, the LLM doesn't just index it for later retrieval. It reads it, extracts the key information, and integrates it into the existing wiki — updating entity pages, revising topic summaries, noting where new data contradicts old claims, strengthening or challenging the evolving synthesis. The knowledge is compiled once and then *kept current*, not re-derived on every query.
This is the key difference: **the wiki is a persistent, compounding artifact.** The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read. The wiki keeps getting richer with every source you add and every question you ask.
You never (or rarely) write the wiki yourself — the LLM writes and maintains all of it. You're in charge of sourcing, exploration, and asking the right questions. The LLM does all the grunt work — the summarizing, cross-referencing, filing, and bookkeeping that makes a knowledge base actually useful over time. In practice, I have the LLM agent open on one side and Obsidian open on the other. The LLM makes edits based on our conversation, and I browse the results in real time — following links, checking the graph view, reading the updated pages. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.
This can apply to a lot of different contexts. A few examples:
- **Personal**: tracking your own goals, health, psychology, self-improvement — filing journal entries, articles, podcast notes, and building up a structured picture of yourself over time.
- **Research**: going deep on a topic over weeks or months — reading papers, articles, reports, and incrementally building a comprehensive wiki with an evolving thesis.
- **Reading a book**: filing each chapter as you go, building out pages for characters, themes, plot threads, and how they connect. By the end you have a rich companion wiki. Think of fan wikis like [Tolkien Gateway](https://tolkiengateway.net/wiki/Main_Page) — thousands of interlinked pages covering characters, places, events, languages, built by a community of volunteers over years. You could build something like that personally as you read, with the LLM doing all the cross-referencing and maintenance.
- **Business/team**: an internal wiki maintained by LLMs, fed by Slack threads, meeting transcripts, project documents, customer calls. Possibly with humans in the loop reviewing updates. The wiki stays current because the LLM does the maintenance that no one on the team wants to do.
- **Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives** — anything where you're accumulating knowledge over time and want it organized rather than scattered.
## Architecture
There are three layers:
**Raw sources** — your curated collection of source documents. Articles, papers, images, data files. These are immutable — the LLM reads from them but never modifies them. This is your source of truth.
**The wiki** — a directory of LLM-generated markdown files. Summaries, entity pages, concept pages, comparisons, an overview, a synthesis. The LLM owns this layer entirely. It creates pages, updates them when new sources arrive, maintains cross-references, and keeps everything consistent. You read it; the LLM writes it.
**The schema** — a document (e.g. CLAUDE.md for Claude Code or AGENTS.md for Codex) that tells the LLM how the wiki is structured, what the conventions are, and what workflows to follow when ingesting sources, answering questions, or maintaining the wiki. This is the key configuration file — it's what makes the LLM a disciplined wiki maintainer rather than a generic chatbot. You and the LLM co-evolve this over time as you figure out what works for your domain.
## Operations
**Ingest.** You drop a new source into the raw collection and tell the LLM to process it. An example flow: the LLM reads the source, discusses key takeaways with you, writes a summary page in the wiki, updates the index, updates relevant entity and concept pages across the wiki, and appends an entry to the log. A single source might touch 10-15 wiki pages. Personally I prefer to ingest sources one at a time and stay involved — I read the summaries, check the updates, and guide the LLM on what to emphasize. But you could also batch-ingest many sources at once with less supervision. It's up to you to develop the workflow that fits your style and document it in the schema for future sessions.
**Query.** You ask questions against the wiki. The LLM searches for relevant pages, reads them, and synthesizes an answer with citations. Answers can take different forms depending on the question — a markdown page, a comparison table, a slide deck (Marp), a chart (matplotlib), a canvas. The important insight: **good answers can be filed back into the wiki as new pages.** A comparison you asked for, an analysis, a connection you discovered — these are valuable and shouldn't disappear into chat history. This way your explorations compound in the knowledge base just like ingested sources do.
**Lint.** Periodically, ask the LLM to health-check the wiki. Look for: contradictions between pages, stale claims that newer sources have superseded, orphan pages with no inbound links, important concepts mentioned but lacking their own page, missing cross-references, data gaps that could be filled with a web search. The LLM is good at suggesting new questions to investigate and new sources to look for. This keeps the wiki healthy as it grows.
## Indexing and logging
Two special files help the LLM (and you) navigate the wiki as it grows. They serve different purposes:
**index.md** is content-oriented. It's a catalog of everything in the wiki — each page listed with a link, a one-line summary, and optionally metadata like date or source count. Organized by category (entities, concepts, sources, etc.). The LLM updates it on every ingest. When answering a query, the LLM reads the index first to find relevant pages, then drills into them. This works surprisingly well at moderate scale (~100 sources, ~hundreds of pages) and avoids the need for embedding-based RAG infrastructure.
**log.md** is chronological. It's an append-only record of what happened and when — ingests, queries, lint passes. A useful tip: if each entry starts with a consistent prefix (e.g. \`## [2026-04-02] ingest | Article Title\`), the log becomes parseable with simple unix tools — \`grep "^## \[" log.md | tail -5\` gives you the last 5 entries. The log gives you a timeline of the wiki's evolution and helps the LLM understand what's been done recently.
## Optional: CLI tools
At some point you may want to build small tools that help the LLM operate on the wiki more efficiently. A search engine over the wiki pages is the most obvious one — at small scale the index file is enough, but as the wiki grows you want proper search. [qmd](https://github.com/tobi/qmd) is a good option: it's a local search engine for markdown files with hybrid BM25/vector search and LLM re-ranking, all on-device. It has both a CLI (so the LLM can shell out to it) and an MCP server (so the LLM can use it as a native tool). You could also build something simpler yourself — the LLM can help you vibe-code a naive search script as the need arises.
## Tips and tricks
- **Obsidian Web Clipper** is a browser extension that converts web articles to markdown. Very useful for quickly getting sources into your raw collection.
- **Download images locally.** In Obsidian Settings → Files and links, set "Attachment folder path" to a fixed directory (e.g. \`raw/assets/\`). Then in Settings → Hotkeys, search for "Download" to find "Download attachments for current file" and bind it to a hotkey (e.g. Ctrl+Shift+D). After clipping an article, hit the hotkey and all images get downloaded to local disk. This is optional but useful — it lets the LLM view and reference images directly instead of relying on URLs that may break. Note that LLMs can't natively read markdown with inline images in one pass — the workaround is to have the LLM read the text first, then view some or all of the referenced images separately to gain additional context. It's a bit clunky but works well enough.
- **Obsidian's graph view** is the best way to see the shape of your wiki — what's connected to what, which pages are hubs, which are orphans.
- **Marp** is a markdown-based slide deck format. Obsidian has a plugin for it. Useful for generating presentations directly from wiki content.
- **Dataview** is an Obsidian plugin that runs queries over page frontmatter. If your LLM adds YAML frontmatter to wiki pages (tags, dates, source counts), Dataview can generate dynamic tables and lists.
- The wiki is just a git repo of markdown files. You get version history, branching, and collaboration for free.
## Why this works
The tedious part of maintaining a knowledge base is not the reading or the thinking — it's the bookkeeping. Updating cross-references, keeping summaries current, noting when new data contradicts old claims, maintaining consistency across dozens of pages. Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass. The wiki stays maintained because the cost of maintenance is near zero.
The human's job is to curate sources, direct the analysis, ask good questions, and think about what it all means. The LLM's job is everything else.
The idea is related in spirit to Vannevar Bush's Memex (1945) — a personal, curated knowledge store with associative trails between documents. Bush's vision was closer to this than to what the web became: private, actively curated, with the connections between documents as valuable as the documents themselves. The part he couldn't solve was who does the maintenance. The LLM handles that.
## Note
This document is intentionally abstract. It describes the idea, not a specific implementation. The exact directory structure, the schema conventions, the page formats, the tooling — all of that will depend on your domain, your preferences, and your LLM of choice. Everything mentioned above is optional and modular — pick what's useful, ignore what isn't. For example: your sources might be text-only, so you don't need image handling at all. Your wiki might be small enough that the index file is all you need, no search engine required. You might not care about slide decks and just want markdown pages. You might want a completely different set of output formats. The right way to use this is to share it with your LLM agent and work together to instantiate a version that fits your needs. The document's only job is to communicate the pattern. Your LLM can figure out the rest.
```
@@ -0,0 +1,124 @@
---
title: "AbuZar-Ansarii/NanoBot-Android: Nanobot is a personal AI assistant inspired by OpenClaw. It delivers core agent functionality in just ~4,000 lines of code—99% smaller than alternatives, making it perfect for mobile devices."
source: "https://github.com/AbuZar-Ansarii/NanoBot-Android"
author:
- "[[GitHub]]"
published:
created: 2026-03-16
description: "Nanobot is a personal AI assistant inspired by OpenClaw. It delivers core agent functionality in just ~4,000 lines of code—99% smaller than alternatives, making it perfect for mobile devices. - AbuZar-Ansarii/NanoBot-Android"
tags:
- "clippings"
---
## 🐈 Nanobot: Local Android/Termux Installation Guide
**Install the ultra-lightweight AI Agent on your phone.**
Nanobot is a personal AI assistant inspired by OpenClaw. It delivers core agent functionality in just ~4,000 lines of code—99% smaller than alternatives, making it perfect for mobile devices.
---
## ⚡️ Quick Stats
- **Lightweight:** ~4,000 lines of code.
- **Powerful:** Supports local LLMs via Ollama.
- **Versatile:** Connects to Telegram and Web UIs.
---
## 🛠 Step-by-Step Installation
### 1\. Prepare Termux Environment
Update packages and install the Ubuntu proot container.
```
pkg update && pkg upgrade -y
pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu
```
1. System Setup (Inside Ubuntu) Ensure your Ubuntu environment is up to date and has the necessary tools.
```
apt update && apt upgrade -y
apt install python3 python3-pip git -y
```
1. Clone & Prepare Virtual Environment Isolate the installation to prevent system conflicts.
```
git clone [https://github.com/HKUDS/nanobot.git](https://github.com/HKUDS/nanobot.git)
cd nanobot
apt update && apt install python3-venv -y
python3 -m venv ~/nano_env
source ~/nano_env/bin/activate
```
1. Install Nanobot
```
pip install nanobot-ai
nanobot onboard
```
🤖 Setup Telegram Integration Get your Bot Token Open Telegram and search for @BotFather.
Type /newbot and follow the prompts.
Choose a Name and Username for your bot.
Copy the API Token provided.
Configure Nanobot (Ollama + Telegram) Paste the following command (replace YOUR\_TELEGRAM\_TOKEN\_HERE with your actual token). This configures Nanobot to use your local Ollama instance with the Kimi 2.5 Cloud model.
```
cat <<EOF > ~/.nanobot/config.json
{
"providers": {
"openai": {
"apiKey": "ollama",
"apiBase": "http://localhost:11434/v1"
}
},
"agents": {
"defaults": {
"model": "openai/kimi-k2.5:cloud"
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_TOKEN_HERE",
"allowFrom": []
}
}
}
EOF
```
🚀 Running the Agent Start the Gateway
```
nanobot gateway
```
💡 Pro Tip: Running in the Background To keep your bot alive even after you close the Termux app, use nohup:
```
nohup nanobot agent > nanobot.log 2>&1 &
```
🌐 Web Interface (Chrome/OpenClaw-style) If you prefer a visual chat interface in your browser instead of a terminal or Telegram:
Install & Run WebUI
```
pip install open-webui
open-webui serve
```
Access URL Open Chrome on your Android device and visit:
```
http://localhost:8080
```
@@ -0,0 +1,435 @@
---
title: "codecrafters-io/build-your-own-x: Master programming by recreating your favorite technologies from scratch."
source: "https://github.com/codecrafters-io/build-your-own-x"
author:
- "[[sarupbanskota]]"
published:
created: 2026-03-13
description: "Master programming by recreating your favorite technologies from scratch. - codecrafters-io/build-your-own-x"
tags:
- "clippings"
---
You only have a single verified email address. We recommend verifying at least one more email address to ensure you can recover your account if you lose access to your primary email.
[Open in github.dev](https://github.dev/) [Open in a new github.dev tab](https://github.dev/) [Open in codespace](https://github.com/codespaces/new/codecrafters-io/build-your-own-x?resume=1)
[![Banner](https://camo.githubusercontent.com/7400043785d335776fdf58c9a12130f68ef27505c29e4b4de362ac5c8dc850f9/68747470733a2f2f636f646563726166746572732e696f2f696d616765732f6e65772d63636769746875622d62616e6e65722e706e67)](https://codecrafters.io/github-banner)
This repository is a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch.
> *What I cannot create, I do not understand — Richard Feynman.*
It's a great way to learn.
- [3D Renderer](https://github.com/codecrafters-io/#build-your-own-3d-renderer)
- [AI Model](https://github.com/codecrafters-io/#ai-model)
- [Augmented Reality](https://github.com/codecrafters-io/#build-your-own-augmented-reality)
- [BitTorrent Client](https://github.com/codecrafters-io/#build-your-own-bittorrent-client)
- [Blockchain / Cryptocurrency](https://github.com/codecrafters-io/#build-your-own-blockchain--cryptocurrency)
- [Bot](https://github.com/codecrafters-io/#build-your-own-bot)
- [Command-Line Tool](https://github.com/codecrafters-io/#build-your-own-command-line-tool)
- [Database](https://github.com/codecrafters-io/#build-your-own-database)
- [Docker](https://github.com/codecrafters-io/#build-your-own-docker)
- [Emulator / Virtual Machine](https://github.com/codecrafters-io/#build-your-own-emulator--virtual-machine)
- [Front-end Framework / Library](https://github.com/codecrafters-io/#build-your-own-front-end-framework--library)
- [Game](https://github.com/codecrafters-io/#build-your-own-game)
- [Git](https://github.com/codecrafters-io/#build-your-own-git)
- [Memory Allocator](https://github.com/codecrafters-io/#build-your-own-memory-allocator)
- [Network Stack](https://github.com/codecrafters-io/#build-your-own-network-stack)
- [Neural Network](https://github.com/codecrafters-io/#build-your-own-neural-network)
- [Operating System](https://github.com/codecrafters-io/#build-your-own-operating-system)
- [Physics Engine](https://github.com/codecrafters-io/#build-your-own-physics-engine)
- [Processor](https://github.com/codecrafters-io/#build-your-own-processor)
- [Programming Language](https://github.com/codecrafters-io/#build-your-own-programming-language)
- [Regex Engine](https://github.com/codecrafters-io/#build-your-own-regex-engine)
- [Search Engine](https://github.com/codecrafters-io/#build-your-own-search-engine)
- [Shell](https://github.com/codecrafters-io/#build-your-own-shell)
- [Template Engine](https://github.com/codecrafters-io/#build-your-own-template-engine)
- [Text Editor](https://github.com/codecrafters-io/#build-your-own-text-editor)
- [Visual Recognition System](https://github.com/codecrafters-io/#build-your-own-visual-recognition-system)
- [Voxel Engine](https://github.com/codecrafters-io/#build-your-own-voxel-engine)
- [Web Browser](https://github.com/codecrafters-io/#build-your-own-web-browser)
- [Web Server](https://github.com/codecrafters-io/#build-your-own-web-server)
- [Uncategorized](https://github.com/codecrafters-io/#uncategorized)
## Tutorials
- [**Java**: *Building Your Own Kafka-like System From Scratch: A Step-by-Step Guide*](https://github.com/buildthingsuseful/build-your-own-kafka)
- [**C++**: *Introduction to Ray Tracing: a Simple Method for Creating 3D Images*](https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/how-does-it-work)
- [**C++**: *How OpenGL works: software rendering in 500 lines of code*](https://github.com/ssloy/tinyrenderer/wiki)
- [**C++**: *Raycasting engine of Wolfenstein 3D*](http://lodev.org/cgtutor/raycasting.html)
- [**C++**: *Physically Based Rendering:From Theory To Implementation*](http://www.pbr-book.org/)
- [**C++**: *Ray Tracing in One Weekend*](https://raytracing.github.io/books/RayTracingInOneWeekend.html)
- [**C++**: *Rasterization: a Practical Implementation*](https://www.scratchapixel.com/lessons/3d-basic-rendering/rasterization-practical-implementation/overview-rasterization-algorithm)
- [**C# / TypeScript / JavaScript**: *Learning how to write a 3D soft engine from scratch in C#, TypeScript or JavaScript*](https://www.davrous.com/2013/06/13/tutorial-series-learning-how-to-write-a-3d-soft-engine-from-scratch-in-c-typescript-or-javascript/)
- [**Java / JavaScript**: *Build your own 3D renderer*](https://avik-das.github.io/build-your-own-raytracer/)
- [**Java**: *How to create your own simple 3D render engine in pure Java*](http://blog.rogach.org/2015/08/how-to-create-your-own-simple-3d-render.html)
- [**JavaScript / Pseudocode**: *Computer Graphics from scratch*](http://www.gabrielgambetta.com/computer-graphics-from-scratch/introduction.html)
- [**Python**: *A 3D Modeller*](http://aosabook.org/en/500L/a-3d-modeller.html)
- [**Python**: *A Large Language Model (LLM)*](https://github.com/rasbt/LLMs-from-scratch)
- [**Python**: *Diffusion Models for Image Generation*](https://huggingface.co/learn/diffusion-course/en/unit1/3)
- [**Python**: *RAG for Document Search*](https://github.com/langchain-ai/rag-from-scratch)
- [**C#**: *How To: Augmented Reality App Tutorial for Beginners with Vuforia and Unity 3D*](https://www.youtube.com/watch?v=uXNjNcqW4kY) \[video\]
- [**C#**: *How To Unity ARCore*](https://www.youtube.com/playlist?list=PLKIKuXdn4ZMjuUAtdQfK1vwTZPQn_rgSv) \[video\]
- [**C#**: *AR Portal Tutorial with Unity*](https://www.youtube.com/playlist?list=PLPCqNOwwN794Gz5fzUSi1p4OqLU0HTmvn) \[video\]
- [**C#**: *How to create a Dragon in Augmented Reality in Unity ARCore*](https://www.youtube.com/watch?v=qTSDPkPyPqs) \[video\]
- [**C#**: *How to Augmented Reality AR Tutorial: ARKit Portal to the Upside Down*](https://www.youtube.com/watch?v=Z5AmqMuNi08) \[video\]
- [**Python**: *Augmented Reality with Python and OpenCV*](https://bitesofcode.wordpress.com/2017/09/12/augmented-reality-with-python-and-opencv-part-1/)
- [**C#**: *Building a BitTorrent client from scratch in C#*](https://www.seanjoflynn.com/research/bittorrent.html)
- [**Go**: *Building a BitTorrent client from the ground up in Go*](https://blog.jse.li/posts/torrent/)
- [**Nim**: *Writing a Bencode Parser*](https://xmonader.github.io/nimdays/day02_bencode.html)
- [**Node.js**: *Write your own bittorrent client*](https://allenkim67.github.io/programming/2016/05/04/how-to-make-your-own-bittorrent-client.html)
- [**Python**: *A BitTorrent client in Python 3.5*](http://markuseliasson.se/article/bittorrent-in-python/)
- [**ATS**: *Functional Blockchain*](https://beta.observablehq.com/@galletti94/functional-blockchain)
- [**Crystal**: *Write your own blockchain and PoW algorithm using Crystal*](https://medium.com/@bradford_hamilton/write-your-own-blockchain-and-pow-algorithm-using-crystal-d53d5d9d0c52)
- [**Go**: *Building Blockchain in Go*](https://jeiwan.net/posts/building-blockchain-in-go-part-1/)
- [**Go**: *Code your own blockchain in less than 200 lines of Go*](https://medium.com/@mycoralhealth/code-your-own-blockchain-in-less-than-200-lines-of-go-e296282bcffc)
- [**Java**: *Creating Your First Blockchain with Java*](https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa)
- [**JavaScript**: *A cryptocurrency implementation in less than 1500 lines of code*](https://github.com/conradoqg/naivecoin)
- [**JavaScript**: *Build your own Blockchain in JavaScript*](https://github.com/nambrot/blockchain-in-js)
- [**JavaScript**: *Learn & Build a JavaScript Blockchain*](https://medium.com/digital-alchemy-holdings/learn-build-a-javascript-blockchain-part-1-ca61c285821e)
- [**JavaScript**: *Creating a blockchain with JavaScript*](https://github.com/SavjeeTutorials/SavjeeCoin)
- [**JavaScript**: *How To Launch Your Own Production-Ready Cryptocurrency*](https://hackernoon.com/how-to-launch-your-own-production-ready-cryptocurrency-ab97cb773371)
- [**JavaScript**: *Writing a Blockchain in Node.js*](https://www.smashingmagazine.com/2020/02/cryptocurrency-blockchain-node-js/)
- [**Kotlin**: *Let’s implement a cryptocurrency in Kotlin*](https://medium.com/@vasilyf/lets-implement-a-cryptocurrency-in-kotlin-part-1-blockchain-8704069f8580)
- [**Python**: *Learn Blockchains by Building One*](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)
- [**Python**: *Build your own blockchain: a Python tutorial*](http://ecomunsing.com/build-your-own-blockchain)
- [**Python**: *A Practical Introduction to Blockchain with Python*](http://adilmoujahid.com/posts/2018/03/intro-blockchain-bitcoin-python/)
- [**Python**: *Let’s Build the Tiniest Blockchain*](https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b)
- [**Ruby**: *Programming Blockchains Step-by-Step (Manuscripts Book Edition)*](https://github.com/yukimotopress/programming-blockchains-step-by-step)
- [**Scala**: *How to build a simple actor-based blockchain*](https://medium.freecodecamp.org/how-to-build-a-simple-actor-based-blockchain-aac1e996c177)
- [**TypeScript**: *Naivecoin: a tutorial for building a cryptocurrency*](https://lhartikk.github.io/)
- [**TypeScript**: *NaivecoinStake: a tutorial for building a cryptocurrency with the Proof of Stake consensus*](https://naivecoinstake.learn.uno/)
- [**Rust**: *Building A Blockchain in Rust & Substrate*](https://hackernoon.com/building-a-blockchain-in-rust-and-substrate-a-step-by-step-guide-for-developers-kc223ybp)
- [**Haskell**: *Roll your own IRC bot*](https://wiki.haskell.org/Roll_your_own_IRC_bot)
- [**Node.js**: *Creating a Simple Facebook Messenger AI Bot with API.ai in Node.js*](https://tutorials.botsfloor.com/creating-a-simple-facebook-messenger-ai-bot-with-api-ai-in-node-js-50ae2fa5c80d)
- [**Node.js**: *How to make a responsive telegram bot*](https://www.sohamkamani.com/blog/2016/09/21/making-a-telegram-bot/)
- [**Node.js**: *Create a Discord bot*](https://discordjs.guide/)
- [**Node.js**: *gifbot - Building a GitHub App*](https://blog.scottlogic.com/2017/05/22/gifbot-github-integration.html)
- [**Node.js**: *Building A Simple AI Chatbot With Web Speech API And Node.js*](https://www.smashingmagazine.com/2017/08/ai-chatbot-web-speech-api-node-js/)
- [**Python**: *How to Build Your First Slack Bot with Python*](https://www.fullstackpython.com/blog/build-first-slack-bot-python.html)
- [**Python**: *How to build a Slack Bot with Python using Slack Events API & Django under 20 minute*](https://medium.com/freehunch/how-to-build-a-slack-bot-with-python-using-slack-events-api-django-under-20-minute-code-included-269c3a9bf64e)
- [**Python**: *Build a Reddit Bot*](https://pythonforengineers.com/blog/build-a-reddit-bot-part-1/)
- [**Python**: *How To Make A Reddit Bot*](https://www.youtube.com/watch?v=krTUf7BpTc0) \[video\]
- [**Python**: *How To Create a Telegram Bot Using Python*](https://www.freecodecamp.org/news/how-to-create-a-telegram-bot-using-python/)
- [**Python**: *Create a Twitter Bot in Python Using Tweepy*](https://medium.freecodecamp.org/creating-a-twitter-bot-in-python-with-tweepy-ac524157a607)
- [**Python**: *Creating Reddit Bot with Python & PRAW*](https://www.youtube.com/playlist?list=PLIFBTFgFpoJ9vmYYlfxRFV6U_XhG-4fpP) \[video\]
- [**R**: *Build A Cryptocurrency Trading Bot with R*](https://towardsdatascience.com/build-a-cryptocurrency-trading-bot-with-r-1445c429e1b1)
- [**Rust**: *A bot for Starcraft in Rust, C or any other language*](https://habr.com/en/post/436254/)
- [**Go**: *Visualize your local git contributions with Go*](https://flaviocopes.com/go-git-contributions/)
- [**Go**: *Build a command line app with Go: lolcat*](https://flaviocopes.com/go-tutorial-lolcat/)
- [**Go**: *Building a cli command with Go: cowsay*](https://flaviocopes.com/go-tutorial-cowsay/)
- [**Go**: *Go CLI tutorial: fortune clone*](https://flaviocopes.com/go-tutorial-fortune/)
- [**Nim**: *Writing a stow alternative to manage dotfiles*](https://xmonader.github.io/nimdays/day06_nistow.html)
- [**Node.js**: *Create a CLI tool in Javascript*](https://citw.dev/tutorial/create-your-own-cli-tool)
- [**Rust**: *Command line apps in Rust*](https://rust-cli.github.io/book/index.html)
- [**Rust**: *Writing a Command Line Tool in Rust*](https://mattgathu.dev/2017/08/29/writing-cli-app-rust.html)
- [**Zig**: *Build Your Own CLI App in Zig from Scratch*](https://rebuild-x.github.io/docs/#/./zig/terminal/cli)
- [**C**: *Let's Build a Simple Database*](https://cstack.github.io/db_tutorial/)
- [**C++**: *Build Your Own Redis from Scratch*](https://build-your-own.org/redis)
- [**C#**: *Build Your Own Database*](https://www.codeproject.com/Articles/1029838/Build-Your-Own-Database)
- [**Clojure**: *An Archaeology-Inspired Database*](http://aosabook.org/en/500L/an-archaeology-inspired-database.html)
- [**Crystal**: *Why you should build your own NoSQL Database*](https://medium.com/@marceloboeira/why-you-should-build-your-own-nosql-database-9bbba42039f5)
- [**Go**: *Build Your Own Database from Scratch: From B+Tree To SQL in 3000 Lines*](https://build-your-own.org/database/)
- [**Go**: *Code a database in 45 steps: a series of test-driven small coding puzzles*](https://trialofcode.org/database/)
- [**Go**: *Build Your Own Redis from Scratch*](https://www.build-redis-from-scratch.dev/)
- [**JavaScript**: *Dagoba: an in-memory graph database*](http://aosabook.org/en/500L/dagoba-an-in-memory-graph-database.html)
- [**Python**: *DBDB: Dog Bed Database*](http://aosabook.org/en/500L/dbdb-dog-bed-database.html)
- [**Python**: *Write your own miniature Redis with Python*](http://charlesleifer.com/blog/building-a-simple-redis-server-with-python/)
- [**Ruby**: *Build your own fast, persistent KV store in Ruby*](https://dineshgowda.com/posts/build-your-own-persistent-kv-store/)
- [**Rust**: *Build your own Redis client and server*](https://tokio.rs/tokio/tutorial/setup)
- [**C**: *Linux containers in 500 lines of code*](https://blog.lizzie.io/linux-containers-in-500-loc.html)
- [**Go**: *Build Your Own Container Using Less than 100 Lines of Go*](https://www.infoq.com/articles/build-a-container-golang)
- [**Go**: *Building a container from scratch in Go*](https://www.youtube.com/watch?v=8fi7uSYlOdc) \[video\]
- [**Python**: *A workshop on Linux containers: Rebuild Docker from Scratch*](https://github.com/Fewbytes/rubber-docker)
- [**Python**: *A proof-of-concept imitation of Docker, written in 100% Python*](https://github.com/tonybaloney/mocker)
- [**Shell**: *Docker implemented in around 100 lines of bash*](https://github.com/p8952/bocker)
- [**C**: *Home-grown bytecode interpreters*](https://medium.com/bumble-tech/home-grown-bytecode-interpreters-51e12d59b25c)
- [**C**: *Virtual machine in C*](http://web.archive.org/web/20200121100942/https://blog.felixangell.com/virtual-machine-in-c/)
- [**C**: *Write your Own Virtual Machine*](https://justinmeiners.github.io/lc3-vm/)
- [**C**: *Writing a Game Boy emulator, Cinoop*](https://cturt.github.io/cinoop.html)
- [**C++**: *How to write an emulator (CHIP-8 interpreter)*](http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/)
- [**C++**: *Emulation tutorial (CHIP-8 interpreter)*](http://www.codeslinger.co.uk/pages/projects/chip8.html)
- [**C++**: *Emulation tutorial (GameBoy emulator)*](http://www.codeslinger.co.uk/pages/projects/gameboy.html)
- [**C++**: *Emulation tutorial (Master System emulator)*](http://www.codeslinger.co.uk/pages/projects/mastersystem/memory.html)
- [**C++**: *NES Emulator From Scratch*](https://www.youtube.com/playlist?list=PLrOv9FMX8xJHqMvSGB_9G9nZZ_4IgteYf) \[video\]
- [**Common Lisp**: *CHIP-8 in Common Lisp*](http://stevelosh.com/blog/2016/12/chip8-cpu/)
- [**JavaScript**: *GameBoy Emulation in JavaScript*](http://imrannazar.com/GameBoy-Emulation-in-JavaScript)
- [**Python**: *Emulation Basics: Write your own Chip 8 Emulator/Interpreter*](http://omokute.blogspot.com.br/2012/06/emulation-basics-write-your-own-chip-8.html)
- [**Rust**: *0dmg: Learning Rust by building a partial Game Boy emulator*](https://jeremybanks.github.io/0dmg/)
- [**JavaScript**: *WTF is JSX (Let's Build a JSX Renderer)*](https://jasonformat.com/wtf-is-jsx/)
- [**JavaScript**: *A DIY guide to build your own React*](https://github.com/hexacta/didact)
- [**JavaScript**: *Building React From Scratch*](https://www.youtube.com/watch?v=_MAD4Oly9yg) \[video\]
- [**JavaScript**: *Gooact: React in 160 lines of JavaScript*](https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f)
- [**JavaScript**: *Learn how React Reconciler package works by building your own lightweight React DOM*](https://hackernoon.com/learn-you-some-custom-react-renderers-aed7164a4199)
- [**JavaScript**: *Build Yourself a Redux*](https://zapier.com/engineering/how-to-build-redux/)
- [**JavaScript**: *Let’s Write Redux!*](https://www.jamasoftware.com/blog/lets-write-redux/)
- [**JavaScript**: *Redux: Implementing Store from Scratch*](https://egghead.io/lessons/react-redux-implementing-store-from-scratch) \[video\]
- [**JavaScript**: *Build Your own Simplified AngularJS in 200 Lines of JavaScript*](https://blog.mgechev.com/2015/03/09/build-learn-your-own-light-lightweight-angularjs/)
- [**JavaScript**: *Make Your Own AngularJS*](http://teropa.info/blog/2013/11/03/make-your-own-angular-part-1-scopes-and-digest.html)
- [**JavaScript**: *How to write your own Virtual DOM*](https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060)
- [**JavaScript**: *Building a frontend framework, from scratch, with components (templating, state, VDOM)*](https://mfrachet.github.io/create-frontend-framework/)
- [**JavaScript**: *Build your own React*](https://pomb.us/build-your-own-react/)
- [**JavaScript**: *Building a Custom React Renderer*](https://youtu.be/CGpMlWVcHok) \[video\]
- [**C**: *Handmade Hero*](https://handmadehero.org/)
- [**C**: *How to Program an NES game in C*](https://nesdoug.com/)
- [**C**: *Chess Engine In C*](https://www.youtube.com/playlist?list=PLZ1QII7yudbc-Ky058TEaOstZHVbT-2hg) \[video\]
- [**C**: *Let's Make: Dangerous Dave*](https://www.youtube.com/playlist?list=PLSkJey49cOgTSj465v2KbLZ7LMn10bCF9) \[video\]
- [**C**: *Learn Video Game Programming in C*](https://www.youtube.com/playlist?list=PLT6WFYYZE6uLMcPGS3qfpYm7T_gViYMMt) \[video\]
- [**C**: *Coding A Sudoku Solver in C*](https://www.youtube.com/playlist?list=PLkTXsX7igf8edTYU92nU-f5Ntzuf-RKvW) \[video\]
- [**C**: *Coding a Rogue/Nethack RPG in C*](https://www.youtube.com/playlist?list=PLkTXsX7igf8erbWGYT4iSAhpnJLJ0Nk5G) \[video\]
- [**C**: *On Tetris and Reimplementation*](https://brennan.io/2015/06/12/tetris-reimplementation/)
- [**C++**: *Breakout*](https://learnopengl.com/In-Practice/2D-Game/Breakout)
- [**C++**: *Beginning Game Programming v2.0*](http://lazyfoo.net/tutorials/SDL/)
- [**C++**: *Tetris tutorial in C++ platform independent focused in game logic for beginners*](http://javilop.com/gamedev/tetris-tutorial-in-c-platform-independent-focused-in-game-logic-for-beginners/)
- [**C++**: *Remaking Cavestory in C++*](https://www.youtube.com/watch?v=ETvApbD5xRo&list=PLNOBk_id22bw6LXhrGfhVwqQIa-M2MsLa) \[video\]
- [**C++**: *Reconstructing Cave Story*](https://www.youtube.com/playlist?list=PL006xsVEsbKjSKBmLu1clo85yLrwjY67X) \[video\]
- [**C++**: *Space Invaders from Scratch*](http://nicktasios.nl/posts/space-invaders-from-scratch-part-1.html)
- [**C#**: *Learn C# by Building a Simple RPG*](http://scottlilly.com/learn-c-by-building-a-simple-rpg-index/)
- [**C#**: *Creating a Roguelike Game in C#*](https://roguesharp.wordpress.com/)
- [**C#**: *Build a C#/WPF RPG*](https://scottlilly.com/build-a-cwpf-rpg/)
- [**Go**: *Games With Go*](https://www.youtube.com/playlist?list=PLDZujg-VgQlZUy1iCqBbe5faZLMkA3g2x) \[video\]
- [**Java**: *Code a 2D Game Engine using Java - Full Course for Beginners*](https://www.youtube.com/watch?v=025QFeZfeyM) \[video\]
- [**Java**: *3D Game Development with LWJGL 3*](https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/)
- [**JavaScript**: *2D breakout game using Phaser*](https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_breakout_game_Phaser)
- [**JavaScript**: *How to Make Flappy Bird in HTML5 With Phaser*](http://www.lessmilk.com/tutorial/flappy-bird-phaser-1)
- [**JavaScript**: *Developing Games with React, Redux, and SVG*](https://auth0.com/blog/developing-games-with-react-redux-and-svg-part-1/)
- [**JavaScript**: *Build your own 8-Ball Pool game from scratch*](https://www.youtube.com/watch?v=aXwCrtAo4Wc) \[video\]
- [**JavaScript**: *How to Make Your First Roguelike*](https://gamedevelopment.tutsplus.com/tutorials/how-to-make-your-first-roguelike--gamedev-13677)
- [**JavaScript**: *Think like a programmer: How to build Snake using only JavaScript, HTML & CSS*](https://medium.freecodecamp.org/think-like-a-programmer-how-to-build-snake-using-only-javascript-html-and-css-7b1479c3339e)
- [**Lua**: *BYTEPATH*](https://github.com/SSYGEN/blog/issues/30)
- [**Python**: *Developing Games With PyGame*](https://pythonprogramming.net/pygame-python-3-part-1-intro/)
- [**Python**: *Making Games with Python & Pygame*](https://inventwithpython.com/makinggames.pdf) \[pdf\]
- [**Python**: *Roguelike Tutorial Revised*](http://rogueliketutorials.com/)
- [**Ruby**: *Developing Games With Ruby*](https://leanpub.com/developing-games-with-ruby/read)
- [**Ruby**: *Ruby Snake*](https://www.diatomenterprises.com/gamedev-on-ruby-why-not/)
- [**Rust**: *Adventures in Rust: A Basic 2D Game*](https://a5huynh.github.io/posts/2018/adventures-in-rust/)
- [**Rust**: *Roguelike Tutorial in Rust + tcod*](https://tomassedovic.github.io/roguelike-tutorial/)
- [**Haskell**: *Reimplementing “git clone” in Haskell from the bottom up*](http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/)
- [**JavaScript**: *Gitlet*](http://gitlet.maryrosecook.com/docs/gitlet.html)
- [**JavaScript**: *Build GIT - Learn GIT*](https://kushagra.dev/blog/build-git-learn-git/)
- [**Python**: *Just enough of a Git client to create a repo, commit, and push itself to GitHub*](https://benhoyt.com/writings/pygit/)
- [**Python**: *Write yourself a Git!*](https://wyag.thb.lt/)
- [**Python**: *ugit: Learn Git Internals by Building Git Yourself*](https://www.leshenko.net/p/ugit/)
- [**Ruby**: *Rebuilding Git in Ruby*](https://robots.thoughtbot.com/rebuilding-git-in-ruby)
- [**C**: *Malloc is not magic -- Implementing your own memory allocator*](https://medium.com/p/e0354e914402)
- [**C**: *Beej's Guide to Network Programming*](http://beej.us/guide/bgnet/)
- [**C**: *Let's code a TCP/IP stack*](http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/)
- [**C / Python**: *Build your own VPN/Virtual Switch*](https://github.com/peiyuanix/build-your-own-zerotier)
- [**Ruby**: *How to build a network stack in Ruby*](https://medium.com/geckoboard-under-the-hood/how-to-build-a-network-stack-in-ruby-f73aeb1b661b)
- [**C#**: *Neural Network OCR*](https://www.codeproject.com/Articles/11285/Neural-Network-OCR)
- [**F#**: *Building Neural Networks in F#: Part 1*](https://medium.com/data-science/building-neural-networks-in-f-part-1-a2832ae972e6)
- [**F#**: *Building Neural Networks in F#: Part 2*](https://medium.com/data-science/building-neural-networks-in-f-part-2-training-evaluation-5e3a68889da6)
- [**Go**: *Build a multilayer perceptron with Golang*](https://made2591.github.io/posts/neuralnetwork)
- [**Go**: *How to build a simple artificial neural network with Go*](https://sausheong.github.io/posts/how-to-build-a-simple-artificial-neural-network-with-go/)
- [**Go**: *Building a Neural Net from Scratch in Go*](https://datadan.io/blog/neural-net-with-go)
- [**JavaScript / Java**: *Neural Networks - The Nature of Code*](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6aCibgK1PTWWu9by6XFdCfh) \[video\]
- [**JavaScript**: *Neural networks from scratch for JavaScript linguists (Part1 — The Perceptron)*](https://hackernoon.com/neural-networks-from-scratch-for-javascript-linguists-part1-the-perceptron-632a4d1fbad2)
- [**Python**: *A Neural Network in 11 lines of Python*](https://iamtrask.github.io/2015/07/12/basic-python-network/)
- [**Python**: *Implement a Neural Network from Scratch*](https://victorzhou.com/blog/intro-to-neural-networks/)
- [**Python**: *Optical Character Recognition (OCR)*](http://aosabook.org/en/500L/optical-character-recognition-ocr.html)
- [**Python**: *Traffic signs classification with a convolutional network*](https://navoshta.com/traffic-signs-classification/)
- [**Python**: *Generate Music using LSTM Neural Network in Keras*](https://towardsdatascience.com/how-to-generate-music-using-a-lstm-neural-network-in-keras-68786834d4c5)
- [**Python**: *An Introduction to Convolutional Neural Networks*](https://victorzhou.com/blog/intro-to-cnns-part-1/)
- [**Python**: *Neural Networks: Zero to Hero*](https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ)
- [**Python**: *SlowTorch: Implementation of PyTorch from the ground up in 100% pure Python*](https://github.com/xames3/slowtorch)
- [**Assembly**: *Writing a Tiny x86 Bootloader*](http://joebergeron.io/posts/post_two.html)
- [**Assembly**: *Baking Pi – Operating Systems Development*](http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/index.html)
- [**C**: *Building a software and hardware stack for a simple computer from scratch*](https://www.youtube.com/watch?v=ZjwvMcP3Nf0&list=PLU94OURih-CiP4WxKSMt3UcwMSDM3aTtX) \[video\]
- [**C**: *Operating Systems: From 0 to 1*](https://tuhdo.github.io/os01/)
- [**C**: *The little book about OS development*](https://littleosbook.github.io/)
- [**C**: *Roll your own toy UNIX-clone OS*](http://jamesmolloy.co.uk/tutorial_html/)
- [**C**: *Kernel 101 – Let’s write a Kernel*](https://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel)
- [**C**: *Kernel 201 – Let’s write a Kernel with keyboard and screen support*](https://arjunsreedharan.org/post/99370248137/kernel-201-lets-write-a-kernel-with-keyboard)
- [**C**: *Build a minimal multi-tasking kernel for ARM from scratch*](https://github.com/jserv/mini-arm-os)
- [**C**: *How to create an OS from scratch*](https://github.com/cfenollosa/os-tutorial)
- [**C**: *Malloc tutorial*](https://danluu.com/malloc-tutorial/)
- [**C**: *Hack the virtual memory*](https://blog.holbertonschool.com/hack-the-virtual-memory-c-strings-proc/)
- [**C**: *Learning operating system development using Linux kernel and Raspberry Pi*](https://github.com/s-matyukevich/raspberry-pi-os)
- [**C**: *Operating systems development for Dummies*](https://medium.com/@lduck11007/operating-systems-development-for-dummies-3d4d786e8ac)
- [**C++**: *Write your own Operating System*](https://www.youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M) \[video\]
- [**C++**: *Writing a Bootloader*](http://3zanders.co.uk/2017/10/13/writing-a-bootloader/)
- [**Rust**: *Writing an OS in Rust*](https://os.phil-opp.com/)
- [**Rust**: *Add RISC-V Rust Operating System Tutorial*](https://osblog.stephenmarz.com/)
- [**(any)**: *Linux from scratch*](https://linuxfromscratch.org/lfs)
- [**C**: *Video Game Physics Tutorial*](https://www.toptal.com/game/video-game-physics-part-i-an-introduction-to-rigid-body-dynamics)
- [**C++**: *Game physics series by Allen Chou*](http://allenchou.net/game-physics-series/)
- [**C++**: *How to Create a Custom Physics Engine*](https://gamedevelopment.tutsplus.com/series/how-to-create-a-custom-physics-engine--gamedev-12715)
- [**C++**: *3D Physics Engine Tutorial*](https://www.youtube.com/playlist?list=PLEETnX-uPtBXm1KEr_2zQ6K_0hoGH6JJ0) \[video\]
- [**JavaScript**: *How Physics Engines Work*](http://buildnewgames.com/gamephysics/)
- [**JavaScript**: *Broad Phase Collision Detection Using Spatial Partitioning*](http://buildnewgames.com/broad-phase-collision-detection/)
- [**JavaScript**: *Build a simple 2D physics engine for JavaScript games*](https://developer.ibm.com/tutorials/wa-build2dphysicsengine/?mhsrc=ibmsearch_a&mhq=2dphysic)
- [**Verilog**: *From Blinker to RISC-V*](https://github.com/BrunoLevy/learn-fpga/tree/master/FemtoRV/TUTORIALS/FROM_BLINKER_TO_RISCV)
- [**(any)**: *mal - Make a Lisp*](https://github.com/kanaka/mal#mal---make-a-lisp)
- [**Assembly**: *Jonesforth*](https://github.com/nornagon/jonesforth/blob/master/jonesforth.S)
- [**C**: *Baby's First Garbage Collector*](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
- [**C**: *Build Your Own Lisp: Learn C and build your own programming language in 1000 lines of code*](http://www.buildyourownlisp.com/)
- [**C**: *Writing a Simple Garbage Collector in C*](http://maplant.com/gc.html)
- [**C**: *C interpreter that interprets itself.*](https://github.com/lotabout/write-a-C-interpreter)
- [**C**: *A C & x86 version of the "Let's Build a Compiler" by Jack Crenshaw*](https://github.com/lotabout/Let-s-build-a-compiler)
- [**C**: *A journey explaining how to build a compiler from scratch*](https://github.com/DoctorWkt/acwj)
- [**C++**: *Writing Your Own Toy Compiler Using Flex*](https://gnuu.org/2009/09/18/writing-your-own-toy-compiler/)
- [**C++**: *How to Create a Compiler*](https://www.youtube.com/watch?v=eF9qWbuQLuw) \[video\]
- [**C++**: *Kaleidoscope: Implementing a Language with LLVM*](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html)
- [**F#**: *Understanding Parser Combinators*](https://fsharpforfunandprofit.com/posts/understanding-parser-combinators/)
- [**Elixir**: *Demystifying compilers by writing your own*](https://www.youtube.com/watch?v=zMJYoYwOCd4) \[video\]
- [**Go**: *The Super Tiny Compiler*](https://github.com/hazbo/the-super-tiny-compiler)
- [**Go**: *Lexical Scanning in Go*](https://www.youtube.com/watch?v=HxaD_trXwRE) \[video\]
- [**Haskell**: *Let's Build a Compiler*](https://g-ford.github.io/cradle/)
- [**Haskell**: *Write You a Haskell*](http://dev.stephendiehl.com/fun/)
- [**Haskell**: *Write Yourself a Scheme in 48 Hours*](https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours)
- [**Haskell**: *Write You A Scheme*](https://www.wespiser.com/writings/wyas/home.html)
- [**Java**: *Crafting interpreters: A handbook for making programming languages*](http://www.craftinginterpreters.com/)
- [**JavaScript**: *The Super Tiny Compiler*](https://github.com/jamiebuilds/the-super-tiny-compiler)
- [**JavaScript**: *The Super Tiny Interpreter*](https://github.com/keyanzhang/the-super-tiny-interpreter)
- [**JavaScript**: *Little Lisp interpreter*](https://maryrosecook.com/blog/post/little-lisp-interpreter)
- [**JavaScript**: *How to implement a programming language in JavaScript*](http://lisperator.net/pltut/)
- [**JavaScript**: *Let’s go write a Lisp*](https://idiocy.org/lets-go-write-a-lisp/part-1.html)
- [**OCaml**: *Writing a C Compiler*](https://norasandler.com/2017/11/29/Write-a-Compiler.html)
- [**OCaml**: *Writing a Lisp, the series*](https://bernsteinbear.com/blog/lisp/)
- [**Pascal**: *Let's Build a Compiler*](https://compilers.iecc.com/crenshaw/)
- [**Python**: *A Python Interpreter Written in Python*](http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html)
- [**Python**: *lisp.py: Make your own Lisp interpreter*](http://khamidou.com/compilers/lisp.py/)
- [**Python**: *How to Write a Lisp Interpreter in Python*](http://norvig.com/lispy.html)
- [**Python**: *Let’s Build A Simple Interpreter*](https://ruslanspivak.com/lsbasi-part1/)
- [**Python**: *Make Your Own Simple Interpreted Programming Language*](https://www.youtube.com/watch?v=dj9CBS3ikGA&list=PLZQftyCk7_SdoVexSmwy_tBgs7P0b97yD&index=1) \[video\]
- [**Python**: *From Source Code To Machine Code: Build Your Own Compiler From Scratch*](https://build-your-own.org/compiler/)
- [**Racket**: *Beautiful Racket: How to make your own programming languages with Racket*](https://beautifulracket.com/)
- [**Ruby**: *A Compiler From Scratch*](https://www.destroyallsoftware.com/screencasts/catalog/a-compiler-from-scratch)
- [**Ruby**: *Markdown compiler from scratch in Ruby*](https://blog.beezwax.net/2017/07/07/writing-a-markdown-compiler/)
- [**Rust**: *Learning Parser Combinators With Rust*](https://bodil.lol/parser-combinators/)
- [**Swift**: *Building a LISP from scratch with Swift*](https://www.uraimo.com/2017/02/05/building-a-lisp-from-scratch-with-swift/)
- [**TypeScript**: *Build your own WebAssembly Compiler*](https://blog.scottlogic.com/2019/05/17/webassembly-compiler.html)
- [**C**: *A Regular Expression Matcher*](https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html)
- [**C**: *Regular Expression Matching Can Be Simple And Fast*](https://swtch.com/~rsc/regexp/regexp1.html)
- [**Go**: *How to build a regex engine from scratch*](https://rhaeguard.github.io/posts/regex)
- [**JavaScript**: *Build a Regex Engine in Less than 40 Lines of Code*](https://nickdrane.com/build-your-own-regex/)
- [**JavaScript**: *How to implement regular expressions in functional javascript using derivatives*](http://dpk.io/dregs/toydregs)
- [**JavaScript**: *Implementing a Regular Expression Engine*](https://deniskyashif.com/2019/02/17/implementing-a-regular-expression-engine/)
- [**Perl**: *How Regexes Work*](https://perl.plover.com/Regex/article.html)
- [**Python**: *Build Your Own Regular Expression Engines: Backtracking, NFA, DFA*](https://build-your-own.org/b2a/r0_intro)
- [**Scala**: *No Magic: Regular Expressions*](https://rcoh.svbtle.com/no-magic-regular-expressions)
- [**CSS**: *A search engine in CSS*](https://stories.algolia.com/a-search-engine-in-css-b5ec4e902e97)
- [**Python**: *Building a search engine using Redis and redis-py*](http://www.dr-josiah.com/2010/07/building-search-engine-using-redis-and.html)
- [**Python**: *Building a Vector Space Indexing Engine in Python*](https://boyter.org/2010/08/build-vector-space-search-engine-python/)
- [**Python**: *Building A Python-Based Search Engine*](https://www.youtube.com/watch?v=cY7pE7vX6MU) \[video\]
- [**Python**: *Making text search learn from feedback*](https://medium.com/filament-ai/making-text-search-learn-from-feedback-4fe210fd87b0)
- [**Python**: *Finding Important Words in Text Using TF-IDF*](https://stevenloria.com/tf-idf/)
- [**C**: *Tutorial - Write a Shell in C*](https://brennan.io/2015/01/16/write-a-shell-in-c/)
- [**C**: *Let's build a shell!*](https://github.com/kamalmarhubi/shell-workshop)
- [**C**: *Writing a UNIX Shell*](https://indradhanush.github.io/blog/writing-a-unix-shell-part-1/)
- [**C**: *Build Your Own Shell*](https://github.com/tokenrove/build-your-own-shell)
- [**C**: Write a shell in C](https://danishpraka.sh/posts/write-a-shell/)
- [**Go**: *Writing a simple shell in Go*](https://sj14.gitlab.io/post/2018-07-01-go-unix-shell/)
- [**Rust**: *Build Your Own Shell using Rust*](https://www.joshmcguigan.com/blog/build-your-own-shell-rust/)
- [**JavaScript**: *JavaScript template engine in just 20 lines*](http://krasimirtsonev.com/blog/article/Javascript-template-engine-in-just-20-line)
- [**JavaScript**: *Understanding JavaScript Micro-Templating*](https://medium.com/wdstack/understanding-javascript-micro-templating-f37a37b3b40e)
- [**Python**: *Approach: Building a toy template engine in Python*](http://alexmic.net/building-a-template-engine/)
- [**Python**: *A Template Engine*](http://aosabook.org/en/500L/a-template-engine.html)
- [**Ruby**: *How to write a template engine in less than 30 lines of code*](http://bits.citrusbyte.com/how-to-write-a-template-library/)
- [**C**: *Build Your Own Text Editor*](https://viewsourcecode.org/snaptoken/kilo/)
- [**C++**: *Designing a Simple Text Editor*](http://www.fltk.org/doc-1.1/editor.html)
- [**Python**: *Python Tutorial: Make Your Own Text Editor*](https://www.youtube.com/watch?v=xqDonHEYPgA) \[video\]
- [**Python**: *Create a Simple Python Text Editor!*](http://www.instructables.com/id/Create-a-Simple-Python-Text-Editor/)
- [**Ruby**: *Build a Collaborative Text Editor Using Rails*](https://blog.aha.io/text-editor/)
- [**Rust**: *Hecto: Build your own text editor in Rust*](https://www.flenker.blog/hecto/)
- [**Python**: *Developing a License Plate Recognition System with Machine Learning in Python*](https://medium.com/devcenter/developing-a-license-plate-recognition-system-with-machine-learning-in-python-787833569ccd)
- [**Python**: *Building a Facial Recognition Pipeline with Deep Learning in Tensorflow*](https://hackernoon.com/building-a-facial-recognition-pipeline-with-deep-learning-in-tensorflow-66e7645015b8)
- [**C++**: *Let's Make a Voxel Engine*](https://sites.google.com/site/letsmakeavoxelengine/home)
- [**Rust**: *Let's build a browser engine*](https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html)
- [**Python**: *Browser Engineering*](https://browser.engineering/)
- [**C#**: *Writing a Web Server from Scratch*](https://www.codeproject.com/Articles/859108/Writing-a-Web-Server-from-Scratch)
- [**Node.js**: *Build Your Own Web Server From Scratch In JavaScript*](https://build-your-own.org/webserver/)
- [**Node.js**: *Let's code a web server from scratch with NodeJS Streams*](https://www.codementor.io/@ziad-saab/let-s-code-a-web-server-from-scratch-with-nodejs-streams-h4uc9utji)
- [**Node.js**: *lets-build-express*](https://github.com/antoaravinth/lets-build-express)
- [**PHP**: *Writing a webserver in pure PHP*](http://station.clancats.com/writing-a-webserver-in-pure-php/)
- [**Python**: *A Simple Web Server*](http://aosabook.org/en/500L/a-simple-web-server.html)
- [**Python**: *Let’s Build A Web Server.*](https://ruslanspivak.com/lsbaws-part1/)
- [**Python**: *Web application from scratch*](https://defn.io/2018/02/25/web-app-from-scratch-01/)
- [**Python**: *Building a basic HTTP Server from scratch in Python*](http://joaoventura.net/blog/2017/python-webserver/)
- [**Python**: *Implementing a RESTful Web API with Python & Flask*](http://blog.luisrei.com/articles/flaskrest.html)
- [**Ruby**: *Building a simple websockets server from scratch in Ruby*](http://blog.honeybadger.io/building-a-simple-websockets-server-from-scratch-in-ruby/)
#### Uncategorized
- [**(any)**: *From NAND to Tetris: Building a Modern Computer From First Principles*](http://nand2tetris.org/)
- [**(any)**: build-your-own-x-vibe-coding: BYOX-style tutorials adapted for vibe coding](https://github.com/inFaaa/build-your-own-x-vibe-coding)
- [**Alloy**: *The Same-Origin Policy*](http://aosabook.org/en/500L/the-same-origin-policy.html)
- [**C**: *How to Write a Video Player in Less Than 1000 Lines*](http://dranger.com/ffmpeg/ffmpeg.html)
- [**C**: *Learn how to write a hash table in C*](https://github.com/jamesroutley/write-a-hash-table)
- [**C**: *The very basics of a terminal emulator*](https://www.uninformativ.de/blog/postings/2018-02-24/0/POSTING-en.html)
- [**C**: *Write a System Call*](https://brennan.io/2016/11/14/kernel-dev-ep3/)
- [**C**: *Sol - An MQTT broker from scratch*](https://codepr.github.io/posts/sol-mqtt-broker)
- [**C++**: *Build your own VR headset for $200*](https://github.com/relativty/Relativ)
- [**C++**: *How X Window Managers work and how to write one*](https://seasonofcode.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i.html)
- [**C++**: *Writing a Linux Debugger*](https://blog.tartanllama.xyz/writing-a-linux-debugger-setup/)
- [**C++**: *How a 64k intro is made*](http://www.lofibucket.com/articles/64k_intro.html)
- [**C++**: *Make your own Game Engine*](https://www.youtube.com/playlist?list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT)
- [**C#**: *C# Networking: Create a TCP chater server, TCP games, UDP Pong and more*](https://16bpp.net/tutorials/csharp-networking)
- [**C#**: *Loading and rendering 3D skeletal animations from scratch in C# and GLSL*](https://www.seanjoflynn.com/research/skeletal-animation.html)
- [**Clojure**: *Building a spell-checker*](https://bernhardwenzel.com/articles/clojure-spellchecker/)
- [**Go**: *Build A Simple Terminal Emulator In 100 Lines of Golang*](https://ishuah.com/2021/03/10/build-a-terminal-emulator-in-100-lines-of-go/)
- [**Go**: *Let's Create a Simple Load Balancer*](https://kasvith.me/posts/lets-create-a-simple-lb-go/)
- [**Go**: *Video Encoding from Scratch*](https://github.com/kevmo314/codec-from-scratch)
- [**Java**: *How to Build an Android Reddit App*](https://www.youtube.com/playlist?list=PLgCYzUzKIBE9HUJU-upNvl3TRVAo9W47y) \[video\]
- [**JavaScript**: *Build Your Own Module Bundler - Minipack*](https://github.com/ronami/minipack)
- [**JavaScript**: *Learn JavaScript Promises by Building a Promise from Scratch*](https://levelup.gitconnected.com/understand-javascript-promises-by-building-a-promise-from-scratch-84c0fd855720)
- [**JavaScript**: *Implementing promises from scratch (TDD way)*](https://www.mauriciopoppe.com/notes/computer-science/computation/promises/)
- [**JavaScript**: *Implement your own — call(), apply() and bind() method in JavaScript*](https://blog.usejournal.com/implement-your-own-call-apply-and-bind-method-in-javascript-42cc85dba1b)
- [**JavaScript**: *JavaScript Algorithms and Data Structures*](https://github.com/trekhleb/javascript-algorithms)
- [**JavaScript**: *Build a ride hailing app with React Native*](https://pusher.com/tutorials/ride-hailing-react-native)
- [**JavaScript**: *Build Your Own AdBlocker in (Literally) 10 Minutes*](https://levelup.gitconnected.com/building-your-own-adblocker-in-literally-10-minutes-1eec093b04cd)
- [**Kotlin**: *Build Your Own Cache*](https://github.com/kezhenxu94/cache-lite)
- [**Lua**: *Building a CDN from Scratch to Learn about CDN*](https://github.com/leandromoreira/cdn-up-and-running)
- [**Nim**: *Writing a Redis Protocol Parser*](https://xmonader.github.io/nimdays/day12_resp.html)
- [**Nim**: *Writing a Build system*](https://xmonader.github.io/nimdays/day11_buildsystem.html)
- [**Nim**: *Writing a MiniTest Framework*](https://xmonader.github.io/nimdays/day08_minitest.html)
- [**Nim**: *Writing a DMIDecode Parser*](https://xmonader.github.io/nimdays/day01_dmidecode.html)
- [**Nim**: *Writing a INI Parser*](https://xmonader.github.io/nimdays/day05_iniparser.html)
- [**Nim**: *Writing a Link Checker*](https://xmonader.github.io/nimdays/day04_asynclinkschecker.html)
- [**Nim**: *Writing a URL Shortening Service*](https://xmonader.github.io/nimdays/day07_shorturl.html)
- [**Node.js**: *Build a static site generator in 40 lines with Node.js*](https://www.webdevdrops.com/en/build-static-site-generator-nodejs-8969ebe34b22/)
- [**Node.js**: *Building A Simple Single Sign On(SSO) Server And Solution From Scratch In Node.js.*](https://codeburst.io/building-a-simple-single-sign-on-sso-server-and-solution-from-scratch-in-node-js-ea6ee5fdf340)
- [**Node.js**: *How to create a real-world Node CLI app with Node*](https://medium.freecodecamp.org/how-to-create-a-real-world-node-cli-app-with-node-391b727bbed3)
- [**Node.js**: *Build a DNS Server in Node.js*](https://engineerhead.github.io/dns-server/)
- [**Node.js**: *Build a Synchronization Engine with Node.js and Y.js*](https://greenvitriol.com/posts/sync-engine-for-everyone)
- [**PHP**: *Write your own MVC from scratch in PHP*](https://chaitya62.github.io/2018/04/29/Writing-your-own-MVC-from-Scratch-in-PHP.html)
- [**PHP**: *Make your own blog*](https://ilovephp.jondh.me.uk/en/tutorial/make-your-own-blog)
- [**PHP**: *Modern PHP Without a Framework*](https://kevinsmith.io/modern-php-without-a-framework)
- [**PHP**: *Code a Web Search Engine in PHP*](https://boyter.org/2013/01/code-for-a-search-engine-in-php-part-1/)
- [**Python**: *Build a Deep Learning Library*](https://www.youtube.com/watch?v=o64FV-ez6Gw) \[video\]
- [**Python**: *How to Build a Kick-Ass Mobile Document Scanner in Just 5 Minutes*](https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/)
- [**Python**: *Continuous Integration System*](http://aosabook.org/en/500L/a-continuous-integration-system.html)
- [**Python**: *Recommender Systems in Python: Beginner Tutorial*](https://www.datacamp.com/community/tutorials/recommender-systems-python)
- [**Python**: *Write SMS-spam detector with Scikit-learn*](https://medium.com/@kopilov.vlad/detect-sms-spam-in-kaggle-with-scikit-learn-5f6afa7a3ca2)
- [**Python**: *A Simple Content-Based Recommendation Engine in Python*](http://blog.untrod.com/2016/06/simple-similar-products-recommendation-engine-in-python.html)
- [**Python**: *Stock Market Predictions with LSTM in Python*](https://www.datacamp.com/community/tutorials/lstm-python-stock-market)
- [**Python**: *Building a simple Generative Adversarial Network (GAN) using Tensorflow*](https://blog.paperspace.com/implementing-gans-in-tensorflow/)
- [**Python**: *Learn ML Algorithms by coding: Decision Trees*](https://lethalbrains.com/learn-ml-algorithms-by-coding-decision-trees-439ac503c9a4)
- [**Python**: *JSON Decoding Algorithm*](https://github.com/cheery/json-algorithm)
- [**Python**: *Build your own Git plugin with python*](https://joshburns-xyz.vercel.app/posts/build-your-own-git-plugin)
- [**Ruby**: *A Pedometer in the Real World*](http://aosabook.org/en/500L/a-pedometer-in-the-real-world.html)
- [**Ruby**: *Creating a Linux Desktop application with Ruby*](https://iridakos.com/tutorials/2018/01/25/creating-a-gtk-todo-application-with-ruby)
- [**Rust**: *Building a DNS server in Rust*](https://github.com/EmilHernvall/dnsguide/blob/master/README.md)
- [**Rust**: *Writing Scalable Chat Service from Scratch*](https://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html)
- [**Rust**: *WebGL + Rust: Basic Water Tutorial*](https://www.chinedufn.com/3d-webgl-basic-water-tutorial/)
- [**TypeScript**: *Tiny Package Manager: Learns how npm or Yarn works*](https://github.com/g-plane/tiny-package-manager)
## Contribute
- Submissions welcome, just send a PR, or [create an issue](https://github.com/codecrafters-io/build-your-own-x/issues/new)
- Help us review [pending submissions](https://github.com/codecrafters-io/build-your-own-x/issues) by leaving comments and "reactions"
This repository is the work of [many contributors](https://github.com/codecrafters-io/build-your-own-x/graphs/contributors). It was started by [Daniel Stefanovic](https://github.com/danistefanovic), and is now maintained by [CodeCrafters, Inc.](https://codecrafters.io/) To the extent possible under law, [CodeCrafters, Inc.](https://codecrafters.io/) has waived all copyright and related or neighboring rights to this work.
## Releases
No releases published
## Packages
No packages published
## Languages
- [Markdown 100.0%](https://github.com/codecrafters-io/build-your-own-x/search?l=markdown)
@@ -0,0 +1,144 @@
---
title: "epiral/weixin-bot: WeChat iLink Bot SDK for Node.js and Python — zero-config agent integration"
source: "https://github.com/epiral/weixin-bot/blob/main/README.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "WeChat iLink Bot SDK for Node.js and Python — zero-config agent integration - epiral/weixin-bot"
tags:
- "clippings"
---
## weixin-bot
微信 iLink Bot SDK — 让任何 Agent 5 分钟接入微信消息。
## 特性
- 扫码登录,凭证自动保存
- 长轮询收消息,HTTP 发消息
- context\_token 自动管理,开发者无需关心
- Typing 状态("对方正在输入中")
- Session 过期自动重登录
- 零配置,零 Webhook,纯本地运行
## 快速开始
### Node.js
```
npm install @pinixai/weixin-bot
```
```
import { WeixinBot } from '@pinixai/weixin-bot'
const bot = new WeixinBot()
await bot.login()
bot.onMessage(async (msg) => {
await bot.sendTyping(msg.userId)
await bot.reply(msg, \`Echo: ${msg.text}\`)
})
await bot.run()
```
### Python
```
pip install weixin-bot-sdk
```
```
from weixin_bot import WeixinBot
bot = WeixinBot()
bot.login()
@bot.on_message
async def handle(msg):
await bot.send_typing(msg.user_id)
await bot.reply(msg, f"Echo: {msg.text}")
bot.run()
```
## 工作原理
```
sequenceDiagram
participant Agent as 你的 Agent
participant SDK as weixin-bot SDK
participant API as iLink Bot API
participant User as 微信用户
Note over Agent,User: 1. 登录
Agent->>SDK: bot.login()
SDK->>API: GET /get_bot_qrcode?bot_type=3
API-->>SDK: 二维码 URL
SDK-->>Agent: 终端显示二维码
User->>API: 微信扫码确认
API-->>SDK: bot_token + baseurl
SDK-->>Agent: 登录成功,凭证已保存
Note over Agent,User: 2. 收发消息循环
Agent->>SDK: bot.run()
loop 长轮询
SDK->>API: POST /getupdates (hold ≤35s)
User->>API: 发消息 "你好"
API-->>SDK: 消息 + context_token
SDK-->>Agent: onMessage(msg)
Agent->>SDK: bot.sendTyping(userId)
SDK->>API: POST /sendtyping
Note over User: 显示"对方正在输入中"
Agent->>SDK: bot.reply(msg, "Echo: 你好")
SDK->>API: POST /sendmessage (带 context_token)
API-->>User: 推送回复
SDK->>API: POST /sendtyping (取消)
end
```
## API
| 方法 | 说明 |
| --- | --- |
| `login(force?)` | 扫码登录,已有凭证则自动跳过 |
| `onMessage(handler)` | 注册消息处理回调 |
| `reply(msg, text)` | 回复消息(自动取消 typing) |
| `send(userId, text)` | 主动发消息(需已有 context\_token) |
| `sendTyping(userId)` | 显示"对方正在输入中" |
| `stopTyping(userId)` | 取消输入状态 |
| `run()` | 启动长轮询循环 |
| `stop()` | 停止 |
## 协议文档
完整的微信 iLink Bot API 协议分析见 [docs/protocol-spec.md](https://github.com/epiral/weixin-bot/blob/main/docs/protocol-spec.md) (1200+ 行,含 curl 示例和 mermaid 时序图)。
## 关键协议发现
| 发现 | 结论 |
| --- | --- |
| `context_token` | 回复时必须原样传回,否则消息无法投递。SDK 内部自动管理 |
| `message_state: GENERATING` | API 层面可用,但微信客户端不渲染气泡更新。不建议使用 |
| `sendtyping` | 唯一能触发"对方正在输入中"的方式 |
| Session 过期 (`errcode: -14`) | 需要重新扫码登录。SDK 自动处理 |
## 示例
- [Node.js Echo Bot](https://github.com/epiral/weixin-bot/blob/main/examples/nodejs/echo-bot.ts) — 完整示例,含日志和 typing
- [Node.js 流式测试](https://github.com/epiral/weixin-bot/blob/main/examples/nodejs/stream-test.ts) — GENERATING vs FINISH 测试
- [Node.js Typing 测试](https://github.com/epiral/weixin-bot/blob/main/examples/nodejs/generating-test.ts) — sendtyping vs GENERATING 对比
## 包
| 包 | 安装 | 状态 |
| --- | --- | --- |
| [@pinixai/weixin-bot](https://github.com/epiral/weixin-bot/blob/main/nodejs) | `npm install @pinixai/weixin-bot` | |
| [weixin-bot-sdk](https://github.com/epiral/weixin-bot/blob/main/python) | `pip install weixin-bot-sdk` | |
## License
MIT
@@ -0,0 +1,350 @@
---
title: "fastclaw-ai/weclaw: Connect to any agents with WeChat ClawBot."
source: "https://github.com/fastclaw-ai/weclaw/blob/main/README_CN.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "Connect to any agents with WeChat ClawBot. Contribute to fastclaw-ai/weclaw development by creating an account on GitHub."
tags:
- "clippings"
---
## WeClaw
[English](https://github.com/fastclaw-ai/weclaw/blob/main/README.md)
微信 AI Agent 桥接器 — 将微信消息接入 AI Agent(Claude、Codex、Gemini、Kimi 等)。
> 本项目参考 [@tencent-weixin/openclaw-weixin](https://npmx.dev/package/@tencent-weixin/openclaw-weixin) 实现,仅限个人学习,勿做他用。
| | | |
| --- | --- | --- |
| [![](https://github.com/fastclaw-ai/weclaw/raw/main/previews/preview1.png)](https://github.com/fastclaw-ai/weclaw/blob/main/previews/preview1.png) | [![](https://github.com/fastclaw-ai/weclaw/raw/main/previews/preview2.png)](https://github.com/fastclaw-ai/weclaw/blob/main/previews/preview2.png) | [![](https://github.com/fastclaw-ai/weclaw/raw/main/previews/preview3.png)](https://github.com/fastclaw-ai/weclaw/blob/main/previews/preview3.png) |
## 快速开始
```
# 一键安装
curl -sSL https://raw.githubusercontent.com/fastclaw-ai/weclaw/main/install.sh | sh
# 启动(首次运行会弹出微信扫码登录)
weclaw start
```
就这么简单。首次启动时,WeClaw 会:
1. 显示二维码 — 用微信扫码登录
2. 自动检测已安装的 AI Agent(Claude、Codex、Gemini 等)
3. 保存配置到 `~/.weclaw/config.json`
4. 开始接收和回复微信消息
使用 `weclaw login` 可以添加更多微信账号。
### 其他安装方式
```
# 通过 Go 安装
go install github.com/fastclaw-ai/weclaw@latest
# 通过 Docker
docker run -it -v ~/.weclaw:/root/.weclaw ghcr.io/fastclaw-ai/weclaw start
```
## 架构
[![](https://github.com/fastclaw-ai/weclaw/raw/main/previews/architecture.png)](https://github.com/fastclaw-ai/weclaw/blob/main/previews/architecture.png)
**Agent 接入模式:**
| 模式 | 工作方式 | 支持的 Agent |
| --- | --- | --- |
| ACP | 长驻子进程,通过 stdio JSON-RPC 通信。速度最快,复用进程和会话。 | Claude, Codex, Kimi, Gemini, Cursor, OpenCode, OpenClaw |
| CLI | 每条消息启动一个新进程,支持通过 `--resume` 恢复会话。 | Claude (`claude -p`)、Codex (`codex exec`) |
| HTTP | OpenAI 兼容的 Chat Completions API。 | OpenClaw(HTTP 回退) |
同时存在 ACP 和 CLI 时,自动优先选择 ACP。
## 聊天命令
在微信中发送以下命令:
| 命令 | 说明 |
| --- | --- |
| `你好` | 发送给默认 Agent |
| `/codex 写一个排序函数` | 发送给指定 Agent |
| `/cc 解释一下这段代码` | 通过别名发送 |
| `/claude` | 切换默认 Agent 为 Claude |
| `/cwd /path/to/project` | 切换工作目录 |
| `/new` | 开始新对话(清除会话) |
| `/info` | 查看当前 Agent 信息 |
| `/help` | 查看帮助信息 |
### 快捷别名
| 别名 | Agent |
| --- | --- |
| `/cc` | Claude |
| `/cx` | Codex |
| `/cs` | Cursor |
| `/km` | Kimi |
| `/gm` | Gemini |
| `/ocd` | OpenCode |
| `/oc` | OpenClaw |
也可以在配置文件中为每个 Agent 自定义触发命令:
```
{
"agents": {
"claude": {
"type": "acp",
"aliases": ["ai", "c"]
}
}
}
```
然后 `/ai 你好` 或 `/c 你好` 就会路由到 claude。
切换默认 Agent 会写入配置文件,重启后仍然生效。
## 富媒体消息
WeClaw 支持收发图片、视频、文件和语音消息。
**语音消息:** 在微信中发送语音消息时,WeClaw 会自动使用微信的语音转文字功能,将转写后的文本发送给 AI Agent。重复的语音消息事件会自动去重。
**Agent 回复自动处理:** 当 AI Agent 返回包含图片的 markdown(`![](url)` )时,WeClaw 会自动提取图片 URL,下载文件,上传到微信 CDN(AES-128-ECB 加密),然后作为图片消息发送。
**Markdown 转换:** Agent 的回复会自动从 markdown 转为纯文本再发送 — 代码块去掉围栏、链接只保留文字、加粗斜体标记去除等。
## 主动推送消息
无需等待用户发消息,主动向微信用户推送消息。
**命令行:**
```
# 发送文本
weclaw send --to "user_id@im.wechat" --text "你好,来自 weclaw"
# 发送图片
weclaw send --to "user_id@im.wechat" --media "https://example.com/photo.png"
# 发送文本 + 图片
weclaw send --to "user_id@im.wechat" --text "看看这个" --media "https://example.com/photo.png"
# 发送文件
weclaw send --to "user_id@im.wechat" --media "https://example.com/report.pdf"
```
**HTTP API** ( `weclaw start` 运行时,默认监听 `127.0.0.1:18011` ):
```
# 发送文本
curl -X POST http://127.0.0.1:18011/api/send \
-H "Content-Type: application/json" \
-d '{"to": "user_id@im.wechat", "text": "你好,来自 weclaw"}'
# 发送图片
curl -X POST http://127.0.0.1:18011/api/send \
-H "Content-Type: application/json" \
-d '{"to": "user_id@im.wechat", "media_url": "https://example.com/photo.png"}'
# 发送文本 + 媒体
curl -X POST http://127.0.0.1:18011/api/send \
-H "Content-Type: application/json" \
-d '{"to": "user_id@im.wechat", "text": "看看这个", "media_url": "https://example.com/photo.png"}'
```
支持的媒体类型:图片(png、jpg、gif、webp)、视频(mp4、mov)、文件(pdf、doc、zip 等)。
设置 `WECLAW_API_ADDR` 环境变量可更改监听地址(如 `0.0.0.0:18011` )。
## 配置
配置文件路径: `~/.weclaw/config.json`
```
{
"default_agent": "claude",
"agents": {
"claude": {
"type": "acp",
"command": "/usr/local/bin/claude-agent-acp",
"env": {
"ANTHROPIC_API_KEY": "sk-ant-xxx"
},
"model": "sonnet"
},
"codex": {
"type": "acp",
"command": "/usr/local/bin/codex-acp",
"env": {
"OPENAI_API_KEY": "sk-xxx"
}
},
"openclaw": {
"type": "http",
"endpoint": "https://api.example.com/v1/chat/completions",
"api_key": "sk-xxx",
"model": "openclaw:main"
}
}
}
```
环境变量:
- `WECLAW_DEFAULT_AGENT` — 覆盖默认 Agent
- `OPENCLAW_GATEWAY_URL` — OpenClaw HTTP 回退地址
- `OPENCLAW_GATEWAY_TOKEN` — OpenClaw API Token
自定义 agent cli 环境变量
```
{
"default_agent": "...",
"agents": {
"...": {
...
"env": {
"ENV_NAME": "ENV_VALUE"
}
},
}
}
```
### 权限配置
部分 Agent 默认需要交互式权限确认,在微信场景下无法操作会导致卡住。可通过 `args` 配置跳过:
| Agent | 参数 | 说明 |
| --- | --- | --- |
| Claude (CLI) | `--dangerously-skip-permissions` | 跳过所有工具权限确认 |
| Codex (CLI) | `--skip-git-repo-check` | 允许在非 git 仓库目录运行 |
配置示例:
```
{
"claude": {
"type": "cli",
"command": "/usr/local/bin/claude",
"cwd": "/home/user/my-project",
"args": ["--dangerously-skip-permissions"]
},
"codex": {
"type": "cli",
"command": "/usr/local/bin/codex",
"cwd": "/home/user/my-project",
"args": ["--skip-git-repo-check"]
}
}
```
通过 `cwd` 指定 Agent 的工作目录(workspace)。不设置则默认为 `~/.weclaw/workspace` 。
> **注意:** 这些参数会跳过安全检查,请了解风险后再启用。ACP 模式的 Agent 会自动处理权限,无需配置。
## 后台运行
```
# 启动(默认后台运行)
weclaw start
# 查看状态
weclaw status
# 停止
weclaw stop
# 前台运行(调试用)
weclaw start -f
```
日志输出到 `~/.weclaw/weclaw.log` 。
### 系统服务(开机自启)
**macOS (launchd):**
```
cp service/com.fastclaw.weclaw.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.fastclaw.weclaw.plist
```
**Linux (systemd):**
```
sudo cp service/weclaw.service /etc/systemd/system/
sudo systemctl enable --now weclaw
```
## Docker
```
# 构建
docker build -t weclaw .
# 登录(交互式,扫描二维码)
docker run -it -v ~/.weclaw:/root/.weclaw weclaw login
# 使用 HTTP Agent 启动
docker run -d --name weclaw \
-v ~/.weclaw:/root/.weclaw \
-e OPENCLAW_GATEWAY_URL=https://api.example.com \
-e OPENCLAW_GATEWAY_TOKEN=sk-xxx \
weclaw
# 查看日志
docker logs -f weclaw
```
> 注意:ACP 和 CLI 模式需要容器内有对应的 Agent 二进制文件。 默认镜像只包含 WeClaw 本体。如需使用 ACP/CLI Agent,请挂载二进制文件或构建自定义镜像。 HTTP 模式开箱即用。
## 发版
```
# 打 tag 触发 GitHub Actions 自动构建发版
git tag v0.1.0
git push origin v0.1.0
```
自动构建 `darwin/linux/windows` x `amd64/arm64` 的二进制,创建 GitHub Release 并上传所有产物和校验文件。
## 更新
```
# 更新到最新版本(运行中会自动重启)
weclaw update
# 查看当前版本
weclaw version
```
## 开发
```
# 热重载
make dev
# 编译
go build -o weclaw .
# 运行
./weclaw start
```
## 贡献者
[![](https://camo.githubusercontent.com/8a793edee2e5dcf5f6c8b2910535faa5f0a4c0b985bdea73e09fdf779e154f44/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d66617374636c61772d61692f7765636c6177)](https://github.com/fastclaw-ai/weclaw/graphs/contributors)
## Star 趋势
[![Star History Chart](https://camo.githubusercontent.com/d64d51a85c98515e9d7d098a9b23876263fe239887665f15ede4c56df095224e/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d66617374636c61772d61692f7765636c617726747970653d54696d656c696e65)](https://star-history.com/#fastclaw-ai/weclaw&Timeline)
## 许可证
[MIT](https://github.com/fastclaw-ai/weclaw/blob/main/LICENSE)
@@ -0,0 +1,298 @@
---
title: "labring/tentix: TenTix (10x Efficiency) - An AI native customer service platform with 10x accelerated resolution. Support MCP extension, and AI knowlage base system."
source: "https://github.com/labring/tentix/blob/main/README.zh-CN.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "TenTix (10x Efficiency) - An AI native customer service platform with 10x accelerated resolution. Support MCP extension, and AI knowlage base system. - labring/tentix"
tags:
- "clippings"
---
## Tentix = Ten (10x 效率) Tix (工单系统)
[English](https://github.com/labring/tentix/blob/main/README.md) | [中文](https://github.com/labring/tentix/blob/main/README.zh-CN.md)
基于 AI 的客服平台,提供 10 倍加速的解决方案。
- 🚀 10 倍更快的响应速度
- 🤖 10 倍减少人工干预
- 😊 10 倍提升用户满意度
[![image](https://private-user-images.githubusercontent.com/8912557/450527336-798dbbd3-4b78-4412-bf69-fda27f12d128.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ2OTMzOTEsIm5iZiI6MTc3NDY5MzA5MSwicGF0aCI6Ii84OTEyNTU3LzQ1MDUyNzMzNi03OThkYmJkMy00Yjc4LTQ0MTItYmY2OS1mZGEyN2YxMmQxMjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjhUMTAxODExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDZjYTE4ZTdlN2JkN2FiMzg4NDgyMzU3NWYwNGEwNGZmYTA1MjZiY2FhMmU5MjQyYzUwYzQ0YmQ2YTQ5MDc5MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.leixvWjQE3dcnCIgiuzi7KBlXopimsGKMJkZmZasRng)](https://private-user-images.githubusercontent.com/8912557/450527336-798dbbd3-4b78-4412-bf69-fda27f12d128.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ2OTMzOTEsIm5iZiI6MTc3NDY5MzA5MSwicGF0aCI6Ii84OTEyNTU3LzQ1MDUyNzMzNi03OThkYmJkMy00Yjc4LTQ0MTItYmY2OS1mZGEyN2YxMmQxMjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMjhUMTAxODExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDZjYTE4ZTdlN2JkN2FiMzg4NDgyMzU3NWYwNGEwNGZmYTA1MjZiY2FhMmU5MjQyYzUwYzQ0YmQ2YTQ5MDc5MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.leixvWjQE3dcnCIgiuzi7KBlXopimsGKMJkZmZasRng)
## 🖥 在 Sealos 上体验
在应用市场一键部署,只需配置一个 ai 客服,一个员工,即可体验。
[![](https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg)](https://bja.sealos.run/?openapp=system-template%3FtemplateName%3Dtentix)
## 目录
## 核心架构
```
graph TD
A[工单数据源] --> B[知识库构建模块]
C[通用文档] --> B
D[收藏对话] --> B
B --> E[统一向量知识库<br/>PostgreSQL + pgvector]
E --> F[LangGraph AI Agent]
G[用户消息] --> H[查询提炼模块]
I[工单信息] --> H
H --> J[知识检索模块]
E --> J
J --> F
F --> K[生成回复]
subgraph "知识来源优先级"
L[1. 收藏对话<br/>权重: 1.0]
M[2. 历史工单<br/>权重: 0.8]
N[3. 通用知识<br/>权重: 0.6]
end
```
```
graph TD
A[开始构建] --> B{选择知识类型}
B -->|收藏对话| C[提取收藏的工单/消息]
B -->|历史工单| D[筛选高质量已解决工单]
B -->|通用知识| E[加载文档文件]
C --> F[AI增强处理<br/>生成摘要和检索词]
D --> G[构建工单文档<br/>提取关键对话]
E --> H[文档分块处理]
F --> I[向量化处理]
G --> I
H --> I
I --> J[存储到统一知识库]
J --> K[完成]
```
## 已实现特性
- 客服聊天系统
- AI 能力(LangGraph 工作流:分析 → 生成查询 → 检索 → 生成答复)
- 多渠道通知推送,飞书已支持,其它 IM/表单可按模块化接入
- 🔧 可扩展架构:模块化设计,支持按需扩展
- 统一认证设计:插拔式配置第三方接口,便于对接第三方系统
- 向量后端:支持 PostgreSQL + pgvector 或外部向量服务切换 (FastGPT)
- Agent 模型配置:在后台预留模型/温度/TopP/最大 Token 等参数位
## 部署要求
- Bun ≥ 1.2.16
- PostgreSQL(支持 pgvector 扩展)
- MinIO(或兼容的对象存储)
- OpenAI/FastGPT 等 AI 服务凭证
## 部署
### 1\. 通过 Dockerfile 构建镜像
```
docker build -t tentix:latest .
```
### 2\. 配置 PostgreSQL 完成数据库同步
> 说明:迁移脚本会读取项目根目录的 `.env.local` ,需要配置 DATABASE\_URL。
```
cd server
bun run migrate
```
### 3\. 配置应用必须的环境变量
- 必需(必须配置):
```
DATABASE_URL="postgres://USER:PASSWORD@HOST:PORT/DB"
# 生成 Base64 加密密钥(在 server 目录执行)
# cd server && bun run script/getCryptoKey.ts
ENCRYPTION_KEY="<上一步生成的Base64密钥>"
# 存储对话中的图片等多媒体
MINIO_ACCESS_KEY="<minio-access-key>"
MINIO_SECRET_KEY="<minio-secret-key>"
MINIO_BUCKET="<bucket-name>"
MINIO_ENDPOINT="<http(s)://host:port>" # 例如:http://minio:9000
```
- AI 相关(按需配置):
```
OPENAI_BASE_URL="<https://api.openai.com/v1>"
OPENAI_API_KEY="<openai-api-key>"
SUMMARY_MODEL="<用于摘要的模型名>"
EMBEDDING_MODEL="<用于向量化的模型名>"
CHAT_MODEL="<用于对话的模型名>"
MAX_AI_RESPONSES_PER_TICKET=3 # 单工单 AI 回复次数上限,默认 3
```
- 可选(飞书群聊与员工推送):
```
FEISHU_APP_ID="<feishu-app-id>"
FEISHU_APP_SECRET="<feishu-app-secret>"
FEISHU_CHAT_ID="<feishu-chat-id>"
APP_URL="<对外可访问的应用地址>"
```
### 5\. 运行容器
```
docker run -d \
--name tentix \
-p 3000:3000 \
--env-file ./.env.local \
tentix:latest
```
- 健康检查: `/health`
- 默认端口: `3000`
## 开发指南
> 开发帮助:可参阅 [DEVELOPMENT\_GUIDE.md](https://github.com/labring/tentix/blob/main/DEVELOPMENT_GUIDE.md) · [server/README.md](https://github.com/labring/tentix/blob/main/server/README.md) · [frontend/README.md](https://github.com/labring/tentix/blob/main/frontend/README.md)
按以下步骤快速启动本地开发环境。
### 克隆与安装
```
git clone https://github.com/labring/tentix.git
cd tentix
bun install
```
### 配置数据库与迁移
> 说明:迁移脚本会读取项目根目录的 `.env.local` ,需要先配置 `DATABASE_URL` 。
你可以在 [Sealos 控制台](https://bja.sealos.run/) 启用一个 PostgreSQL 数据库,Sealos 提供便捷的数据库创建与自带管理工具。
```
# 在项目根目录创建/编辑 .env.local,至少包含:
echo 'DATABASE_URL="postgres://USER:PASSWORD@HOST:PORT/DB"' >> .env.local
# 进入 server 并执行迁移
cd server
bun run migrate
```
完成数据库同步。
### 配置环境变量
```
cp .env.template .env.local
# 按需补全/覆盖 .env.local 中的变量(如 ENCRYPTION_KEY、MINIO_*、OPENAI_* 等)
```
> 提示:如需生成 `ENCRYPTION_KEY` ,在 `server` 下执行 `bun run script/getCryptoKey.ts` ,将结果填写到 `.env.local` 。
### 启动开发环境
```
cd .. # 回到项目根目录(若当前在 server 下)
bun run dev
```
### 常用命令
```
bun run lint
bun run typecheck
bun run format
bun run build
# Dry run build for testing and check build errors
bun run build --dry
# Force build
bun run build --force
```
## 路线图
以下为优先级排序的功能规划,覆盖 Admin 与 客服端 数据面板:
- Admin 功能
- 人员管理面板:修改角色(含客服),管理账号与绑定(Sealos/飞书)
- 知识库索引:新增“通用文档”和“历史工单”的索引能力
- 历史工单索引:支持定时任务(如每 7/14 天)
- 通用文档:上传、解析与结构化抽取,形成统一知识条目
- 知识库命中测试:无需新建工单即可测试检索命中与答复质量
- 知识库图形面板:收藏对话/通用文档/历史工单的索引查看与可视化
- 知识图谱可视化:知识条目、关系与权重的图形化展示
- 提示词定制化:Agent 工作流提示词可视化配置与 A/B 实验
- 工作流编排:将当前固定工作流演进为可编排机器人模式
- 数据分析面板
- 工单分布:按种类的饼图、反馈工单占比(饼图)
- 知识库命中率:趋势与分布
- 工单数量:按时间分布(折线图)
- 工单反馈数据:按时间(折线)与星级占比(饼图)
- 转人工数据:转人工/未转人工/总量对比
- 客服端面板与功能
- 知识库命中测试入口
- 索引管理与可视化查看
- 个人工单指标:
- 分派给自己/参与的/与自己有关的工单量(支持过滤:转人工/未转人工/全部)
- 按模块分布的统计与趋势
Todo 列表(摘要):
- Admin:人员管理与账号绑定(Sealos/飞书)
- Admin:通用文档与历史工单索引(含定时任务)
- Admin:知识库命中测试与图形面板
- Admin:提示词定制化与工作流编排
- 分析:工单分布、命中率、数量与反馈趋势
- 客服端:命中测试与索引可视化;个人指标看板
## 🤝 参与贡献
### 提交代码
1. Fork 本项目到你的 GitHub 账号
2. 创建功能分支: `git checkout -b feature/your-feature`
3. 提交变更: `git commit -m 'feat: your change'`
4. 推送分支: `git push origin feature/your-feature`
5. 发起 Pull Request(PR)
### 提交信息规范
采用 [Conventional Commits](https://www.conventionalcommits.org/) 规范:
```
feat: add new feature
fix: fix bug
docs: update documentation
style: format code
refactor: refactor code
test: add tests
chore: update dependencies
```
### 代码评审
所有代码变更需要通过 Pull Request 进行评审:
- 确保所有测试通过
- 遵循项目的代码规范
- 补充必要的文档与注释
- 更新相关测试用例
## 🆘 支持
如遇到问题或有疑问:
1. 先在 [Issues](https://github.com/labring/tentix/issues) 中搜索是否已有类似问题
2. 新建 Issue 详细描述你的问题
3. 联系项目维护者
---
**祝编码愉快!🎉**
+281
View File
@@ -0,0 +1,281 @@
---
title: "larksuite/cli"
source: "https://github.com/larksuite/cli/blob/main/README.zh.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "Contribute to larksuite/cli development by creating an account on GitHub."
tags:
- "clippings"
---
## lark-cli
[中文版](https://github.com/larksuite/cli/blob/main/README.zh.md) | [English](https://github.com/larksuite/cli/blob/main/README.md)
飞书/Lark 开放平台命令行工具 — 让人类和 AI Agent 都能在终端中操作飞书。覆盖消息、文档、多维表格、电子表格、日历、邮箱、任务、会议等核心业务域,提供 200+ 命令及 19 个 AI Agent [Skills](https://github.com/larksuite/cli/blob/main/skills) 。
[安装](https://github.com/larksuite/cli/blob/main/README.zh.md#%E5%AE%89%E8%A3%85%E4%B8%8E%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B) · [AI Agent Skills](https://github.com/larksuite/cli/blob/main/README.zh.md#agent-skills) · [认证](https://github.com/larksuite/cli/blob/main/README.zh.md#%E8%AE%A4%E8%AF%81) · [命令](https://github.com/larksuite/cli/blob/main/README.zh.md#%E4%B8%89%E5%B1%82%E5%91%BD%E4%BB%A4%E8%B0%83%E7%94%A8) · [进阶用法](https://github.com/larksuite/cli/blob/main/README.zh.md#%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95) · [安全](https://github.com/larksuite/cli/blob/main/README.zh.md#%E5%AE%89%E5%85%A8%E4%B8%8E%E9%A3%8E%E9%99%A9%E6%8F%90%E7%A4%BA%E4%BD%BF%E7%94%A8%E5%89%8D%E5%BF%85%E8%AF%BB) · [贡献](https://github.com/larksuite/cli/blob/main/README.zh.md#%E8%B4%A1%E7%8C%AE)
## 为什么选 lark-cli?
- **为 Agent 原生设计** — [Skills](https://github.com/larksuite/cli/blob/main/skills) 开箱即用,适配主流 AI 工具,Agent 无需额外适配即可操作飞书
- **覆盖面广** — 11 大业务域、200+ 精选命令、 19 个 AI Agent [Skills](https://github.com/larksuite/cli/blob/main/skills)
- **AI 友好调优** — 每条命令经过 Agent 实测验证,提供更友好的参数、智能默认值和结构化输出,大幅提升 Agent 调用成功率
- **开源零门槛** — MIT 协议,开箱即用, `npm install` 即可使用
- **三分钟上手** — 一键创建应用、交互式登录授权,从安装到第一次 API 调用只需三步
- **安全可控** — 输入防注入、终端输出净化、OS 原生密钥链存储凭证
- **三层调用架构** — 快捷命令(人机友好)→ API 命令(平台同步)→ 通用调用(全 API 覆盖),按需选择粒度
## 功能
| 类别 | 能力 |
| --- | --- |
| 📅 日历 | 查看日程、创建日程、邀请参会人、查询忙闲状态、时间建议 |
| 💬 即时通讯 | 发送/回复消息、创建和管理群聊、查看聊天记录与话题、搜索消息、下载媒体文件 |
| 📄 云文档 | 创建、读取、更新文档、搜索文档、读写素材与画板 |
| 📁 云空间 | 上传和下载文件、搜索文档与知识库、管理评论 |
| 📊 多维表格 | 创建和管理多维表格、字段、记录、视图、仪表盘,数据聚合分析 |
| 📈 电子表格 | 创建、读取、写入、追加、查找和导出表格数据 |
| ✅ 任务 | 创建、查询、更新和完成任务;管理任务清单、子任务、评论与提醒 |
| 📚 知识库 | 创建和管理知识空间、节点和文档 |
| 👤 通讯录 | 按姓名/邮箱/手机号搜索用户、获取用户信息 |
| 📧 邮箱 | 浏览、搜索、阅读邮件,发送、回复、转发邮件,管理草稿,监听新邮件 |
| 🎥 视频会议 | 搜索会议记录、查询会议纪要与录制 |
## 安装与快速开始
### 环境要求
开始之前,请确保具备以下条件:
- Node.js( `npm` / `npx` )
- Go `v1.23` + 和 Python 3(仅源码构建需要)
### 快速开始(人类用户)
> **Tip:** 如果你拥有 AI Agent,可以直接把本 README 丢给它,让 AI 帮你完成安装和配置 — 跳转到 [快速开始(AI Agent)](https://github.com/larksuite/cli/blob/main/README.zh.md#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8Bai-agent) 查看。
#### 安装 CLI
以下两种方式 **任选其一** :
**方式一 — 从 npm 安装(推荐):**
```
npm install -g @larksuite/cli
```
**方式二 — 从源码安装:**
需要 Go `v1.23` + 和 Python 3。
```
git clone https://github.com/larksuite/cli.git
cd cli
make install
```
#### 安装 AI Agent Skills
[Skills](https://github.com/larksuite/cli/blob/main/skills) 是结构化的指令文档,使 AI Agent 能够使用本 CLI:
```
# 安装所有 skills 到当前目录
npx skills add larksuite/cli -y
# 安装所有 skills 到全局
npx skills add larksuite/cli -y -g
```
#### 配置与使用
```
# 1. 配置应用凭证(仅需一次,交互式引导完成)
lark-cli config init
# 2. 登录授权(--recommend 自动选择常用权限)
lark-cli auth login --recommend
# 3. 开始使用
lark-cli calendar +agenda
```
### 快速开始(AI Agent)
> 以下步骤面向 AI Agent,部分步骤需要用户在浏览器中配合完成。
```
# 1. 安装 CLI
npm install -g @larksuite/cli
# 2. 安装 Skills(使 AI Agent 能够使用本 CLI)
npx skills add larksuite/cli --all -y
# 3. 配置应用凭证
# 重要:在后台运行此命令,命令会输出一个授权链接,提取该链接并发送给用户,用户在浏览器中完成配置后命令会自动退出。
lark-cli config init --new
# 4. 登录
# 同上,后台运行,提取授权链接发给用户
lark-cli auth login --recommend
# 5. 验证
lark-cli auth status
```
## Agent Skills
| Skill | 说明 |
| --- | --- |
| `lark-shared` | 应用配置、认证登录、身份切换、权限管理、安全规则(所有其他 skill 自动加载) |
| `lark-calendar` | 日历日程、议程查看、忙闲查询、时间建议 |
| `lark-im` | 发送/回复消息、群聊管理、消息搜索、上传下载图片与文件、表情回复 |
| `lark-doc` | 创建、读取、更新、搜索文档(基于 Markdown) |
| `lark-drive` | 上传、下载文件,管理权限与评论 |
| `lark-sheets` | 创建、读取、写入、追加、查找、导出电子表格 |
| `lark-base` | 多维表格、字段、记录、视图、仪表盘、数据聚合分析 |
| `lark-task` | 任务、任务清单、子任务、提醒、成员分配 |
| `lark-mail` | 浏览、搜索、阅读邮件,发送、回复、转发,草稿管理,监听新邮件 |
| `lark-contact` | 按姓名/邮箱/手机号搜索用户,获取用户信息 |
| `lark-wiki` | 知识空间、节点、文档 |
| `lark-event` | 实时事件订阅(WebSocket),支持正则路由与 Agent 友好格式 |
| `lark-vc` | 搜索会议记录、查询会议纪要产物(总结、待办、逐字稿) |
| `lark-whiteboard` | 画板/图表 DSL 渲染 |
| `lark-minutes` | 妙记元数据与 AI 产物(总结、待办、章节) |
| `lark-openapi-explorer` | 从官方文档探索底层 API |
| `lark-skill-maker` | 自定义 skill 创建框架 |
| `lark-workflow-meeting-summary` | 工作流:会议纪要汇总与结构化报告 |
| `lark-workflow-standup-report` | 工作流:日程待办摘要 |
## 认证
| 命令 | 说明 |
| --- | --- |
| `auth login` | OAuth 登录,支持交互式选择或命令行参数指定 scope |
| `auth logout` | 登出并删除已存储的凭证 |
| `auth status` | 查看当前登录状态和已授权的 scope |
| `auth check` | 校验指定 scope(exit 0 = 有权限,1 = 缺失) |
| `auth scopes` | 列出应用的所有可用 scope |
| `auth list` | 列出所有已认证的用户 |
```
# 交互式登录(TUI 引导选择业务域和权限级别)
lark-cli auth login
# 按域筛选
lark-cli auth login --domain calendar,task
# 推荐的自动审批 scopes
lark-cli auth login --recommend
# 精确 scope
lark-cli auth login --scope "calendar:calendar:readonly"
# Agent 模式:立即返回验证 URL,不阻塞
lark-cli auth login --domain calendar --no-wait
# 稍后恢复轮询
lark-cli auth login --device-code <DEVICE_CODE>
# 身份切换:以用户或机器人身份执行命令
lark-cli calendar +agenda --as user
lark-cli im +messages-send --as bot --chat-id "oc_xxx" --text "Hello"
```
## 三层命令调用
CLI 提供三种粒度的调用方式,覆盖从快速操作到完全自定义的全部场景:
### 1\. 快捷命令(Shortcuts)
以 `+` 为前缀,对人类与 AI 友好化封装,内置智能默认值、表格输出和 dry-run 预览。
```
lark-cli calendar +agenda
lark-cli im +messages-send --chat-id "oc_xxx" --text "Hello"
lark-cli docs +create --title "周报" --markdown "# 本周进展\n- 完成了 X 功能"
```
运行 `lark-cli <service> --help` 查看所有快捷命令。
### 2\. API 命令
从飞书 OAPI 元数据自动生成,经过评测与准入筛选,100+ 精选命令与平台端点一一对应。
```
lark-cli calendar calendars list
lark-cli calendar events instance_view --params '{"calendar_id":"primary","start_time":"1700000000","end_time":"1700086400"}'
```
### 3\. 通用 API 调用
直接调用任意飞书开放平台端点,覆盖 2500+ API。
```
lark-cli api GET /open-apis/calendar/v4/calendars
lark-cli api POST /open-apis/im/v1/messages --params '{"receive_id_type":"chat_id"}' --body '{"receive_id":"oc_xxx","msg_type":"text","content":"{\"text\":\"Hello\"}"}'
```
## 进阶用法
### 输出格式
```
--format json # 完整 JSON 响应(默认)
--format pretty # 人性化格式输出
--format table # 易读表格
--format ndjson # 换行分隔 JSON(适合管道处理)
--format csv # 逗号分隔值
```
### 分页
```
--page-all # 自动翻页获取所有数据
--page-limit 5 # 最多获取 5 页
--page-delay 500 # 每页请求间隔 500ms
```
### Dry Run
对可能产生副作用的命令,建议先用 --dry-run 预览请求:
```
lark-cli im +messages-send --chat-id oc_xxx --text "hello" --dry-run
```
### Schema 自省
使用 schema 查看任意 API 方法的参数、请求体、响应结构、支持身份和 scopes:
```
lark-cli schema
lark-cli schema calendar.events.instance_view
lark-cli schema im.messages.delete
```
## 安全与风险提示(使用前必读)
本工具可供 AI Agent 调用以自动化操作飞书/Lark 开放平台,存在模型幻觉、执行不可控、提示词注入等固有风险;授权飞书权限后,AI Agent 将以您的用户身份在授权范围内执行操作,可能导致敏感数据泄露、越权操作等高风险后果,请您谨慎操作和使用。
为降低上述风险,工具已在多个层面启用默认安全保护,但上述风险仍然存在。我们强烈建议不要主动修改任何默认安全配置;一旦放开相关限制,上述风险将显著提高,由此产生的后果需由您自行承担。
我们建议您将对接本工具的飞书机器人作为私人对话助手使用,请勿将其拉入群聊或允许其他用户与其交互,以避免权限被滥用或数据泄露。
请您充分知悉全部使用风险,使用本工具即视为您自愿承担相关所有责任。
## 贡献
欢迎社区贡献!如果你发现 bug 或有功能建议,请提交 [Issue](https://github.com/larksuite/cli/issues) 或 [Pull Request](https://github.com/larksuite/cli/pulls) 。
对于较大的改动,建议先通过 Issue 与我们讨论。
## 许可证
本项目基于 **MIT 许可证** 开源。 该软件运行时会调用 Lark/飞书开放平台的 API,使用这些 API 需要遵守如下协议和隐私政策:
- [飞书用户服务协议](https://www.feishu.cn/terms)
- [飞书隐私政策](https://www.feishu.cn/privacy)
- [飞书开放平台独立软件服务商安全管理运营规范](https://open.feishu.cn/document/uAjLw4CM/uMzNwEjLzcDMx4yM3ATM/management-practice/app-service-provider-security-management-specifications)
- [Lark User Terms of Service](https://www.larksuite.com/user-terms-of-service)
- [Lark Privacy Policy](https://www.larksuite.com/privacy-policy)
@@ -0,0 +1,282 @@
---
title: "ming1523/openclaw-weixin-source: Recovered npm source for @tencent-weixin/openclaw-weixin 1.0.2"
source: "https://github.com/ming1523/openclaw-weixin-source/blob/main/README.zh_CN.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-23
description: "Recovered npm source for @tencent-weixin/openclaw-weixin 1.0.2 - ming1523/openclaw-weixin-source"
tags:
- "clippings"
---
## 微信
[English](https://github.com/ming1523/openclaw-weixin-source/blob/main/README.md)
OpenClaw 的微信渠道插件,支持通过扫码完成登录授权。
## 前提条件
已安装 [OpenClaw](https://docs.openclaw.ai/install) (需要 `openclaw` CLI 可用)。
## 一键安装
```
npx -y @tencent-weixin/openclaw-weixin-cli install
```
## 手动安装
如果一键安装不适用,可以按以下步骤手动操作:
### 1\. 安装插件
```
openclaw plugins install "@tencent-weixin/openclaw-weixin"
```
### 2\. 启用插件
```
openclaw config set plugins.entries.openclaw-weixin.enabled true
```
### 3\. 扫码登录
```
openclaw channels login --channel openclaw-weixin
```
终端会显示一个二维码,用手机扫码并在手机上确认授权。确认后,登录凭证会自动保存到本地,无需额外操作。
### 4\. 重启 gateway
```
openclaw gateway restart
```
## 添加更多微信账号
```
openclaw channels login --channel openclaw-weixin
```
每次扫码登录都会创建一个新的账号条目,支持多个微信号同时在线。
## 多账号上下文隔离
默认情况下,所有渠道的 AI 会话共享同一个上下文。如果希望每个微信账号的对话上下文相互隔离:
```
openclaw config set agents.mode per-channel-per-peer
```
这样每个「微信账号 + 发消息用户」组合都会拥有独立的 AI 记忆,账号之间不会串台。
## 后端 API 协议
本插件通过 HTTP JSON API 与后端网关通信。二次开发者若需对接自有后端,需实现以下接口。
所有接口均为 `POST` ,请求和响应均为 JSON。通用请求头:
| Header | 说明 |
| --- | --- |
| `Content-Type` | `application/json` |
| `AuthorizationType` | 固定值 `ilink_bot_token` |
| `Authorization` | `Bearer <token>` (登录后获取) |
| `X-WECHAT-UIN` | 随机 uint32 的 base64 编码 |
### 接口列表
| 接口 | 路径 | 说明 |
| --- | --- | --- |
| getUpdates | `getupdates` | 长轮询获取新消息 |
| sendMessage | `sendmessage` | 发送消息(文本/图片/视频/文件) |
| getUploadUrl | `getuploadurl` | 获取 CDN 上传预签名 URL |
| getConfig | `getconfig` | 获取账号配置(typing ticket 等) |
| sendTyping | `sendtyping` | 发送/取消输入状态指示 |
### getUpdates
长轮询接口。服务端在有新消息或超时后返回。
**请求体:**
```
{
"get_updates_buf": ""
}
```
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `get_updates_buf` | `string` | 上次响应返回的同步游标,首次请求传空字符串 |
**响应体:**
```
{
"ret": 0,
"msgs": [...],
"get_updates_buf": "<新游标>",
"longpolling_timeout_ms": 35000
}
```
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `ret` | `number` | 返回码, `0` = 成功 |
| `errcode` | `number?` | 错误码(如 `-14` = 会话超时) |
| `errmsg` | `string?` | 错误描述 |
| `msgs` | `WeixinMessage[]` | 消息列表(结构见下方) |
| `get_updates_buf` | `string` | 新的同步游标,下次请求时回传 |
| `longpolling_timeout_ms` | `number?` | 服务端建议的下次长轮询超时(ms) |
### sendMessage
发送一条消息给用户。
**请求体:**
```
{
"msg": {
"to_user_id": "<目标用户 ID>",
"context_token": "<会话上下文令牌>",
"item_list": [
{
"type": 1,
"text_item": { "text": "你好" }
}
]
}
}
```
### getUploadUrl
获取 CDN 上传预签名参数。上传文件前需先调用此接口获取 `upload_param` 和 `thumb_upload_param` 。
**请求体:**
```
{
"filekey": "<文件标识>",
"media_type": 1,
"to_user_id": "<目标用户 ID>",
"rawsize": 12345,
"rawfilemd5": "<明文 MD5>",
"filesize": 12352,
"thumb_rawsize": 1024,
"thumb_rawfilemd5": "<缩略图明文 MD5>",
"thumb_filesize": 1040
}
```
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `media_type` | `number` | `1` = IMAGE, `2` = VIDEO, `3` = FILE |
| `rawsize` | `number` | 原文件明文大小 |
| `rawfilemd5` | `string` | 原文件明文 MD5 |
| `filesize` | `number` | AES-128-ECB 加密后的密文大小 |
| `thumb_rawsize` | `number?` | 缩略图明文大小(IMAGE/VIDEO 时必填) |
| `thumb_rawfilemd5` | `string?` | 缩略图明文 MD5(IMAGE/VIDEO 时必填) |
| `thumb_filesize` | `number?` | 缩略图密文大小(IMAGE/VIDEO 时必填) |
**响应体:**
```
{
"upload_param": "<原图上传加密参数>",
"thumb_upload_param": "<缩略图上传加密参数>"
}
```
### getConfig
获取账号配置,包括 typing ticket。
**请求体:**
```
{
"ilink_user_id": "<用户 ID>",
"context_token": "<可选,会话上下文令牌>"
}
```
**响应体:**
```
{
"ret": 0,
"typing_ticket": "<base64 编码的 typing ticket>"
}
```
### sendTyping
发送或取消输入状态指示。
**请求体:**
```
{
"ilink_user_id": "<用户 ID>",
"typing_ticket": "<从 getConfig 获取>",
"status": 1
}
```
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `status` | `number` | `1` = 正在输入, `2` = 取消输入 |
### 消息结构
#### WeixinMessage
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `seq` | `number?` | 消息序列号 |
| `message_id` | `number?` | 消息唯一 ID |
| `from_user_id` | `string?` | 发送者 ID |
| `to_user_id` | `string?` | 接收者 ID |
| `create_time_ms` | `number?` | 创建时间戳(ms) |
| `session_id` | `string?` | 会话 ID |
| `message_type` | `number?` | `1` = USER, `2` = BOT |
| `message_state` | `number?` | `0` = NEW, `1` = GENERATING, `2` = FINISH |
| `item_list` | `MessageItem[]?` | 消息内容列表 |
| `context_token` | `string?` | 会话上下文令牌,回复时需回传 |
#### MessageItem
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `type` | `number` | `1` TEXT, `2` IMAGE, `3` VOICE, `4` FILE, `5` VIDEO |
| `text_item` | `{ text: string }?` | 文本内容 |
| `image_item` | `ImageItem?` | 图片(含 CDN 引用和 AES 密钥) |
| `voice_item` | `VoiceItem?` | 语音(SILK 编码) |
| `file_item` | `FileItem?` | 文件附件 |
| `video_item` | `VideoItem?` | 视频 |
| `ref_msg` | `RefMessage?` | 引用消息 |
#### CDN 媒体引用 (CDNMedia)
所有媒体类型(图片/语音/文件/视频)通过 CDN 传输,使用 AES-128-ECB 加密:
| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `encrypt_query_param` | `string?` | CDN 下载/上传的加密参数 |
| `aes_key` | `string?` | base64 编码的 AES-128 密钥 |
### CDN 上传流程
1. 计算文件明文大小、MD5,以及 AES-128-ECB 加密后的密文大小
2. 如需缩略图(图片/视频),同样计算缩略图的明文和密文参数
3. 调用 `getUploadUrl` 获取 `upload_param` (和 `thumb_upload_param` )
4. 使用 AES-128-ECB 加密文件内容,PUT 上传到 CDN URL
5. 缩略图同理加密并上传
6. 使用返回的 `encrypt_query_param` 构造 `CDNMedia` 引用,放入 `MessageItem` 发送
> 完整的类型定义见 [`src/api/types.ts`](https://github.com/ming1523/openclaw-weixin-source/blob/main/src/api/types.ts) ,API 调用实现见 [`src/api/api.ts`](https://github.com/ming1523/openclaw-weixin-source/blob/main/src/api/api.ts) 。
@@ -0,0 +1,531 @@
---
title: "mksglu/context-mode: MCP is the protocol for tool access. We're the virtualization layer for context."
source: "https://github.com/mksglu/context-mode"
author:
- "[[github-actions[bot]]]"
published:
created: 2026-03-07
description: "MCP is the protocol for tool access. We're the virtualization layer for context. - mksglu/context-mode"
tags:
- "clippings"
---
You only have a single verified email address. We recommend verifying at least one more email address to ensure you can recover your account if you lose access to your primary email.
[Open in github.dev](https://github.dev/) [Open in a new github.dev tab](https://github.dev/) [Open in codespace](https://github.com/codespaces/new/mksglu/context-mode?resume=1)
<table><thead><tr><th colspan="2"><span>Name</span></th><th colspan="1"><span>Name</span></th><th><p><span>Last commit message</span></p></th><th colspan="1"><p><span>Last commit date</span></p></th></tr></thead><tbody><tr><td colspan="3"><p><span><a href="https://github.com/mksglu/context-mode/commit/1be1e4c0259d5b09ffdf39412babbe85d88ee38b">ci: update install stats</a></span></p><p><span><a href="https://github.com/mksglu/context-mode/commit/1be1e4c0259d5b09ffdf39412babbe85d88ee38b">1be1e4c</a> ·</span></p><p><a href="https://github.com/mksglu/context-mode/commits/main/"><span><span><span>330 Commits</span></span></span></a></p></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/.claude-plugin">.claude-plugin</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/.claude-plugin">.claude-plugin</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/d46c496a590369996b6953c8a6b6bf0f7e11e5fa">chore: bump version to 1.0.14</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/.claude">.claude</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/.claude">.claude</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/1f82ef03962fe48f04ae47a5a636f9fe8a9e4e5f">docs: add security section to README with permission examples</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/.github">.github</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/.github">.github</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/b67a96e435a2b0f65326baa32300472ea8fdbba3">chore: gitignore bundle files, CI uses git add -f</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/configs">configs</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/configs">configs</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/4d2c771ee7569407ccb0177a504b229cff7b0869">feat: ctx_ tool prefix, Bash routing nudge, cross-platform fixes</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/docs">docs</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/docs">docs</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/31f96c0142a3b6f8f000e027eed033a35ef5bcb7">feat: rename repo to context-mode, bump to v1.0.0, fix 6 CRITICALs</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/hooks">hooks</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/hooks">hooks</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/cc5061c3c9a02b34f01645cef3f6b952eac05c25">fix: add "failed" to task DONE filter for complete status coverage</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/skills">skills</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/skills">skills</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/e71df1d119fe326d8ca9ac25df7bb6e22b96ee73">feat: cli.bundle.mjs for marketplace installs + tests + CI workflow</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/src">src</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/src">src</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/d46c496a590369996b6953c8a6b6bf0f7e11e5fa">chore: bump version to 1.0.14</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/tree/main/tests">tests</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/tree/main/tests">tests</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/87c705e0e291694dca4ad7f25be00ba45da491c5">feat: comprehensive session event tracking improvements</a></p></td><td></td></tr><tr><td colspan="2"><p><a href="https://github.com/mksglu/context-mode/blob/main/.gitattributes">.gitattributes</a></p></td><td colspan="1"><p><a href="https://github.com/mksglu/context-mode/blob/main/.gitattributes">.gitattributes</a></p></td><td><p><a href="https://github.com/mksglu/context-mode/commit/44c9c6f2f07eed28e8860d1a45b9a1d4c2ad34c0">chore: add.gitattributes to enforce LF line endings on Windows (</a><a href="https://github.com/mksglu/context-mode/pull/73">#73</a><a href="https://github.com/mksglu/context-mode/commit/44c9c6f2f07eed28e8860d1a45b9a1d4c2ad34c0">)</a></p></td><td></td></tr><tr><td colspan="3"></td></tr></tbody></table>
## Context Mode
**The other half of the context problem.**
## The Problem
Every MCP tool call dumps raw data into your context window. A Playwright snapshot costs 56 KB. Twenty GitHub issues cost 59 KB. One access log — 45 KB. After 30 minutes, 40% of your context is gone. And when the agent compacts the conversation to free space, it forgets which files it was editing, what tasks are in progress, and what you last asked for.
Context Mode is an MCP server that solves both halves of this problem:
1. **Context Saving** — Sandbox tools keep raw data out of the context window. 315 KB becomes 5.4 KB. 98% reduction.
2. **Session Continuity** — Every file edit, git operation, task, error, and user decision is tracked in SQLite. When the conversation compacts, context-mode doesn't dump this data back into context — it indexes events into FTS5 and retrieves only what's relevant via BM25 search. The model picks up exactly where you left off. If you don't `--continue`, previous session data is deleted immediately — a fresh session means a clean slate.
cc-04.mp4<video src="https://private-user-images.githubusercontent.com/6067714/554383990-07013dbf-07c0-4ef1-974a-33ea1207637b.mp4?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzI4OTM1NTgsIm5iZiI6MTc3Mjg5MzI1OCwicGF0aCI6Ii82MDY3NzE0LzU1NDM4Mzk5MC0wNzAxM2RiZi0wN2MwLTRlZjEtOTc0YS0zM2VhMTIwNzYzN2IubXA0P1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMDdUMTQyMDU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjAyODRlNDBlZGIzMDUxMjA1ZGQwOGFkYWQ5ODgxODZjM2U0YTczNWYyYzBmYmY0YTdjN2MxMzdlOGNjMWExNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.1fLfdJ5jqu1sKXv7be3sqU4CMCZvVXuUyINTRzB1JPQ" controls="controls"></video>
## Install
**Claude Code**
**Step 1 — Install the plugin:**
```
/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
```
**Step 2 — Restart Claude Code.**
That's it. The plugin installs everything automatically:
- MCP server with 6 sandbox tools (`ctx_batch_execute`, `ctx_execute`, `ctx_execute_file`, `ctx_index`, `ctx_search`, `ctx_fetch_and_index`)
- PreToolUse hooks that intercept Bash, Read, WebFetch, Grep, and Task calls — nudging them toward sandbox execution
- PostToolUse, PreCompact, and SessionStart hooks for session tracking and context injection
- A `CLAUDE.md` routing instructions file auto-created in your project root
- Slash commands for diagnostics and upgrades (Claude Code only)
| Command | What it does |
| --- | --- |
| `/context-mode:ctx-stats` | Context savings — per-tool breakdown, tokens consumed, savings ratio. |
| `/context-mode:ctx-doctor` | Diagnostics — runtimes, hooks, FTS5, plugin registration, versions. |
| `/context-mode:ctx-upgrade` | Pull latest, rebuild, migrate cache, fix hooks. |
> **Note:** Slash commands are a Claude Code plugin feature. On other platforms, all three utility commands (`ctx stats`, `ctx doctor`, `ctx upgrade`) work as MCP tools — just type the command name and the model will invoke it. See [Utility Commands](https://github.com/mksglu/#utility-commands).
**Alternative — MCP-only install** (no hooks or slash commands):
```
claude mcp add context-mode -- npx -y context-mode
```
This gives you the 6 sandbox tools but without automatic routing. The model can still use them — it just won't be nudged to prefer them over raw Bash/Read/WebFetch. Good for trying it out before committing to the full plugin.
**Gemini CLI** <sup>(Beta)</sup>
**Step 1 — Install globally:**
```
npm install -g context-mode
```
**Step 2 — Register the MCP server.** Add to `~/.gemini/settings.json`:
```
{
"mcpServers": {
"context-mode": {
"command": "context-mode"
}
}
}
```
**Step 3 — Add hooks.** Without hooks, the model can ignore routing instructions and dump raw output into your context window. Hooks intercept every tool call and enforce sandbox routing programmatically — blocking `curl`, `wget`, and other data-heavy commands before they execute. Add to the same `~/.gemini/settings.json`:
```
{
"hooks": {
"BeforeTool": [
{
"matcher": "",
"hooks": [{ "type": "command", "command": "context-mode hook gemini-cli beforetool" }]
}
],
"AfterTool": [
{
"matcher": "",
"hooks": [{ "type": "command", "command": "context-mode hook gemini-cli aftertool" }]
}
],
"SessionStart": [
{
"matcher": "",
"hooks": [{ "type": "command", "command": "context-mode hook gemini-cli sessionstart" }]
}
]
}
}
```
**Step 4 — Restart Gemini CLI.** On first run, a `GEMINI.md` routing instructions file is auto-created in your project root. This works alongside hooks as a parallel enforcement layer — hooks block dangerous commands programmatically, while `GEMINI.md` teaches the model to prefer sandbox tools from the start.
> **Why hooks matter:** Without hooks, context-mode relies on `GEMINI.md` instructions alone (~60% compliance). The model sometimes follows them, but regularly runs raw `curl`, reads large files directly, or dumps unprocessed output into context — a single unrouted Playwright snapshot (56 KB) wipes out an entire session's savings. With hooks, every tool call is intercepted before execution — dangerous commands are blocked, and routing guidance is injected in real-time. This is the difference between ~60% and ~98% context savings.
Full hook config including PreCompress: [`configs/gemini-cli/settings.json`](https://github.com/mksglu/context-mode/blob/main/configs/gemini-cli/settings.json)
**VS Code Copilot** <sup>(Beta)</sup>
**Step 1 — Install globally:**
```
npm install -g context-mode
```
**Step 2 — Register the MCP server.** Create `.vscode/mcp.json` in your project root:
```
{
"servers": {
"context-mode": {
"command": "context-mode"
}
}
}
```
**Step 3 — Add hooks.** Without hooks, the model can bypass routing and dump raw output into your context. Hooks intercept every tool call and enforce sandbox routing programmatically. Create `.github/hooks/context-mode.json`:
```
{
"hooks": {
"PreToolUse": [
{ "type": "command", "command": "context-mode hook vscode-copilot pretooluse" }
],
"PostToolUse": [
{ "type": "command", "command": "context-mode hook vscode-copilot posttooluse" }
],
"SessionStart": [
{ "type": "command", "command": "context-mode hook vscode-copilot sessionstart" }
]
}
}
```
**Step 4 — Restart VS Code.** On first run, a `.github/copilot-instructions.md` routing instructions file is auto-created in your project. This works alongside hooks as a parallel enforcement layer — hooks intercept tool calls programmatically, while `copilot-instructions.md` guides the model's tool selection from session start.
> **Why hooks matter:** Without hooks, `copilot-instructions.md` guides the model but can't block commands. A single unrouted Playwright snapshot (56 KB) or `gh issue list` (59 KB) wipes out minutes of context savings. With hooks, these calls are intercepted and redirected to the sandbox before they execute.
Full hook config including PreCompact: [`configs/vscode-copilot/hooks.json`](https://github.com/mksglu/context-mode/blob/main/configs/vscode-copilot/hooks.json)
**OpenCode** <sup>(Beta)</sup>
**Step 1 — Install globally:**
```
npm install -g context-mode
```
**Step 2 — Register the MCP server and plugin.** OpenCode uses a TypeScript plugin paradigm instead of JSON hooks. Add both the MCP server and the plugin to `opencode.json` in your project root:
```
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"context-mode": {
"type": "local",
"command": ["context-mode"]
}
},
"plugin": ["context-mode"]
}
```
The `mcp` entry gives you the 6 sandbox tools. The `plugin` entry enables hooks — OpenCode calls the plugin's TypeScript functions directly before and after each tool execution, blocking dangerous commands (like raw `curl`) and enforcing sandbox routing.
**Step 3 — Restart OpenCode.** On first run, an `AGENTS.md` routing instructions file is auto-created in your project root. This works alongside the plugin as a parallel enforcement layer — the plugin intercepts tool calls at runtime, while `AGENTS.md` guides the model's tool preferences from session start.
> **Why the plugin matters:** Without the `plugin` entry, context-mode has no way to intercept tool calls. The model can run raw `curl`, read large files directly, or dump unprocessed output into context — ignoring `AGENTS.md` instructions. With the plugin, `tool.execute.before` fires on every tool call and blocks or redirects data-heavy commands before they execute. The `experimental.session.compacting` hook builds and injects resume snapshots when the conversation compacts, preserving session state.
>
> Note: OpenCode's SessionStart hook is not yet available ([#14808](https://github.com/sst/opencode/issues/14808)), so startup/resume session restore is not supported — the `AGENTS.md` file is the primary way context-mode instructions reach the model at session start. Compaction recovery works fully via the plugin.
**Codex CLI** <sup>(Beta)</sup>
**Step 1 — Install globally:**
```
npm install -g context-mode
```
**Step 2 — Register the MCP server.** Add to `~/.codex/config.toml`:
```
[mcp_servers.context-mode]
command = "context-mode"
```
**Step 3 — Restart Codex CLI.** On first run, an `AGENTS.md` routing instructions file is auto-created in your project root. Codex CLI reads `AGENTS.md` automatically and learns to prefer context-mode sandbox tools.
**About hooks:** Codex CLI does not support hooks — PRs [#2904](https://github.com/openai/codex/pull/2904) and [#9796](https://github.com/openai/codex/pull/9796) were closed without merge. The `AGENTS.md` routing instructions file is the only enforcement method (~60% compliance). The model receives the instructions at session start and sometimes follows them, but there is no programmatic interception — it can run raw `curl`, read large files, or bypass sandbox tools at any time.
For stronger enforcement, you can also add the instructions globally:
```
cp ~/.codex/AGENTS.md # auto-created, or copy from node_modules/context-mode/configs/codex/AGENTS.md
```
Global `~/.codex/AGENTS.md` applies to all projects. Project-level `./AGENTS.md` applies to the current project only. If both exist, Codex CLI merges them.
## Tools
| Tool | What it does | Context saved |
| --- | --- | --- |
| `ctx_batch_execute` | Run multiple commands + search multiple queries in ONE call. | 986 KB → 62 KB |
| `ctx_execute` | Run code in 11 languages. Only stdout enters context. | 56 KB → 299 B |
| `ctx_execute_file` | Process files in sandbox. Raw content never leaves. | 45 KB → 155 B |
| `ctx_index` | Chunk markdown into FTS5 with BM25 ranking. | 60 KB → 40 B |
| `ctx_search` | Query indexed content with multiple queries in one call. | On-demand retrieval |
| `ctx_fetch_and_index` | Fetch URL, detect content type (HTML/JSON/text), chunk and index. | 60 KB → 40 B |
| `ctx_stats` | Show context savings, call counts, and session statistics. | — |
| `ctx_doctor` | Diagnose installation: runtimes, hooks, FTS5, versions. | — |
| `ctx_upgrade` | Upgrade to latest version from GitHub, rebuild, reconfigure hooks. | — |
Each `ctx_execute` call spawns an isolated subprocess with its own process boundary. Scripts can't access each other's memory or state. The subprocess runs your code, captures stdout, and only that stdout enters the conversation context. The raw data — log files, API responses, snapshots — never leaves the sandbox.
Eleven language runtimes are available: JavaScript, TypeScript, Python, Shell, Ruby, Go, Rust, PHP, Perl, R, and Elixir. Bun is auto-detected for 3-5x faster JS/TS execution.
Authenticated CLIs work through credential passthrough — `gh`, `aws`, `gcloud`, `kubectl`, `docker` inherit environment variables and config paths without exposing them to the conversation.
When output exceeds 5 KB and an `intent` is provided, Context Mode switches to intent-driven filtering: it indexes the full output into the knowledge base, searches for sections matching your intent, and returns only the relevant matches with a vocabulary of searchable terms for follow-up queries.
The `ctx_index` tool chunks markdown content by headings while keeping code blocks intact, then stores them in a **SQLite FTS5** (Full-Text Search 5) virtual table. Search uses **BM25 ranking** — a probabilistic relevance algorithm that scores documents based on term frequency, inverse document frequency, and document length normalization. **Porter stemming** is applied at index time so "running", "runs", and "ran" match the same stem.
When you call `ctx_search`, it returns relevant content snippets focused around matching query terms — not full documents, not approximations, the actual indexed content with smart extraction around what you're looking for. `ctx_fetch_and_index` extends this to URLs: fetch, convert HTML to markdown, chunk, index. The raw page never enters context.
### Fuzzy Search
Search uses a three-layer fallback to handle typos, partial terms, and substring matches:
- **Layer 1 — Porter stemming**: Standard FTS5 MATCH with porter tokenizer. "caching" matches "cached", "caches", "cach".
- **Layer 2 — Trigram substring**: FTS5 trigram tokenizer matches partial strings. "useEff" finds "useEffect", "authenticat" finds "authentication".
- **Layer 3 — Fuzzy correction**: Levenshtein distance corrects typos before re-searching. "kuberntes" → "kubernetes", "autentication" → "authentication".
### Smart Snippets
Search results use intelligent extraction instead of truncation. Instead of returning the first N characters (which might miss the important part), Context Mode finds where your query terms appear in the content and returns windows around those matches.
### Progressive Throttling
- **Calls 1-3:** Normal results (2 per query)
- **Calls 4-8:** Reduced results (1 per query) + warning
- **Calls 9+:** Blocked — redirects to `ctx_batch_execute`
## Session Continuity
When the context window fills up, the agent compacts the conversation — dropping older messages to make room. Without session tracking, the model forgets which files it was editing, what tasks are in progress, what errors were resolved, and what you last asked for.
Context Mode captures every meaningful event during your session and persists them in a per-project SQLite database. When the conversation compacts (or you resume with `--continue`), your working state is rebuilt automatically — the model continues from your last prompt without asking you to repeat anything.
Session continuity requires 4 hooks working together:
| Hook | Role | Claude Code | Gemini CLI | VS Code Copilot | OpenCode | Codex CLI |
| --- | --- | --- | --- | --- | --- | --- |
| **PostToolUse** | Captures events after each tool call | Yes | Yes | Yes | Plugin | \-- |
| **UserPromptSubmit** | Captures user decisions and corrections | Yes | \-- | \-- | \-- | \-- |
| **PreCompact** | Builds snapshot before compaction | Yes | Yes | Yes | Plugin | \-- |
| **SessionStart** | Restores state after compaction | Yes | Yes | Yes | \-- | \-- |
| | **Session completeness** | **Full** | **High** | **High** | **High** | **\--** |
> **Note:** Full session continuity (capture + snapshot + restore) works on **Claude Code**, **Gemini CLI**, **VS Code Copilot**, and **OpenCode**. OpenCode uses the `experimental.session.compacting` plugin hook for compaction recovery — SessionStart is not yet available ([#14808](https://github.com/sst/opencode/issues/14808)), so startup/resume is not supported. Codex CLI has no hook support, so session tracking is not available.
**What gets captured**
Every tool call passes through hooks that extract structured events:
| Category | Events | Priority | Captured By |
| --- | --- | --- | --- |
| **Files** | read, edit, write, glob, grep | Critical (P1) | PostToolUse |
| **Tasks** | create, update, complete | Critical (P1) | PostToolUse |
| **Rules** | CLAUDE.md / GEMINI.md / AGENTS.md paths + content | Critical (P1) | SessionStart |
| **Decisions** | User corrections, preferences ("use X instead", "don't do Y") | High (P2) | UserPromptSubmit |
| **Git** | checkout, commit, merge, rebase, stash, push, pull, diff, status | High (P2) | PostToolUse |
| **Errors** | Tool failures, non-zero exit codes | High (P2) | PostToolUse |
| **Environment** | cwd changes, venv, nvm, conda, package installs | High (P2) | PostToolUse |
| **MCP Tools** | All `mcp__*` tool calls with usage counts | Normal (P3) | PostToolUse |
| **Subagents** | Agent tool invocations | Normal (P3) | PostToolUse |
| **Skills** | Slash command invocations | Normal (P3) | PostToolUse |
| **Role** | Persona / behavioral directives ("act as senior engineer") | Normal (P3) | UserPromptSubmit |
| **Intent** | Session mode classification (investigate, implement, debug) | Low (P4) | UserPromptSubmit |
| **Data** | Large user-pasted data references (>1 KB) | Low (P4) | UserPromptSubmit |
| **User Prompts** | Every user message (for last-prompt restore) | Critical (P1) | UserPromptSubmit |
**How sessions survive compaction**
```
PreCompact fires
→ Read all session events from SQLite
→ Build priority-tiered XML snapshot (≤2 KB)
→ Store snapshot in session_resume table
SessionStart fires (source: "compact")
→ Retrieve stored snapshot
→ Write structured events file → auto-indexed into FTS5
→ Build Session Guide with 15 categories
→ Inject <session_knowledge> directive into context
→ Model continues from last user prompt with full working state
```
The snapshot is built in priority tiers — if the 2 KB budget is tight, lower-priority events (intent, MCP tool counts) are dropped first while critical state (active files, tasks, rules, decisions) is always preserved.
After compaction, the model receives a **Session Guide** — a structured narrative with actionable sections:
- **Last Request** — user's last prompt, so the model continues without asking "what were we doing?"
- **Tasks** — checkbox format with completion status (`[x]` completed, `[ ]` pending)
- **Key Decisions** — user corrections and preferences ("use X instead", "don't do Y")
- **Files Modified** — all files touched during the session
- **Unresolved Errors** — errors that haven't been fixed
- **Git** — operations performed (checkout, commit, push, status)
- **Project Rules** — CLAUDE.md / GEMINI.md / AGENTS.md paths
- **MCP Tools Used** — tool names with call counts
- **Subagent Tasks** — delegated work summaries
- **Skills Used** — slash commands invoked
- **Environment** — working directory, env variables
- **Data References** — large data pasted during the session
- **Session Intent** — mode classification (implement, investigate, review, discuss)
- **User Role** — behavioral directives set during the session
Detailed event data is also indexed into FTS5 for on-demand retrieval via `search()`.
**Per-platform details**
**Claude Code** — Full session support. All 5 hook types fire, capturing tool events, user decisions, building compaction snapshots, and restoring state after compaction or `--continue`.
**Gemini CLI** — High coverage. PostToolUse (AfterTool), PreCompact (PreCompress), and SessionStart all fire. Missing UserPromptSubmit, so user decisions and corrections aren't captured — but file edits, git ops, errors, and tasks are fully tracked.
**VS Code Copilot** — High coverage. Same as Gemini CLI — PostToolUse, PreCompact, and SessionStart all fire. User decisions aren't captured but all tool-level events are.
**OpenCode** — Partial. The TypeScript plugin captures PostToolUse events via `tool.execute.after`, but SessionStart is not yet available ([#14808](https://github.com/sst/opencode/issues/14808)). Events are stored but not automatically restored after compaction. The `AGENTS.md` routing instructions file compensates by re-teaching tool preferences at each session start.
**Codex CLI** — No session support. No hooks means no event capture. Each compaction or new session starts fresh. The `AGENTS.md` routing instructions file is the only continuity mechanism.
## Platform Compatibility
| Feature | Claude Code | Gemini CLI <sup xmlns="http://www.w3.org/1999/xhtml">(Beta)</sup> | VS Code Copilot <sup xmlns="http://www.w3.org/1999/xhtml">(Beta)</sup> | OpenCode <sup xmlns="http://www.w3.org/1999/xhtml">(Beta)</sup> | Codex CLI <sup xmlns="http://www.w3.org/1999/xhtml">(Beta)</sup> |
| --- | --- | --- | --- | --- | --- |
| MCP Server | Yes | Yes | Yes | Yes | Yes |
| PreToolUse Hook | Yes | Yes | Yes | Plugin | \-- |
| PostToolUse Hook | Yes | Yes | Yes | Plugin | \-- |
| SessionStart Hook | Yes | Yes | Yes | \-- | \-- |
| Can Modify Args | Yes | Yes | Yes | Plugin | \-- |
| Can Block Tools | Yes | Yes | Yes | Plugin | \-- |
| Utility Commands (ctx) | Yes | Yes | Yes | Yes | Yes |
| Slash Commands | Yes | \-- | \-- | \-- | \-- |
| Plugin Marketplace | Yes | \-- | \-- | \-- | \-- |
> **OpenCode** uses a TypeScript plugin paradigm — hooks run as in-process functions via `tool.execute.before`, `tool.execute.after`, and `experimental.session.compacting`, providing the same routing enforcement and session continuity as shell-based hooks. SessionStart is not yet available ([#14808](https://github.com/sst/opencode/issues/14808)), but compaction recovery works via the plugin's compacting hook.
>
> **Codex CLI** does not support hooks. It relies solely on routing instruction files (`AGENTS.md`) for enforcement (~60% compliance).
### Routing Enforcement
Hooks intercept tool calls programmatically — they can block dangerous commands and redirect them to the sandbox before execution. Instruction files guide the model via prompt instructions but cannot block anything. **Always enable hooks where supported.**
| Platform | Hooks | Instruction File | With Hooks | Without Hooks |
| --- | --- | --- | --- | --- |
| Claude Code | Yes (auto) | [`CLAUDE.md`](https://github.com/mksglu/context-mode/blob/main/configs/claude-code/CLAUDE.md) | **~98% saved** | ~60% saved |
| Gemini CLI | Yes | [`GEMINI.md`](https://github.com/mksglu/context-mode/blob/main/configs/gemini-cli/GEMINI.md) | **~98% saved** | ~60% saved |
| VS Code Copilot | Yes | [`copilot-instructions.md`](https://github.com/mksglu/context-mode/blob/main/configs/vscode-copilot/copilot-instructions.md) | **~98% saved** | ~60% saved |
| OpenCode | Plugin | [`AGENTS.md`](https://github.com/mksglu/context-mode/blob/main/configs/opencode/AGENTS.md) | **~98% saved** | ~60% saved |
| Codex CLI | \-- | [`AGENTS.md`](https://github.com/mksglu/context-mode/blob/main/configs/codex/AGENTS.md) | \-- | ~60% saved |
Without hooks, one unrouted `curl` or Playwright snapshot can dump 56 KB into context — wiping out an entire session's worth of savings.
See [`docs/platform-support.md`](https://github.com/mksglu/context-mode/blob/main/docs/platform-support.md) for the full capability comparison.
## Utility Commands
**Inside any AI session** — just type the command. The LLM calls the MCP tool automatically:
```
ctx stats → context savings, call counts, session report
ctx doctor → diagnose runtimes, hooks, FTS5, versions
ctx upgrade → update from GitHub, rebuild, reconfigure hooks
```
**From your terminal** — run directly without an AI session:
```
context-mode doctor
context-mode upgrade
```
Works on **all platforms**. On Claude Code, slash commands (`/ctx-stats`, `/ctx-doctor`, `/ctx-upgrade`) are also available.
## Benchmarks
| Scenario | Raw | Context | Saved |
| --- | --- | --- | --- |
| Playwright snapshot | 56.2 KB | 299 B | 99% |
| GitHub Issues (20) | 58.9 KB | 1.1 KB | 98% |
| Access log (500 requests) | 45.1 KB | 155 B | 100% |
| Context7 React docs | 5.9 KB | 261 B | 96% |
| Analytics CSV (500 rows) | 85.5 KB | 222 B | 100% |
| Git log (153 commits) | 11.6 KB | 107 B | 99% |
| Test output (30 suites) | 6.0 KB | 337 B | 95% |
| Repo research (subagent) | 986 KB | 62 KB | 94% |
Over a full session: 315 KB of raw output becomes 5.4 KB. Session time extends from ~30 minutes to ~3 hours.
[Full benchmark data with 21 scenarios →](https://github.com/mksglu/context-mode/blob/main/BENCHMARK.md)
## Try It
These prompts work out of the box. Run `/context-mode:ctx-stats` after each to see the savings.
**Deep repo research** — 5 calls, 62 KB context (raw: 986 KB, 94% saved)
```
Research https://github.com/modelcontextprotocol/servers — architecture, tech stack,
top contributors, open issues, and recent activity. Then run /context-mode:ctx-stats.
```
**Git history analysis** — 1 call, 5.6 KB context
```
Clone https://github.com/facebook/react and analyze the last 500 commits:
top contributors, commit frequency by month, and most changed files.
Then run /context-mode:ctx-stats.
```
**Web scraping** — 1 call, 3.2 KB context
```
Fetch the Hacker News front page, extract all posts with titles, scores,
and domains. Group by domain. Then run /context-mode:ctx-stats.
```
**Large JSON API** — 7.5 MB raw → 0.9 KB context (99% saved)
```
Create a local server that returns a 7.5 MB JSON with 20,000 records and a secret
hidden at index 13000. Fetch the endpoint, find the hidden record, and show me
exactly what's in it. Then run /context-mode:ctx-stats.
```
**Documentation search** — 2 calls, 1.8 KB context
```
Fetch the React useEffect docs, index them, and find the cleanup pattern
with code examples. Then run /context-mode:ctx-stats.
```
**Session continuity** — compaction recovery with full state
```
Start a multi-step task: "Create a REST API with Express — add routes, tests,
and error handling." After 20+ tool calls, type: ctx stats to see the session
event count. When context compacts, the model continues from your last prompt
with tasks, files, and decisions intact — no re-prompting needed.
```
## Security
Context Mode enforces the same permission rules you already use — but extends them to the MCP sandbox. If you block `sudo`, it's also blocked inside `ctx_execute`, `ctx_execute_file`, and `ctx_batch_execute`.
**Zero setup required.** If you haven't configured any permissions, nothing changes. This only activates when you add rules.
```
{
"permissions": {
"deny": [
"Bash(sudo *)",
"Bash(rm -rf /*)",
"Read(.env)",
"Read(**/.env*)"
],
"allow": [
"Bash(git:*)",
"Bash(npm:*)"
]
}
}
```
Add this to your project's `.claude/settings.json` (or `~/.claude/settings.json` for global rules). All platforms read security policies from Claude Code's settings format — even on Gemini CLI, VS Code Copilot, and OpenCode. Codex CLI has no hook support, so security enforcement is not available.
The pattern is `Tool(what to match)` where `*` means "anything".
Commands chained with `&&`, `;`, or `|` are split — each part is checked separately. `echo hello && sudo rm -rf /tmp` is blocked because the `sudo` part matches the deny rule.
**deny** always wins over **allow**. More specific (project-level) rules override global ones.
## Contributing
See [CONTRIBUTING.md](https://github.com/mksglu/context-mode/blob/main/CONTRIBUTING.md) for the development workflow and TDD guidelines.
```
git clone https://github.com/mksglu/context-mode.git
cd context-mode && npm install && npm test
```
## License
[Elastic License 2.0 (ELv2)](https://github.com/mksglu/context-mode/blob/main/LICENSE) — free to use, modify, and share. You may not rebrand and redistribute this software as a competing plugin, product, or managed service.
## Releases 45
[\+ 44 releases](https://github.com/mksglu/context-mode/releases)
## Packages
No packages published
## Languages
- [JavaScript 55.8%](https://github.com/mksglu/context-mode/search?l=javascript)
- [TypeScript 44.2%](https://github.com/mksglu/context-mode/search?l=typescript)
+307
View File
@@ -0,0 +1,307 @@
---
title: "codemo1991/nanobot-webui: 🎯 Nanobot WebUI — A Smarter, More Efficient Claude AI Assistant ✅ Coding & Bug Fixes ✅ Excel / PDF / PPT Processing ✅ Git Automation ✅ Visual Configuration Panel ✅ Q&A & Knowledge Management 24/7 ready to boost your productivity 🚀"
source: "https://github.com/codemo1991/nanobot-webui"
author:
- "[[GitHub]]"
published:
created: 2026-03-16
description: "🎯 Nanobot WebUI — A Smarter, More Efficient Claude AI Assistant ✅ Coding & Bug Fixes ✅ Excel / PDF / PPT Processing ✅ Git Automation ✅ Visual Configuration Panel ✅ Q&A & Knowledge Management 24/7 ready to boost your productivity 🚀 - codemo1991/nanobot-webui: 🎯 Nanobot WebUI — A Smarter, More Efficient Claude AI Assistant ✅ Coding & Bug Fixes ✅ Excel / PDF / PPT Processing ✅ Git Automation ✅ Visual Configuration Panel ✅ Q&A & Knowledge Management 24/7 ready to boost your productivity 🚀"
tags:
- "clippings"
---
**Tribute to nanobot**
*This project is built upon [nanobot](https://github.com/HKUDS/nanobot) for secondary development. nanobot was inspired by [Clawdbot](https://github.com/openclaw/openclaw), implementing complete Agent functionality with approximately 4000 lines of core code. Thanks to the nanobot community for the lightweight, readable, and extensible foundation.*
---
## 📢 What's New in This Fork
This fork extends nanobot with **Web UI**, **MCP support**, **additional channels** (Discord, QQ, DingTalk), **document/office skills**, **system monitoring**, and more.
---
## ✨ Features Overview
| Category | Features |
| --- | --- |
| **Core Capabilities** | Multi-platform: Web UI, Telegram, Feishu, CLI; Local运行,保护隐私; Support for multiple LLMs (DeepSeek, Claude, GPT, etc.) |
| **Function Modules** | File system operations, Code execution, Memory system (long-term + daily notes), Extensible skill system |
| **Web UI** | React + TypeScript SPA: Chat, Config (Channels/Providers/Models/MCP/Skills), System Status |
| **Channels** | Discord, QQ (qq-botpy), DingTalk (钉钉), plus original Telegram, WhatsApp, Feishu |
| **MCP** | Model Context Protocol integration — connect external tools via stdio/HTTP/SSE |
| **Skills** | `claude-code`, `git-manager`, `xlsx`, `pdf`, `pptx`, `skill-creator`, `mirror-system`, `code-review-expert` |
| **Cron** | Schedule reminders and recurring tasks — set fixed-time or interval-based jobs |
| **Providers** | Zhipu (智谱), DashScope (通义千问), vLLM, OpenRouter, Anthropic, OpenAI, DeepSeek, Groq, Gemini, Minimax |
| **Startup Scripts** | `nanobot-launcher.sh` (Linux/macOS) + `nanobot-launcher.ps1` (Windows) — Auto environment check, dependency update, frontend build, one-click launch |
| **System** | StatusRepository (SQLite), SystemStatusService (uptime, session count), centralized logging |
---
## 🛠️ Built-in Skills
nanobot-webui comes with a powerful skill system that extends the AI's capabilities:
| Skill | Description |
| --- | --- |
| **claude-code** | Delegate coding tasks to Claude Code CLI for advanced code generation and refactoring |
| **git-manager** | Git repository management — commit, push, pull, branch operations |
| **xlsx** | Excel spreadsheet operations — read, write, edit.xlsx files |
| **pdf** | PDF operations — read, write, merge, split PDF documents |
| **pptx** | PowerPoint presentation operations — create and edit.pptx files |
| **skill-creator** | Create new skills to extend nanobot's capabilities |
| **mirror-system** | Self-awareness exploration system for personal growth |
| **code-review-expert** | Git diff code review — analyze changes and provide feedback |
### Creating Custom Skills
The skill system is extensible. You can create custom skills by implementing skill functions that the AI can invoke. See the `skill-creator` skill for a template.
---
## ⏰ Scheduled Tasks (Cron)
nanobot-webui supports scheduled tasks through a built-in Cron system, allowing you to set up recurring reminders and automated actions:
| Feature | Description |
| --- | --- |
| **Fixed-Time Jobs** | Schedule tasks at specific times (e.g., daily 9:00 AM, weekly Monday 10:00 AM) |
| **Interval Jobs** | Run tasks at regular intervals (e.g., every 30 minutes, every 2 hours) |
| **Recurring Reminders** | Set up periodic reminders for meetings, deadlines, health checks, etc. |
| **Message Channels** | Send scheduled messages to any configured channel (Feishu, Telegram, Discord, etc.) |
### Usage Example
```
# Set a daily reminder
"每天早上 9 点提醒我喝水"
# Set a weekly meeting reminder
"每周一上午 10 点提醒我开周会"
# Set an interval check
"每半小时检查一下服务器状态"
```
The Cron system runs in the background and automatically delivers scheduled messages to your configured channels.
---
## 📸 Screenshots
### Chat
Multi-turn conversation with Nanobot, Markdown rendering, new sessions and history. Example shows weather query — Agent fetches real-time data via MCP tools and returns structured card results.
[![Chat interface](https://github.com/codemo1991/nanobot-webui/raw/main/case/chat.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/chat.png)
### System Status
View service health, uptime, active session count, installed Skills, workspace path, and system environment info.
[![System status](https://github.com/codemo1991/nanobot-webui/raw/main/case/system_status.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/system_status.png)
### Config — Channels (IM)
Manage IM channel enablement and config — Feishu, Discord, QQ, DingTalk, Telegram, WhatsApp, and more.
[![Channels config](https://github.com/codemo1991/nanobot-webui/raw/main/case/setting_channels.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/setting_channels.png)
### Config — Providers (AI)
Manage AI model providers — DeepSeek, Qwen, Zhipu, OpenAI, Anthropic, OpenRouter, vLLM, Groq, Gemini, etc. Add, edit, or remove providers.
[![Providers config](https://github.com/codemo1991/nanobot-webui/raw/main/case/setting_providers.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/setting_providers.png)
### Config — Default Model
Set the default Agent model — model name (provider/model-name format), Temperature, Max Tokens, and other parameters.
[![Default model config](https://github.com/codemo1991/nanobot-webui/raw/main/case/default_model.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/default_model.png)
### Config — MCP
Manage Model Context Protocol servers — stdio, http, sse, streamable\_http. Import/generate JSON or add new MCP services.
[![MCP config](https://github.com/codemo1991/nanobot-webui/raw/main/case/mcp.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/mcp.png)
### Config — Skills
Manage AI skills — select skill folders for upload to workspace, view installed skills (version, status, description), enable or disable.
[![Skills management](https://github.com/codemo1991/nanobot-webui/raw/main/case/skills.png)](https://github.com/codemo1991/nanobot-webui/blob/main/case/skills.png)
---
## 🚀 Quick Start
### Install
```
git clone https://github.com/codemo1991/nanobot-webui.git
cd nanobot-webui
pip install -e .
```
The intelligent startup scripts in the `scripts/` directory handle everything automatically — the simplest way to get started:
**Supported Platforms:**
- **Linux / macOS:** `nanobot-launcher.sh`
- **Windows PowerShell:** `nanobot-launcher.ps1`
**What it does:**
- ✅ Automatically checks Python (≥3.11) and Node.js environment
- ✅ Automatically installs/updates Python dependencies
- ✅ Automatically builds the frontend
- ✅ One-click launches the Web UI service
**Usage:**
- **Windows (PowerShell):**
```
.\scripts\nanobot-launcher.ps1
```
- **Linux / macOS:**
```
chmod +x scripts/nanobot-launcher.sh
./scripts/nanobot-launcher.sh
```
Then open [http://127.0.0.1:6788](http://127.0.0.1:6788/)
> **Tip:** Run the script again anytime to update dependencies and restart the service — the simplest way to keep your installation up-to-date!
### Manual Startup (Without Scripts)
### Web UI
```
# Build frontend (first time)
cd web-ui && npm install && npm run build && cd ..
# Start Web UI (backend + static files)
nanobot web-ui
```
Open [http://127.0.0.1:6788](http://127.0.0.1:6788/) — Chat, Config, and System pages are available.
### CLI Chat
```
nanobot onboard # Initialize config
# Edit ~/.nanobot/config.json with your API key
nanobot agent -m "Hello!"
```
### Docker
```
# Build the image
docker build -t nanobot-webui .
# Run (recommended: mount volume for config persistence)
docker run -d -p 6788:6788 -v nanobot-data:/root/.nanobot --name nanobot nanobot-webui
# Or use host path for config
docker run -d -p 6788:6788 -v ~/.nanobot:/root/.nanobot --name nanobot nanobot-webui
```
Then open [http://127.0.0.1:6788](http://127.0.0.1:6788/). On first launch, the app auto-creates `~/.nanobot/config.json`; add your API key via the Config page in the Web UI.
---
## 💻 Web Interface Features
- **Chat** — Create sessions, multi-turn conversations, Markdown rendering, session persistence
- **File Browser** — Browse and manage workspace files directly from the UI
- **Session History** — View and manage conversation history
- **Model Switching** — Easily switch between different AI models
- **Config** — Manage Channels (IM), Providers, Models, MCP servers, Skills
- **System** — Health check, uptime, session count, system info, config export
---
## 📦 Optional Dependencies
```
# Feishu
pip install nanobot-ai[feishu]
# QQ
pip install nanobot-ai[qq]
# DingTalk
pip install nanobot-ai[dingtalk]
# MCP
pip install nanobot-ai[mcp]
```
---
## 📁 Project Structure (This Fork)
```
nanobot/
├── agent/ # Core agent (loop, context, memory, tools)
│ └── tools/ # mcp.py, filesystem, shell, registry...
├── channels/ # telegram, whatsapp, feishu, discord, qq, dingtalk
├── web/ # REST API server (api.py)
├── mcp/ # MCP loader
├── storage/ # StatusRepository (SQLite)
├── services/ # SystemStatusService
├── skills/ # claude-code, git-manager, xlsx, pdf, pptx, skill-creator, mirror-system, code-review-expert...
├── providers/ # LLM providers (OpenAI, Anthropic, DeepSeek, etc.)
├── config/ # Extended schema (Discord, QQ, DingTalk, MCP)
└── cli/ # web-ui command, status, etc.
web-ui/ # React SPA (Chat, Config, System)
scripts/ # Startup scripts (nanobot-launcher.sh, nanobot-launcher.ps1)
```
---
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue for bugs and feature requests.
### Development Setup
```
# Clone the repository
git clone https://github.com/codemo1991/nanobot-webui.git
cd nanobot-webui
# Install in development mode
pip install -e .
# Install web-ui dependencies
cd web-ui && npm install
# Run development server
cd ..
nanobot web-ui
```
### Code Style
- Python: Follow PEP 8
- JavaScript/TypeScript: Follow ESLint configuration
- Commit messages: Use clear, descriptive messages
---
## 📄 License
MIT License — see LICENSE file for details.
---
## 🤝 Credits
- **[nanobot](https://github.com/HKUDS/nanobot)** — The base project this fork builds upon
- **nanobot contributors** — For the lightweight, research-friendly design
---
*Thanks for visiting ✨ nanobot-webui!*
@@ -0,0 +1,165 @@
---
title: "wewrite/README.md at main · oaker-io/wewrite"
source: "https://github.com/oaker-io/wewrite/blob/main/README.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "公众号文章全流程 AI Skill for Claude Code — 热点抓取 → 选题 → 写作 → SEO → 视觉AI → 排版 → 微信草稿箱 - wewrite/README.md at main · oaker-io/wewrite"
tags:
- "clippings"
---
## WeWrite
公众号文章全流程 AI Skill —— 从热点抓取到草稿箱推送,一句话搞定。
适用于 [Claude Code](https://claude.ai/code) 的 skill 格式。安装后对 Claude 说「用 demo 的配置写一篇公众号文章」即可触发完整流程。
## 功能
| 步骤 | 能力 | 脚本/模块 |
| --- | --- | --- |
| 热点抓取 | 微博 + 头条 + 百度实时热搜 | `scripts/fetch_hotspots.py` |
| SEO 评分 | 百度 + 360 搜索建议量化 | `scripts/seo_keywords.py` |
| 选题生成 | 10 选题 × 3 维度评分 | LLM + `references/topic-selection.md` |
| 框架生成 | 5 套差异化写作骨架 | LLM + `references/frameworks.md` |
| 文章写作 | 去 AI 痕迹 + 客户风格适配 | LLM + `references/writing-guide.md` |
| SEO 优化 | 标题 / 摘要 / 关键词 / 标签 | LLM + `references/seo-rules.md` |
| 视觉 AI | 封面 3 创意 + 内文 3-6 配图 | `toolkit/image_gen.py` (doubao / OpenAI) |
| 排版发布 | Markdown → 微信内联样式 HTML → 草稿箱 | `toolkit/cli.py` |
| 效果复盘 | 微信数据分析 API 回填阅读数据 | `scripts/fetch_stats.py` |
| Playbook 学习 | 从人工修改中提取风格规律 | `scripts/learn_edits.py` |
## 安装
### 作为 Claude Code Skill
```
# 方式 1:直接引用目录
# 在你的 Claude Code 设置中添加 skill 路径
# 方式 2:复制到 skills 目录
cp -r wewrite ~/.claude/skills/wewrite
```
### 安装 Python 依赖
```
cd wewrite
pip install -r requirements.txt
```
### 配置
```
cp config.example.yaml config.yaml
```
编辑 `config.yaml` ,填入:
- **微信公众号** `appid` / `secret` (发布和数据统计需要)
- **图片生成 API key** (doubao-seedream 或 OpenAI DALL-E)
## 目录结构
```
wewrite/
├── SKILL.md # Skill 主文件(Claude 读取并执行)
├── config.example.yaml # 配置模板
├── requirements.txt # Python 依赖
│
├── scripts/ # 数据采集脚本
│ ├── fetch_hotspots.py # 多平台热点抓取
│ ├── seo_keywords.py # SEO 关键词分析
│ ├── fetch_stats.py # 微信文章数据回填
│ ├── build_playbook.py # 从历史文章生成 Playbook
│ └── learn_edits.py # 学习人工修改
│
├── toolkit/ # Markdown→微信 工具链
│ ├── cli.py # CLI 入口(preview / publish / themes)
│ ├── converter.py # Markdown→内联样式 HTML
│ ├── theme.py # YAML 主题系统
│ ├── publisher.py # 微信草稿箱 API
│ ├── wechat_api.py # 微信 access_token / 图片上传
│ ├── image_gen.py # AI 图片生成(多 provider)
│ └── themes/ # 4 套预置排版主题
│
├── references/ # Claude 按需读取的参考文档
│ ├── topic-selection.md # 选题评估规则
│ ├── frameworks.md # 5 种写作框架
│ ├── writing-guide.md # 写作规范 + 去 AI 痕迹
│ ├── seo-rules.md # 微信 SEO 规则
│ ├── visual-prompts.md # 视觉 AI 提示词规范
│ ├── wechat-constraints.md # 微信平台技术限制
│ └── style-template.md # 客户配置模板说明
│
├── clients/ # 客户配置(每个客户一个目录)
│ └── demo/ # 示例客户
│ ├── style.yaml # 风格配置
│ └── history.yaml # 发布历史
│
└── output/ # 生成的文章输出目录
```
## 客户配置
每个客户是 `clients/{name}/` 下的一个目录。核心配置文件是 `style.yaml` :
```
name: "客户名称"
industry: "行业"
topics:
- "方向1"
- "方向2"
tone: "写作风格描述"
theme: "professional-clean"
```
详见 `references/style-template.md` 或复制 `clients/demo/style.yaml` 修改。
## 图片生成
支持两种 provider,通过 `config.yaml` 切换:
| Provider | 适用场景 | 配置 |
| --- | --- | --- |
| `doubao` | 中文提示词效果好,国内访问快 | [火山引擎 Ark](https://console.volcengine.com/ark) API key |
| `openai` | DALL-E 3,国际通用 | OpenAI API key |
CLI 独立使用:
```
python3 toolkit/image_gen.py --prompt "描述" --output cover.png --size cover
python3 toolkit/image_gen.py --prompt "描述" --output img.png --provider openai
```
## 排版主题
| 主题 | 风格 |
| --- | --- |
| `professional-clean` | 专业简洁(默认) |
| `tech-modern` | 科技风(蓝紫渐变) |
| `warm-editorial` | 暖色编辑风 |
| `minimal` | 极简黑白 |
预览主题: `python3 toolkit/cli.py themes`
独立排版: `python3 toolkit/cli.py preview article.md --theme tech-modern`
## Toolkit 独立使用
即使不用 Claude Code,toolkit 也可以独立使用:
```
# 预览 Markdown → 微信 HTML
python3 toolkit/cli.py preview article.md --theme professional-clean
# 发布到微信草稿箱
python3 toolkit/cli.py publish article.md --cover cover.png --title "文章标题"
# 抓热点
python3 scripts/fetch_hotspots.py --limit 20
# SEO 分析
python3 scripts/seo_keywords.py --json "AI大模型" "科技股"
```
@@ -0,0 +1,414 @@
---
title: "yologdev/yoyo-evolve: A coding agent that evolves itself. One commit per day."
source: "https://github.com/yologdev/yoyo-evolve/blob/main/README.md"
author:
- "[[GitHub]]"
published:
created: 2026-03-28
description: "A coding agent that evolves itself. One commit per day. - yologdev/yoyo-evolve"
tags:
- "clippings"
---
[![yoyo — a coding agent that evolves itself](https://github.com/yologdev/yoyo-evolve/raw/main/assets/banner.png)](https://github.com/yologdev/yoyo-evolve/blob/main/assets/banner.png)
[Website](https://yologdev.github.io/yoyo-evolve) · [Documentation](https://yologdev.github.io/yoyo-evolve/book/) · [GitHub](https://github.com/yologdev/yoyo-evolve) · [DeepWiki](https://deepwiki.com/yologdev/yoyo-evolve) · [Issues](https://github.com/yologdev/yoyo-evolve/issues) · [Follow on X](https://x.com/yuanhao)
---
## yoyo: A Coding Agent That Evolves Itself
**yoyo** is a free, open-source coding agent for your terminal. It navigates codebases, makes multi-file edits, runs tests, manages git, understands project context, and recovers from failures — all from a streaming REPL with 55 slash commands.
It started as a ~200-line CLI example. Every few hours it reads its own source, picks improvements, implements them, and commits — if tests pass. 24 days of autonomous evolution later: **31,000+ lines of Rust, 1,346 tests, 14 modules**.
No human writes its code. No roadmap tells it what to do. It decides for itself.
## Features
### 🐙 Agent Core
- **Streaming output** — tokens arrive as they're generated, not after completion
- **Multi-turn conversation** with full history tracking
- **Extended thinking** — adjustable reasoning depth (off / minimal / low / medium / high)
- **Subagent spawning** — `/spawn` delegates focused tasks to a child agent; the model can also delegate subtasks automatically via a built-in sub-agent tool
- **Parallel tool execution** — multiple tool calls run simultaneously
- **Automatic retry** with exponential backoff and rate-limit awareness
### 🛠️ Tools
| Tool | What it does |
| --- | --- |
| `bash` | Run shell commands with interactive confirmation |
| `read_file` | Read files with optional offset/limit |
| `write_file` | Create or overwrite files with content preview |
| `edit_file` | Surgical text replacement with colored inline diffs |
| `search` | Regex-powered grep across files |
| `list_files` | Directory listing with glob filtering |
| `rename_symbol` | Project-wide symbol rename across all git-tracked files |
| `ask_user` | Ask the user questions mid-task for clarification (interactive mode only) |
### 🔌 Multi-Provider Support
Works with **11 providers** out of the box — switch mid-session with `/provider`:
Anthropic · OpenAI · Google · Ollama · OpenRouter · xAI · Groq · DeepSeek · Mistral · Cerebras · Custom (any OpenAI-compatible endpoint)
### 📂 Git Integration
- `/diff` — full status + diff with insertion/deletion summary
- `/commit` — AI-generated commit messages from staged changes
- `/undo` — revert last commit, clean up untracked files
- `/git` — shortcuts for `status`, `log`, `diff`, `branch`, `stash`
- `/pr` — full PR workflow: `list`, `view`, `create [--draft]`, `diff`, `comment`, `checkout`
- `/review` — AI-powered code review of staged/unstaged changes
### 🏗️ Project Tooling
- `/health` — run build/test/clippy/fmt diagnostics (auto-detects Rust, Node, Python, Go, Make)
- `/fix` — run checks and auto-apply fixes for failures
- `/test` — detect project type and run the right test command
- `/lint` — detect project type and run the right linter
- `/init` — scan project and generate a starter YOYO.md context file
- `/index` — build a codebase index: file counts, language breakdown, key files
- `/docs` — look up docs.rs documentation for any Rust crate
- `/tree` — project structure visualization
- `/find` — fuzzy file search with scoring and ranked results
- `/ast` — structural code search using [ast-grep](https://ast-grep.github.io/) (optional)
### 💾 Session Management
- `/save` and `/load` — persist and restore sessions as JSON
- `--continue/-c` — resume last session on startup
- **Auto-save on exit** — sessions saved automatically, including crash recovery
- **Auto-compaction** at 80% context usage, plus manual `/compact`
- `--context-strategy checkpoint` — exit with code 2 when context is high (for pipeline restarts)
- `/tokens` — visual token usage bar with percentage
- `/cost` — per-model input/output/cache pricing breakdown
### 🧠 Context & Memory
- **Project context files** — auto-loads YOYO.md, CLAUDE.md, or `.yoyo/instructions.md`
- **Git-aware context** — recently changed files injected into system prompt
- **Project memories** — `/remember`, `/memories`, `/forget` for persistent cross-session notes
### 🔐 Permission System
- **Interactive tool approval** — confirm prompts for bash, write\_file, and edit\_file with preview
- **"Always" option** — approve once per session
- `--yes/-y` — auto-approve all executions
- `--allow` / `--deny` — glob-based allowlist/blocklist for commands
- `--allow-dir` / `--deny-dir` — directory restrictions with path traversal prevention
- Config file support via `[permissions]` and `[directories]` sections
### 🧩 Extensibility
- **MCP servers** — `--mcp <cmd>` or `mcp = [...]` in `.yoyo.toml` connects to MCP servers via stdio transport
- **OpenAPI tools** — `--openapi <spec>` registers tools from OpenAPI specifications
- **Skills system** — `--skills <dir>` loads markdown skill files with YAML frontmatter
### ✨ REPL Experience
- **Rustyline** — arrow keys, Ctrl-A/E/K/W, persistent history
- **Tab completion** — slash commands, file paths, model names, git subcommands
- **Multi-line input** — backslash continuation and fenced code blocks
- **Markdown rendering** — headers, bold, italic, code blocks with syntax-labeled headers
- **Syntax highlighting** — Rust, Python, JS/TS, Go, Shell, C/C++, JSON, YAML, TOML
- **Braille spinner** while waiting for responses
- **Conversation bookmarks** — `/mark`, `/jump`, `/marks`
- **Conversation search** — `/search` with highlighted matches
- **Shell escape** — `/run <cmd>` and `!<cmd>` bypass the AI entirely
## Quick Start
### Install (macOS & Linux)
```
curl -fsSL https://raw.githubusercontent.com/yologdev/yoyo-evolve/main/install.sh | bash
```
### Install (Windows PowerShell)
```
irm https://raw.githubusercontent.com/yologdev/yoyo-evolve/main/install.ps1 | iex
```
### Or install from crates.io
```
cargo install yoyo-agent
```
### Or build from source
```
git clone https://github.com/yologdev/yoyo-evolve && cd yoyo-evolve && cargo install --path .
```
### Run
```
# Interactive REPL (default)
ANTHROPIC_API_KEY=sk-... yoyo
# Single prompt
yoyo -p "explain this codebase"
# Pipe input
echo "write a README" | yoyo
# Use a different provider
OPENAI_API_KEY=sk-... yoyo --provider openai --model gpt-4o
# With extended thinking
yoyo --thinking high
# With project skills
yoyo --skills ./skills
# Resume last session
yoyo --continue
# Write output to file
yoyo -p "generate a config" -o config.toml
# Auto-approve all tool use
yoyo --yes
```
### Configure
Create `.yoyo.toml` in your project root, `~/.yoyo.toml` in your home directory, or `~/.config/yoyo/config.toml` globally:
```
model = "claude-sonnet-4-20250514"
provider = "anthropic"
thinking = "medium"
mcp = ["npx open-websearch@latest"]
[permissions]
allow = ["cargo *", "npm *"]
deny = ["rm -rf *"]
[directories]
allow = ["."]
deny = ["../secrets"]
```
### Project Context
Create a `YOYO.md` (or `CLAUDE.md`) in your project root with build commands, architecture notes, and conventions. yoyo loads it automatically as system context. Or run `/init` to generate one.
## All Commands
| Command | Description |
| --- | --- |
| `/ast <pattern>` | Structural code search using ast-grep (optional) |
| `/help` | Grouped command reference |
| `/changes` | Show files modified during this session |
| `/clear` | Clear conversation history |
| `/compact` | Compact conversation to save context |
| `/commit [msg]` | Commit staged changes (AI-generates message if omitted) |
| `/config` | Show all current settings |
| `/context` | Show loaded project context files |
| `/cost` | Show session cost breakdown |
| `/diff` | Git diff summary of uncommitted changes |
| `/docs <crate>` | Look up docs.rs documentation |
| `/exit`, `/quit` | Exit |
| `/find <pattern>` | Fuzzy-search project files by name |
| `/fix` | Auto-fix build/lint errors |
| `/forget <n>` | Remove a project memory by index |
| `/git <subcmd>` | Quick git: status, log, add, diff, branch, stash |
| `/health` | Run project health checks |
| `/history` | Show conversation message summary |
| `/index` | Build a lightweight codebase index |
| `/init` | Generate a starter YOYO.md |
| `/jump <name>` | Jump to a conversation bookmark |
| `/lint` | Auto-detect and run project linter |
| `/load [path]` | Load session from file |
| `/mark <name>` | Bookmark current point in conversation |
| `/marks` | List all conversation bookmarks |
| `/memories` | List project-specific memories |
| `/model <name>` | Switch model mid-session |
| `/pr [subcmd]` | PR workflow: list, view, create, diff, comment, checkout |
| `/provider <name>` | Switch provider mid-session |
| `/remember <note>` | Save a persistent project memory |
| `/retry` | Re-send the last user input |
| `/review [path]` | AI code review of changes or a specific file |
| `/run <cmd>` | Run a shell command directly (no AI, no tokens) |
| `/save [path]` | Save session to file |
| `/search <query>` | Search conversation history |
| `/spawn <task>` | Spawn a subagent for a focused task |
| `/status` | Show session info |
| `/test` | Auto-detect and run project tests |
| `/think [level]` | Show or change thinking level |
| `/tokens` | Show token usage and context window |
| `/tree [depth]` | Show project directory tree |
| `/undo` | Revert all uncommitted changes |
| `/version` | Show yoyo version |
| `/web <url>` | Fetch a web page and display readable text |
## How It Evolves
```
Every ~8 hours, yoyo wakes up and:
→ Reads its own source code
→ Checks GitHub issues for community input
→ Plans what to improve
→ Makes changes, runs tests
→ If tests pass → commit. If not → revert.
→ Replies to issues as 🐙 yoyo-evolve[bot]
→ Pushes and goes back to sleep
Every 4 hours (offset), yoyo runs a social session:
→ Reads GitHub Discussions
→ Replies to conversations it's part of
→ Joins new discussions if it has something real to say
→ Occasionally starts its own discussion
→ Learns from interacting with humans
Daily, a synthesis job regenerates active memory:
→ Reads JSONL archives (learnings + social learnings)
→ Applies time-weighted compression (recent=full, old=themed)
→ Writes active context files loaded into every prompt
```
The entire history is in the [git log](https://github.com/yologdev/yoyo-evolve/commits/main) and the [journal](https://github.com/yologdev/yoyo-evolve/blob/main/JOURNAL.md).
## Talk to It
Start a [GitHub Discussion](https://github.com/yologdev/yoyo-evolve/discussions) for conversation, or open a [GitHub Issue](https://github.com/yologdev/yoyo-evolve/issues/new) for bugs and feature requests.
### Labels
| Label | What it does |
| --- | --- |
| `agent-input` | Community suggestions, bug reports, feature requests — yoyo reads these every session |
| `agent-self` | Issues yoyo filed for itself as future TODOs |
| `agent-help-wanted` | Issues where yoyo is stuck and asking humans for help |
### How to submit
1. Open a [new issue](https://github.com/yologdev/yoyo-evolve/issues/new)
2. Add the `agent-input` label
3. Describe what you want — be specific about the problem or idea
4. Add a thumbs-up reaction to other issues you care about (higher votes = higher priority)
### What to ask
- **Suggestions** — tell it what to learn or build
- **Bugs** — tell it what's broken (include steps to reproduce)
- **Challenges** — give it a task and see if it can do it
- **UX feedback** — tell it what felt awkward or confusing
### What happens after
- **Fixed**: yoyo comments on the issue and closes it automatically
- **Partial**: yoyo comments with progress and keeps the issue open
- **Won't fix**: yoyo explains its reasoning and closes the issue All responses come with yoyo's personality — look for the 🐙.
## Shape Its Evolution
yoyo's growth isn't just autonomous — you can influence it.
### Guard It
Every issue is scored by net votes: thumbs up minus thumbs down. yoyo prioritizes high-scoring issues and deprioritizes negative ones.
- See a great suggestion? **Thumbs-up** it to push it up the queue.
- See a bad idea, spam, or prompt injection attempt? **Thumbs-down** it to protect yoyo.
You're the immune system. Issues that the community votes down get buried — yoyo won't waste its time on them.
### Sponsor
[GitHub Sponsors](https://github.com/sponsors/yologdev) · [Ko-fi](https://ko-fi.com/yuanhao)
**Monthly sponsors** get benefit tiers (everyone uses the same 8h run gap):
| Amount | Benefits |
| --- | --- |
| $5/mo | Issue priority (💖) |
| $10/mo | Priority + shoutout issue |
| $25/mo | Above + SPONSORS.md listing |
| $50/mo | Above + README listing |
**One-time sponsors** get a single accelerated run ($2+) plus benefit tiers:
| Amount | Benefits |
| --- | --- |
| $2 | 1 accelerated run (bypasses 8h gap) |
| $5 | Accelerated run + issue priority |
| $10 | Above + shoutout issue (30 days) |
| $20 | Above + SPONSORS.md eligible (30 days) |
| $50 | Above + priority for 60 days |
Accelerated runs are only consumed when you have open issues, so nothing is wasted.
Crypto wallets:
| Chain | Address |
| --- | --- |
| SOL | `F6ojB5m3ss4fFp3vXdxEzzRqvvSb9ErLTL8PGWQuL2sf` |
| BASE | `0x0D2B87b84a76FF14aEa9369477DA20818383De29` |
| BTC | `bc1qnfkazn9pk5l32n6j8ml9ggxlrpzu0dwunaaay4` |
## Architecture
```
src/ 14 modules, ~31,000 lines of Rust
main.rs Entry point, agent config, tool building
cli.rs CLI parsing, config files, permissions
commands.rs Slash command dispatch, grouped /help
commands_git.rs /diff, /commit, /pr, /review, /git
commands_project.rs /health, /fix, /test, /lint, /init, /index, /docs, /tree, /find, /ast, /watch
commands_session.rs /save, /load, /compact, /tokens, /cost
docs.rs Crate documentation lookup
format.rs ANSI formatting, markdown rendering, syntax highlighting
git.rs Git operations, branch detection, PR interactions
help.rs Per-command help pages and command metadata
memory.rs Project memory system (.yoyo/memory.json)
prompt.rs System prompt construction, project context assembly
repl.rs REPL loop, tab completion, multi-line input
setup.rs First-run onboarding wizard
tests/
integration.rs 82 subprocess-based integration tests
docs/ mdbook source (book.toml + src/)
site/ gitignored build output (built by CI Pages workflow)
index.html Journey homepage (built by build_site.py)
book/ mdbook output
scripts/
evolve.sh Evolution pipeline (plan → implement → respond)
social.sh Social session (discussions → reply → learn)
format_issues.py Issue selection & formatting
format_discussions.py Discussion fetching & formatting (GraphQL)
yoyo_context.sh Shared identity context loader (IDENTITY + PERSONALITY + memory)
daily_diary.sh Blog post generator from journal/commits/learnings
build_site.py Journey website generator
memory/
learnings.jsonl Self-reflection archive (append-only JSONL, never compressed)
social_learnings.jsonl Social insight archive (append-only JSONL)
active_learnings.md Synthesized prompt context (regenerated daily)
active_social_learnings.md Synthesized social context (regenerated daily)
skills/ 6 skills: self-assess, evolve, communicate, social, release, research
```
## Test Quality
1,346 tests (1,264 unit + 82 integration) covering CLI flags, command parsing, error quality, exit codes, output formatting, edge cases, project detection, fuzzy scoring, git operations, session management, markdown rendering, cost calculation, permission logic, streaming behavior, and more.
yoyo also uses mutation testing ([cargo-mutants](https://github.com/sourcefrog/cargo-mutants)) to find gaps in the test suite. Every surviving mutant is a line of code that isn't truly tested.
```
cargo install cargo-mutants
cargo mutants
```
See `mutants.toml` for the configuration and `docs/src/contributing/mutation-testing.md` for the full guide.
## Built On
[yoagent](https://github.com/yologdev/yoagent) — minimal agent loop in Rust. The library that makes this possible.
## License
[MIT](https://github.com/yologdev/yoyo-evolve/blob/main/LICENSE)
@@ -0,0 +1,170 @@
agency-agents
AI-Trader
aily-blockly
bb-browser
BitNet
career-ops
cc-switch
CowAgent
deepchat
DeepCode
DeepSeek-TUI
DeepTutor
FastCode
go-mcp
goclaw
gstack
helloagents-hellowind777
HelloAgents-jjyaoao
hermes-agent
hermes-desktop
Jellyfish
khoj
Kode-Agent
LightAgent-Wanxingai
microclaw
mimiclaw
moltis
nanobot
nanobot-0.1.4
nanobot-0.1.5.post3
nanoclaw
openclaude
openclaw
openclaw-qqbot
patchright
patchright-python
picoclaw
picolm
promptfoo
SimpleAgent
tinyclaw
weclaw
yoyo-evolve
git_pull_all.py
boss-agent-cli
boss-cli
CLI-Anything
larksuite_cli
LightRAG
opencli
playwright-cli
RAG-Anything
wx-cli
xhs-cli
xiaohongshu-cli
awesome-design-md
claude-code-best-practice
Claude-Code-Game-Studios
everything-claude-code
harness-engineering
hello-agents
how-to-vibecoding
learn-claude-code
learn-hermes-agent
learn-nanobot
openclaw101
OpenClawChineseTranslation
ui-ux-pro-max-skill
vibe-coding-cn
https://github.com/fastclaw-ai/weclaw.git
微信 AI Agent 桥接器 — 通过 [iLink](https://www.ilink.wiki/) API 将微信消息接入 AI 编程助手(Claude、Codex、Gemini、Kimi 等)。可以尝试将其应用到nanobot
Connect to any agents with WeChat ClawBot.
https://github.com/Wscats/miniclaw.git
用最少的代码实现 OpenClaw 引擎,零依赖,纯 JavaScript,详细中文注释,适合学习和理解 ReAct 原理。
https://github.com/Wscats/minirag.git
用最少的代码实现完整的 RAG 引擎,零依赖,纯 JavaScript,详细中文注释,适合学习和理解 RAG 原理。
https://github.com/Wscats/baidu-netdisk-skills.git
百度网盘管理助手 Skills
https://github.com/SiverKing/weixin-ClawBot-API.git
基于腾讯官方开放的tencent-weixin/openclaw-weixin实现的微信个人账号 Bot,支持接入任意 AI 模型,实现微信自动对话。免openclaw部署和登录直接接入与调用。
https://github.com/FFengIll/understand-tencent-weixin-openclaw-weixin.git
understand tencent-weixin-openclaw-weixin
https://github.com/pzx521521/openclaw-weixin-cli.git
# 微信-openclaw CLI
这是一个独立的 Go 命令行程序,用来对接微信 iLink Bot HTTP API。
> 把`openclaw-weixin-cli`单独拉出来做消息接收和回复
微信新出了`openclaw-weixin-cli`用于和龙虾的交互,
其实就是一个简单的 消息接收/回复,
解析了一下里面的原理,就是一个 http 长链接,并做了简单的实现.
可以完全脱离 OpenClaw 使用,但是目前不知道能干什么...
https://github.com/1oid/tencent-openclaw-weixin-standalone.git
单机可运行版本的openclaw-weixin
https://github.com/Wscats/qq-zone-photo.git
QQ 空间相册的自动化管理 Skills,支持扫码登录、相册浏览、照片上传/下载、相册创建等功能。
https://github.com/Wscats/t-trading.git
一套基于 EMA 多层通道 + 斐波那契回撤 + 多周期共振评分的 Prompt-based 交易分析技能,支持 A 股与加密货币市场。
https://github.com/Wscats/university-applications.git
本 Skill 用于采集香港所有大学及院校的官方硕士项目招生信息,并输出为 5 种格式(Excel / Word / PDF / HTML / Markdown)。
https://github.com/Wscats/bilibili-all-in-one.git
Bilibili All-in-One 是一个综合性的 Skill 工具包。
https://github.com/Wscats/juejin-skills.git
掘金技术社区一站式操作 Skills,支持热门文章排行榜查询、Markdown 文章一键发布和文章下载保存为 Markdown。
https://github.com/Wscats/poetry-skills.git
Skills 提供诗词生成与诗词查询两大核心能力。
@@ -0,0 +1,124 @@
https://github.com/browser-use/browser-use.git
Make websites accessible for AI agents. Automate tasks online with ease.
https://github.com/microsoft/playwright.git
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://github.com/D4Vinci/Scrapling.git
An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
https://github.com/microsoft/playwright-mcp.git
Playwright MCP server
https://github.com/lightpanda-io/browser.git
Lightpanda: the headless browser designed for AI and automation
https://github.com/apify/crawlee.git
Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
https://github.com/browserbase/stagehand.git
The AI Browser Automation Framework
https://github.com/Skyvern-AI/skyvern.git
Automate browser based workflows with AI
https://github.com/getmaxun/maxun.git
The open-source no-code platform for web scraping, crawling, search and AI data extraction • Turn websites into structured APIs in minutes