
md-ai
MARKDOWN AI-通过您的首选编辑器通过Markdown文件使用LLM
3 years
Works with Finder
1
Github Watches
0
Github Forks
1
Github Stars
‼️ This is still work in progress
TODO:
- Allow picking a model via CLI flag
- Enable / Disable tools via flags
Markdown AI
A command-line tool and library for working with AI using markdown in your own $EDITOR
.
Features
- CLI or Library - Library allows you to provide a custom model and custom tools.
- The entire Chat is Markdown, including tool calls.
- Opens your
$EDITOR
for editing the chat - you can edit everything with your preferred editor. - Tool calling.
- Custom system prompt.
- Streams responses from AI models to the console while they are generated.
How does this work?
At the core the chat is serialized into markdown after each AI invocation. You can read and edit the markdown and it will be parsed into messages before sent to the AI.
Example:
## User
call the tool for me
## Assistant
will do!
\`\`\`tool-call
{
"toolCallId": "1234",
"toolName": "myTool",
"args": {
"msg": "hello tool"
}
}
\`\`\`
## Tool
\`\`\`tool-result
{
"toolCallId": "1234",
"toolName": "myTool",
"result": {
"response": "hello agent"
}
}
\`\`\`
Will be parsed into
import type { CoreMessage } from "ai";
let messages: Array<CoreMessage> = [
{
role: "user",
content: "call the tool for me",
},
{
role: "assistant",
content: [
{ type: "text", text: "will do!\n" },
{
type: "tool-call",
toolCallId: "1234",
toolName: "myTool",
args: { msg: "hello tool" },
},
],
},
{
role: "tool",
content: [
{
type: "tool-result",
toolCallId: "1234",
toolName: "myTool",
result: { response: "hello agent" },
},
],
},
];
Command-line Usage
export GOOGLE_GENERATIVE_AI_API_KEY=blablabla # uses gemini-2.0-pro-exp-02-05 by default
export EDITOR="hx +99999" # defaults to vi
# or
export EDITOR="code --wait"
node lib/cli.js chat.md --system=system.md --max-steps=5
Library Usage
The package can also be used as a library in your own script.
By using MarkdownAI
this way, you can provide your own tools and model:
import { MarkdownAI, tools } from "md-ai";
const chat = new MarkdownAI({
path: "./my-chat.md",
editor: "code --wait",
ai: {
// these are forwarded to the "ai" `steamText` call
model: google("gemini-2.0-pro-exp-02-05"), // Example model, align with CLI default
system: "You are a helpful assistant.",
maxSteps: 5,
tools: {
readFiles: tools.createReadFilesTool(),
listFiles: tools.createListFilesTool(),
writeFiles: tools.createWriteFilesTool(),
// your custom tools
},
},
});
await chat.run();
Why does this exist?
My opinions:
- LLM Chat Editing experience is bad
- Editing experience in my editor is good
- LLMs respond in markdown anyway
- Markdown in editors comes with syntax highlighting for free
- Lives on my machine, uses my API keys, can use my tools
License
MIT
相关推荐
😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack
Reviews

user_yDxfHNiv
I've been using md-ai for a while now and I must say, the experience has been remarkable. Created by ccssmnn, this tool is incredibly user-friendly and efficient. It seamlessly integrates with my workflow and has significantly improved my productivity. I highly recommend md-ai to anyone looking for a reliable AI solution.

user_Be6oL5Lx
I've been using md-ai from ccssmnn, and it's a fantastic tool for anyone involved in medical data analysis. The interface is user-friendly, and the AI-driven insights are incredibly accurate and helpful. Highly recommend it to professionals looking to streamline their workflows and improve data interpretation.

user_qIa5caVN
As a dedicated user of MCP applications, I am thoroughly impressed with the MD-AI product by CCSSMNN. It offers seamless integration and outstanding performance, making my work efficient and productive. The user interface is intuitive, and the features are robust and reliable. Highly recommend this to anyone looking for a cutting-edge solution.

user_V7Je4LUJ
As a dedicated user of mcp applications, I am thrilled with the md-ai product by ccssmnn. This innovative tool has significantly enhanced my workflow, providing seamless integration and powerful features that streamline my tasks. The user-friendly interface and efficient performance make it a must-have for anyone in the AI field. Highly recommended!

user_S7jp8TAI
"MD-AI by ccssmnn is a game-changer! As an MCP app enthusiast, I find this tool incredibly intuitive and powerful. It's user-friendly and offers accurate medical insights that streamline my daily tasks. The seamless integration and the welcoming interface set it apart from other tools I've used. Highly recommend to anyone in the medical field!"

user_abOC1Y6s
As a dedicated user of MCP applications, I must say that md-ai by ccssmnn is truly impressive. The seamless integration and user-friendly interface make it a standout product. Its functionality and performance exceed expectations, providing valuable insights and efficient solutions. Highly recommended for anyone looking to enhance their AI capabilities!

user_H0mZ74h6
As a dedicated user of MCP applications, I must say that md-ai by ccssmnn is truly remarkable. The seamless integration and user-friendly interface make it a standout product. I particularly appreciate the robust functionalities that are tailored to meet diverse AI needs. Highly recommended for anyone looking to enhance their AI capabilities!

user_fOyJSLIf
As a devoted user of MCP applications, I must say that the "md-ai" by ccssmnn is a remarkable product. Its intuitive interface and powerful functionalities have significantly improved my workflow. The AI-driven features provide precise and reliable results, making it a must-have tool for anyone in need of advanced data analysis. Highly recommended!

user_9kdis17t
MD-AI by CCSSMNN is an incredible application for anyone interested in medical data analysis. User-friendly and robust, it integrates seamlessly into existing workflows. The welcome information is clear, and the intuitive interface ensures you can get started quickly. Highly recommended for professionals looking to enhance their analytical capabilities with ease!

user_pgtOBkf6
MD-AI by ccssmnn is a revolutionary tool for medical professionals. Its user-friendly interface and advanced AI functionalities significantly enhance diagnostic accuracy. This product undoubtedly represents the future of medical technology and integrates seamlessly into daily practice. Highly recommended for practitioners looking to stay ahead in the field.

user_K1fnK8gK
I've been using md-ai by ccssmnn and I'm thoroughly impressed. This application has significantly streamlined my workflow with its intuitive interface and robust features. It's become an indispensable tool for my daily tasks. Highly recommended for anyone looking for a reliable and efficient solution!

user_vGTIesL9
I've been using md-ai by ccssmnn for a while now, and it has significantly improved my workflow. Its seamless integration and powerful functionalities make data analysis a breeze. Highly recommend to anyone looking for a reliable tool for their data processing needs!

user_O8b5lbzf
I've been using the md-ai app created by ccssmnn and it has truly transformed my workflow. The intuitive design and efficient features make complex tasks much simpler. The seamless integration and welcome message provide a great user experience from the start. Highly recommended for professionals seeking a reliable tool!