Skip to content

AgentsMarkdown CLI ​

For people and agents using shell workflows, this guide explains how to install and use the agmd CLI to read and update documents.

Install ​

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

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

The CLI requires Node.js 20 or later. The installer verifies the published checksum and installs agmd in ${HOME}/.local/bin. It also adds agentsmarkdown as an alias.

To choose an installation directory, set AGMD_BIN_DIR before running the installer.

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 the following:

  • DOC_ID: The document ID from your share link
  • SHARE_KEY: The key from your share link

The link's role determines which operations you can perform.

Sign in for account documents ​

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

bash
agmd login
agmd whoami
agmd docs list

To search all your document titles and select a page, run this command:

bash
agmd docs list --query "release" --sort title --page 1 --page-size 24

The response includes library.total, library.pages, and the selected page. Search covers your whole account. Page sizes range from 1 to 200, with a default of 80. Sort by updated, created, or title.

agmd login starts the mere.world device flow. The CLI verifies the resulting AgentsMarkdown app-session token before saving it in local configuration.

If verification fails, the CLI exits with an error and preserves your saved configuration.

To revoke and remove the session, run agmd logout. If the broker doesn't confirm revocation, the CLI keeps the token so you can 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 the 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 document version. docs push rejects a write if the document changed after the pull.

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 the following:

  • COMMENT_ID: A comment ID returned by comments list
  • SUGGESTION_ID: A suggestion ID returned by suggestions list

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. Listing and revoking links require owner access.

Events ​

To read recorded activity, run this command:

bash
agmd events "$DOC" --json

To wait for activity, run this command:

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 ​

To inspect the versioned command manifest in the CLI or service, run the corresponding command:

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

For supported commands and options, see the generated CLI reference.

Review assignments ​

Document owners create assignments with dedicated suggest links. To create one with a stable ID for retries, run this command:

bash
agmd tasks create "$DOC" --request-id REQUEST_ID \
  --title "Check sources" --instructions "Check citations and propose corrections."

Replace REQUEST_ID with a unique value for this assignment. Reuse the value and instructions when retrying the same request. The response includes data.task.id and data.task.share.url.

For the agent, set DOC to the returned task link. To read and start the assignment, run these commands:

bash
agmd tasks get "$DOC" TASK_ID
agmd docs cat "$DOC" --json
agmd tasks start "$DOC" TASK_ID

Replace TASK_ID with the returned assignment ID. Record the version from the document read. Then post comments or suggestions using the commands in Review changes.

To submit the result, run this command:

bash
agmd tasks report "$DOC" TASK_ID --version DOCUMENT_VERSION \
  --summary "Checked citations; one correction needs review." \
  --comments COMMENT_ID --suggestions SUGGESTION_ID

Replace DOCUMENT_VERSION with the version that you reviewed. Replace the output IDs with IDs returned by your comment or suggestion requests. For multiple IDs, use comma-separated values. Omit an output flag when there are none.

If the document changes after your read, a report for its older saved version is marked stale. Unknown versions and cross-document output IDs are rejected.

The identity that started the assignment must submit its report through the same task link. To retry a submitted report, send the same version, summary, and output IDs.

As the owner, use your owner access to list and close assignments:

bash
agmd tasks list "$DOC"
agmd tasks close "$DOC" TASK_ID

The list returns up to 50 assignments. To continue, pass its nextBefore value to tasks list --before. Closing preserves the report and leaves suggestion decisions and share revocation to you.

Create and share Markdown documents with people and agents.