Skip to content

agmd CLI ​

The AgentsMarkdown CLI reads and writes documents without scraping the browser. It accepts full share URLs or document IDs and can emit structured JSON for automation.

Install ​

To install the CLI and display its help, run these commands:

bash
curl -fsSL https://agentsmarkdown.com/install.sh | sh
agmd --help

The installer verifies the published checksum, installs agmd in ${AGMD_BIN_DIR:-$HOME/.local/bin}, and adds agentsmarkdown as an alias. Node.js 20 or later is required.

To read a document with a share link, run these commands:

bash
DOC='https://agentsmarkdown.com/d/DOC_ID?key=SHARE_KEY'

agmd docs info "$DOC"
agmd docs cat "$DOC"
agmd comments list "$DOC"

Replace DOC_ID with the document ID and SHARE_KEY with its share key. The role assigned to the key determines which writes are allowed.

Sign in for account documents ​

To sign in and list your account documents, run these commands:

bash
agmd login
agmd whoami
agmd docs list

agmd login starts the mere.world device flow and stores a brokered AgentsMarkdown app-session token in local CLI configuration. The CLI verifies the session before saving it. If verification fails, it exits with an error and preserves your saved configuration.

Use agmd logout to revoke and remove the session. If the broker does not confirm revocation, the CLI exits with an error and keeps the token for a retry.

Create and update documents ​

To create a document from a file, run this command:

bash
agmd docs create "Release plan" -f release.md

Replace release.md with the path to your Markdown file. To edit a document with version checks, use the following commands:

bash
agmd docs pull "$DOC" -o release.md
agmd docs push "$DOC" -f release.md --label "verified checksums"

docs pull remembers the current document version. docs push uses it to reject accidental overwrites.

Review changes ​

The following examples add comments and suggested edits:

bash
agmd comments add "$DOC" "Cite the source." --line 18
agmd comments list "$DOC"
agmd comments resolve "$DOC" COMMENT_ID

agmd suggestions add "$DOC" --replace "draft" --with "release candidate"
agmd suggestions list "$DOC"
agmd suggestions accept "$DOC" SUGGESTION_ID

Replace COMMENT_ID and SUGGESTION_ID with IDs returned by the list commands.

Share and publish ​

The following examples create, list, and revoke links, then publish the document:

bash
agmd shares create "$DOC" suggest
agmd shares list "$DOC"
agmd shares revoke "$DOC" SHARE_SECRET
agmd publish "$DOC"

Replace SHARE_SECRET with the secret of the link to revoke. Commands that revoke access or overwrite content require their documented confirmation options.

Events ​

Read current activity:

bash
agmd events "$DOC" --json

Wait for new activity:

bash
agmd watch "$DOC" --json

Structured output goes to stdout. Diagnostics stay on stderr.

Configure an alternate origin ​

To use a local development server, set the service origin:

bash
export AGENTSMARKDOWN_URL='http://localhost:6817'

AGMD_URL is the short alias. AGENTSMARKDOWN_AUTHOR and AGMD_AUTHOR set the default attribution name.

Discover the exact command contract ​

The installed CLI and production service publish the same versioned command manifest:

bash
agmd commands --json
curl -fsS https://agentsmarkdown.com/api/cli/commands

Read the generated complete CLI reference for supported commands and options.

Create and share Markdown documents with people and agents.