Installation
import { Tabs, TabItem, Steps } from ‘@astrojs/starlight/components’;
agent-md can be installed as a standalone CLI executable, an editor extension (VS Code, Cursor, Devin, Antigravity), or imported as a native Rust crate in your applications.
Installing the CLI
Section titled “Installing the CLI”brew tap loclv/toolsbrew install agent-mdVerify installation:
agent-md --versioncargo install agent-mdEnsure Cargo’s bin directory is added to your environment PATH:
export PATH="$HOME/.cargo/bin:$PATH"-
Clone the repository:
Terminal window git clone https://github.com/loclv/agent-md.gitcd agent-md -
Build the release binary:
Terminal window cargo build --releaseThe compiled executable will be located at
target/release/agent-md. -
(Optional) Add the binary to your
PATHor copy it to/usr/local/bin:Terminal window cp target/release/agent-md /usr/local/bin/
VS Code & Editor Extension
Section titled “VS Code & Editor Extension”agent-md is available as a formatting extension for VS Code and compatible editors (Cursor, Devin, Windsurf, Antigravity):
- Marketplace: Search for Agent-MD Formatter or visit the VS Code Marketplace.
- Extension ID:
loclv.agent-md-formatter
Quick Install via Terminal
Section titled “Quick Install via Terminal”code --install-extension loclv.agent-md-formatterFor Cursor:
cursor --install-extension loclv.agent-md-formatterSee the VS Code Extension Guide for configuration options and setting up format-on-save.
Rust Library Dependency
Section titled “Rust Library Dependency”To integrate agent-md’s formatting, parsing, and validation directly into your Rust services or agent tool implementations:
Add agent-md to your Cargo.toml:
[dependencies]agent-md = "0.5.0"Basic Example
Section titled “Basic Example”use agent_md::{format_markdown, validate_markdown, parse_markdown};
fn main() { let raw = "# Hello World\n\n| Col A | Col B |\n|---|---|\n| 1 | 2 |\n";
// Format markdown into token-optimized representation let formatted = format_markdown(raw);
// Validate adherence to AI-friendly standards let report = validate_markdown(&formatted); if report.valid { println!("Markdown is valid and AI-friendly!"); } else { println!("Found issues: {:?}", report.errors); }}See the Rust Library API Reference for detailed function signatures.