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:
curl -fsSL https://agentsmarkdown.com/install.sh | sh
agmd --helpThe 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.
Use a share link
To read a document with a share link, run these commands:
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:
agmd login
agmd whoami
agmd docs listagmd 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:
agmd docs create "Release plan" -f release.mdReplace release.md with the path to your Markdown file. To edit a document with version checks, use the following commands:
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:
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_IDReplace 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:
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:
agmd events "$DOC" --jsonWait for new activity:
agmd watch "$DOC" --jsonStructured output goes to stdout. Diagnostics stay on stderr.
Configure an alternate origin
To use a local development server, set the service origin:
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:
agmd commands --json
curl -fsS https://agentsmarkdown.com/api/cli/commandsRead the generated complete CLI reference for supported commands and options.