AgentDock

1.7k
Dock Agent Api
Examples and Workflows

Examples and Workflows

End-to-end recipes for the Dock workspace API. An agent in Claude Code, an auto-publishing CI job, a research-to-publish pipeline, and a scheduled digest.

These are full workflows, not single calls. Each one combines the documents, citations, versions, and publishing surface into something an agent or a pipeline actually does.

With the MCP server added (see MCP Server Setup), the workspace is just tools. You ask, the agent works:

"Write a short post about our new pricing and publish it."

The agent calls create_document, writes the body with write_document, and finishes with publish_document, which returns a public /p/slug URL. You never touch a command. If you want to review before it goes live, ask the agent to use suggest mode and you accept the changes in the editor first.

The same flow from a terminal with the CLI. docs create prints the new document's ID on a Created document: <id> line, so capture it and reuse it:

ID=$(agentdock docs create --title "New pricing" | grep -oE '[0-9a-f-]{36}' | head -1)
agentdock docs write "$ID" pricing-post.md
agentdock docs publish "$ID"

Turn a merge into a published changelog. In a CI job, write the generated changelog into a document and publish it:

# In your CI pipeline, after a release is tagged
agentdock docs write "$CHANGELOG_DOC_ID" CHANGELOG.md
agentdock docs publish "$CHANGELOG_DOC_ID" --slug changelog

Store the document ID and an ak_usr_ token as CI secrets. When organization tokens gain document-workspace access (coming soon), an ak_org_ token becomes the right type here because it keeps working as people join and leave the team. Every run records a version, so the changelog page has its own edit history.

An agent pipeline that produces a sourced document end to end:

  1. Research. Search for sources with agentdock docs search-citations "<topic>" (or the search_citations tool).
  2. Draft. Create a document and write the body with docs create and docs write.
  3. Cite. Add each source by its identifier: agentdock docs cite <id> 10.1145/3442188.3445922. Dock resolves the DOI, URL, PMID, or arXiv ID into a formatted citation.
  4. Style. Set the bibliography style: agentdock docs set-citation-style <id> IEEE.
  5. Publish. agentdock docs publish <id> returns the public URL.

The result is a published page with a real bibliography, every source resolved from its identifier rather than hand-typed, and a version history showing the agent built it.

A scheduled job (cron, an n8n workflow, or any scheduler) that turns a feed into a daily digest:

  1. Your scheduler pulls new items from an RSS feed.
  2. An LLM step summarizes them into markdown.
  3. The job writes that markdown into a dated document and publishes it:
TODAY=$(date +%Y-%m-%d)
agentdock docs write "$DIGEST_DOC_ID" digest.md
agentdock docs publish "$DIGEST_DOC_ID" --slug "digest-$TODAY"

Because publishing returns a stable URL, each day's digest is a real page you can link to, and the document's version history is the archive of every edition.

Any of these can run review-first instead of publishing straight away. Swap the direct write for a suggestion:

agentdock docs suggest <id> "<old text>" "<new text>"

The change waits as a tracked suggestion until a person accepts it. See Writing Modes for the full review flow.