Cover image
Try Now
2025-04-14

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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • lasso-security
  • 基于插件的网关,可协调其他MCP,并允许开发人员在IT企业级代理上构建。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

    Reviews

    3 (13)
    Avatar
    user_yDxfHNiv
    2025-04-26

    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.

    Avatar
    user_Be6oL5Lx
    2025-04-26

    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.

    Avatar
    user_qIa5caVN
    2025-04-26

    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.

    Avatar
    user_V7Je4LUJ
    2025-04-26

    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!

    Avatar
    user_S7jp8TAI
    2025-04-26

    "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!"

    Avatar
    user_abOC1Y6s
    2025-04-26

    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!

    Avatar
    user_H0mZ74h6
    2025-04-26

    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!

    Avatar
    user_fOyJSLIf
    2025-04-26

    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!

    Avatar
    user_9kdis17t
    2025-04-26

    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!

    Avatar
    user_pgtOBkf6
    2025-04-26

    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.

    Avatar
    user_K1fnK8gK
    2025-04-26

    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!

    Avatar
    user_vGTIesL9
    2025-04-26

    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!

    Avatar
    user_O8b5lbzf
    2025-04-26

    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!