Skip to content

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.


Install using the official Homebrew tap:
Terminal window
brew tap loclv/tools
brew install agent-md

Verify installation:

Terminal window
agent-md --version
Install directly from crates.io using Cargo:
Terminal window
cargo install agent-md

Ensure Cargo’s bin directory is added to your environment PATH:

Terminal window
export PATH="$HOME/.cargo/bin:$PATH"
1. Ensure Rust 1.94.0 or later is installed via [rustup](https://rustup.rs/): ```bash rustc --version ```
  1. Clone the repository:

    Terminal window
    git clone https://github.com/loclv/agent-md.git
    cd agent-md
  2. Build the release binary:

    Terminal window
    cargo build --release

    The compiled executable will be located at target/release/agent-md.

  3. (Optional) Add the binary to your PATH or copy it to /usr/local/bin:

    Terminal window
    cp target/release/agent-md /usr/local/bin/

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
Terminal window
code --install-extension loclv.agent-md-formatter

For Cursor:

Terminal window
cursor --install-extension loclv.agent-md-formatter

See the VS Code Extension Guide for configuration options and setting up format-on-save.


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