CLI reference
Install the monton command, sign in, and use each command to edit a workspace's docs as files, with JSON answers and exit codes.
With the monton command, you and your coding agents edit a workspace's docs as files on your computer, then send your changes back to Monton. People keep typing in the web app meanwhile, and we merge both. For comments and the inbox, connect your agent to the MCP server. With CLI 0.3.0 or later, you can also start Claude Code with Monton.
Install
The CLI needs Node 24 or newer.
npm install -g @monton/cliTo try it without installing, run npx @monton/cli wherever this page says monton. Run monton --version to see the version you have.
Sign in
monton loginWe show a link and a short code, and open the link in your browser when we can. Open the link on any device where you're signed in to Monton, such as your phone, check that it shows the same code, and connect the CLI within 10 minutes. The token never goes through the browser or the link: we fetch it from the server once you connect.
The CLI then acts as an agent of yours, with a name such as "Ana's CLI on laptop". Like every agent, it can do at most what an editor can, even in a workspace you own. You see it, and can revoke it, on the Agents page in the web app. Run monton whoami to check whose account it acts for. If the link doesn't connect, see The CLI's sign-in link doesn't connect.
To sign in with a token you made on the Agents page instead, run monton login --with-token and paste the token. In a script, pass the token on standard input, or set MONTON_TOKEN.
The config file
We keep your tokens in ~/.config/monton/config.json, or in monton/config.json under $XDG_CONFIG_HOME when you set it. Only you can read the file: we create it with mode 600 in a folder with mode 700. In it, we keep a token for each server you signed in to, with its agent's name, and the server you signed in to last. Run monton logout to remove a server's token. If the file gets damaged, delete it and sign in again.
Never paste a token into a chat or a doc. Anyone with it can act as your CLI until you revoke it.
Environment variables
MONTON_TOKEN: a token we use instead of the saved one, on whichever server the command reaches. It suits CI and other machines where nobody runsmonton login. Withmonton claude, we use the login for the chosen server.MONTON_SERVER: the server, such ashttps://monton.dev, unless a command's--servernames one. Without either, we use the server you signed in to last, thenhttps://monton.dev. In a clone, we always use the server it came from. Plainhttpworks only for this computer, such ashttp://localhost:4000.XDG_CONFIG_HOMEandHOME: where we look for the config file.
JSON answers
Add --json to a command that offers it. We then print each answer as one line of JSON on standard output, and what we say along the way on standard error, so you can read standard output alone. With monton login --json, we print two lines: the link and code first, then whom you signed in as. We list every field of each command's answer in its entry below. We may add fields to an answer, so ignore the fields you don't know. We answer monton --help and monton --version in plain text even with --json.
Exit codes
0: success.1: an error.2: a usage mistake, such as a missing argument or an unknown option, and a push too big for one without--split.3: a conflict with changes in Monton. Aftermonton push, it means we pushed nothing: runmonton pull, resolve the conflicts, then push again. We also exitmonton pullwith 3 when we leave conflicts in your files.
Errors
When a command fails with --json, we print an error answer on standard output: {"error": {...}}, with a stable code, a message that says what went wrong and what to do, and the details some codes carry. Without --json, we print the message on standard error. We list the codes each command can give in its entry below. A code that comes from Monton's API, such as rate_limited, reaches you unchanged, with the server's message; when the server answers an HTTP error without a code, the code is http_ and the status, such as http_502.
The error answer's fields:
codestringThe error's code, from the CLI's list of error codes or Monton's API.
messagestringWhat went wrong and what to do, in plain words.
commitsarray of stringsoptionalFor
monton push --split: the commits we had already pushed before the error, which are in Monton.
Any command can fail with these:
usageexit code 2The command line has a mistake: an unknown command or option, too few or too many arguments, or options that don't go together. What to do: Read the message, then run
monton <command> --helpfor the command's arguments and options.internalexit code 1Something broke that we didn't expect. The message names only the kind of error, never its details. What to do: Run the command again. If it fails the same way, tell us the command and the message.
And any command that reaches Monton can fail with an error from Monton's API:
<the server’s code>exit code 1Monton's API refused the request, such as
rate_limitedorforbidden. The error has the server's code and message, and nothing more. What to do: Read the message, which says what to do.http_<status>exit code 1The server answered with an HTTP error and no code of its own, such as
http_502. What to do: Run the command again later, and check that--servernames a Monton server.
Commands
Run monton <command> --help to see a command's help, such as monton push --help. Run status, diff, pull and push in a clone's folder or any folder inside it.
claude
Requires CLI 0.3.0 or later. Run monton --version to check your installed version. With 0.2.0, choose Connect an agent in your workspace to give Claude access to docs, comments and the inbox. We currently offer incoming delivery in the private mention pilot.
Start Claude Code with Monton tools in the current folder. Give the workspace slug from its Monton URL. The CLI uses your login for that server or opens a browser to sign in. Claude uses the same agent for reading, sending and receiving mentions.
Choose whether to receive mentions while Claude is open. To receive them, accept Claude’s channel prompt and look for “Channels (experimental)” in its startup notice. Monton confirms delivery in the debug log after Claude calls the tool to read or answer a mention. Claude keeps its usual permissions for replies and edits. When you skip receiving, you can still ask Claude to send mentions and read documents. Check the agent’s Monton inbox for incoming mentions.
Usage
monton claude [options]Options
--workspace <slug>- The workspace slug from its Monton URL.
--server <url>- The Monton server. Default: your last Claude server on a repeat launch, or your CLI server.
--receive-mentions- Choose to receive mentions.
--skip-mentions- Start with Monton tools and skip incoming mentions.
Text output
The CLI shows the workspace and the agent’s name and owner. It then opens Claude in the terminal. When Claude exits, the CLI returns its exit code.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.login_failedexit code 1Signing in failed: the server refused it, or answered something we don't know. What to do: Run
monton loginagain. If it fails again, check that--servernames a Monton server.refusedexit code 1Someone refused this sign-in in Monton. What to do: Run
monton loginagain if you meant to sign in.timeoutexit code 1Nobody connected the CLI in time after
monton loginshowed its link. What to do: Runmonton loginagain, and connect the CLI within 10 minutes.cancelledexit code 1You stopped the command while it asked you something, or cancelled signing in. What to do: Run the command again when you want to.
claude_startexit code 1We could not start Claude Code with Monton. What to do: Check your Claude Code installation and the Monton agent’s access to the workspace.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
Start from the folder where you want Claude to work:
monton claude --workspace teamStart again with the last workspace and your previous choice about incoming mentions:
monton claudeStart with document tools and skip incoming mentions:
monton claude --workspace team --skip-mentionslogin
Signs this computer in to Monton. Run it once on each computer where you or your coding agents use the CLI. We show a link and a short code and, when we can, open the link in a browser on this computer. Open the link on any device where you're signed in to Monton, such as your phone, check that it shows the same code, and connect the CLI within 10 minutes. We then save a token in the config file, and the CLI acts as an agent of yours, named after you and this computer, such as "Ana's CLI on laptop". Like every agent, it can do at most what an editor can.
With --with-token, we read a token you made on the Agents page instead, and show no link. We ask for it when you run the command in a terminal, and read it from standard input otherwise. Use it on a computer without a browser, or in a script.
A coding agent runs monton login --json, sends the link and the code from the first line to its own user in their private chat, and waits. It never asks its user for a token. We describe the whole flow in Set the CLI up for coding agents.
Usage
monton login [options]Options
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--no-browser- Show the link without opening a browser here.
--with-token- Read a token from standard input instead (make one on the Agents page in Monton).
--json- Answer in JSON.
Text output
We print the link, the code and what we're waiting for on standard error. Once you connect the CLI, we print one line on standard output: the server, the agent's name, and the person it acts for, with their email. Check that the email is yours. If we couldn't ask the server whose account it is, we say to run monton whoami.
JSON answer
The first line, before the person connects the CLI. An agent sends the link and code to its own user only.
- Either
The usual sign-in, approved from any device.
linkstringThe link to open on any device where the person is signed in to Monton.
codestringThe code that page shows, for the person to check.
expiresAtstringWhen the link stops working, in ISO 8601.
- Or
A server that doesn't offer sign-in from any device.
linkstringThe link to open in a browser on this computer.
codenullNo code to check.
thisComputerOnlytrueThe link works only in a browser on this computer.
Whom the CLI signed in as.
serverstringThe Monton server, such as
https://monton.dev.agentobjectThe agent the CLI signs in as.
idstringThe CLI's agent ID in Monton.
namestringThe CLI's agent name, such as
Ana's CLI.ownerobject or nullThe person the CLI acts for;
nullwhen we couldn't ask the server.idstringThe person's ID in Monton.
namestringThe person's name.
emailstringThe person's email address.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.invalid_tokenexit code 1monton login --with-tokenread something that isn't a Monton token, or a token the server doesn't accept: unknown, expired or revoked. What to do: Make a new token on the Agents page in Monton, or runmonton loginwithout--with-token.login_failedexit code 1Signing in failed: the server refused it, or answered something we don't know. What to do: Run
monton loginagain. If it fails again, check that--servernames a Monton server.refusedexit code 1Someone refused this sign-in in Monton. What to do: Run
monton loginagain if you meant to sign in.timeoutexit code 1Nobody connected the CLI in time after
monton loginshowed its link. What to do: Runmonton loginagain, and connect the CLI within 10 minutes.cancelledexit code 1You stopped the command while it asked you something, or cancelled signing in. What to do: Run the command again when you want to.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
Sign in, approving on a phone. We print the first line at once, and the second once Ana connects the CLI:
monton login --json{"link":"https://monton.dev/cli/authorize?code=KQWT-MBRX","code":"KQWT-MBRX","expiresAt":"2026-11-14T10:10:00.000Z"}{"server":"https://monton.dev","agent":{"id":"b33aed8f-3134-9967-03dc-39f9a7c95783","name":"Ana's CLI on laptop"},"owner":{"id":"276b6c46-92e7-8d47-99c1-2ada515bc3e4","name":"Ana","email":"ana@example.com"}}Sign in with a token from the Agents page, which we read from standard input:
monton login --with-token --json{"server":"https://monton.dev","agent":{"id":"b33aed8f-3134-9967-03dc-39f9a7c95783","name":"Ana's CLI on laptop"},"owner":{"id":"276b6c46-92e7-8d47-99c1-2ada515bc3e4","name":"Ana","email":"ana@example.com"}}Over MCP and in the web app
In the web app, on the Agents page you see every CLI you signed in, with when its token expires, and make tokens for --with-token. You sign in an MCP client when you connect it: see Connect your agent.
logout
Revokes this computer's token on the server, then removes it from the config file. Run it when you stop using the CLI on a computer, or when you find someone other than you in the answer of monton whoami. If the server had already stopped accepting the token, we remove it all the same and answer "revoked": false. If the token came from MONTON_TOKEN, we revoke it, and you unset the variable yourself.
Usage
monton logout [options]Options
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--json- Answer in JSON.
Text output
One line: the server we signed you out of, and whether we revoked its token.
JSON answer
The server we signed out of.
serverstringThe Monton server, such as
https://monton.dev.revokedbooleanWe revoked the token;
falsewhen the server had already stopped accepting it.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
monton logout --json{"server":"https://monton.dev","revoked":true}Over MCP and in the web app
On the Agents page in the web app, you can revoke any of your CLIs and agents, including one on a computer you no longer have.
whoami
Shows the agent the CLI signs in as on this server, and the person it acts for. Run it after monton login to check that the CLI acts for you: someone could send you a link with which you'd connect the CLI to their own account. A coding agent checks that the email is its user's, and if it isn't, runs monton logout and tells its user.
Usage
monton whoami [options]Options
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--json- Answer in JSON.
Text output
One line with the server, the agent's name, and the person's name and email, then the day the token expires, if it does.
JSON answer
The CLI's agent and the person it acts for.
serverstringThe Monton server, such as
https://monton.dev.agentobjectThe agent the CLI acts as.
idstringThe CLI's agent ID in Monton.
namestringThe CLI's agent name.
expiresAtanyWhen its token expires, in ISO 8601;
nullfor never.ownerobjectThe person whose account the CLI acts for.
idstringThe person's ID in Monton.
namestringThe person's name.
emailstringThe person's email address.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
monton whoami --json{"server":"https://monton.dev","agent":{"id":"b33aed8f-3134-9967-03dc-39f9a7c95783","name":"Ana's CLI on laptop","expiresAt":"2027-02-12T10:00:00.000Z"},"owner":{"id":"276b6c46-92e7-8d47-99c1-2ada515bc3e4","name":"Ana","email":"ana@example.com"}}Over MCP and in the web app
On the Agents page in the web app, you see the CLI's agent, with when its token expires.
workspaces
Lists the workspaces your CLI agent can reach on the server, with its role in each. You can limit the CLI agent to selected workspaces on the Agents page. Use it to find a workspace's slug for monton clone or monton import --workspace. The CLI acts as an agent, so we show its role as editor at most, even in a workspace you own. A workspace where someone shared only a folder or a doc with you has no role: we show guest and, with --json, the workspace's owner.
Usage
monton workspaces [options]Options
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--json- Answer in JSON.
Text output
A table with a row per workspace: its slug, your role and its name. If you can't reach any workspace yet, we say so.
JSON answer
The workspaces you can reach.
workspacesarray of objectsThe workspaces the person can reach.
- Either
A workspace the person is a member of.
idstringThe workspace's ID.
slugstringThe workspace's slug, as in its address.
namestringThe workspace's name.
rolestringThe person's role in it. The CLI acts as an agent, so it acts at most as editor. One of
owner,editor,commenter,viewer.- Or
A workspace where someone shared a folder or a doc with the person.
idstringThe workspace's ID.
slugstringThe workspace's slug, as in its address.
namestringThe workspace's name.
rolenullNo role: someone shared a folder or a doc in it with the person.
access"guest"The person is a guest.
ownerobject or nullWhose workspace it is.
namestringThe owner's name.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
monton workspaces --json{"workspaces":[{"id":"742523da-ef59-db4b-7184-09f46de05d0c","slug":"acme","name":"Acme","role":"editor"}]}Over MCP and in the web app
Your MCP agent can list its own workspaces with list_workspaces. In the web app, the menu at the top of the sidebar lists the workspaces you can reach.
import
Imports a folder of docs from your computer into a workspace, as one commit. We take the markdown, HTML and text files in it (.md, .markdown, .mdx, .html, .txt) and leave out hidden files and folders, .git, node_modules and build output folders. We never overwrite a doc: we skip each file whose doc already exists. Use it to bring docs into Monton once; to keep editing them as files, monton clone the workspace afterwards.
We first upload the folder for a preview and show what we would import and skip. Then we ask before we import anything, unless you pass --yes. With --dry-run, we stop after the preview. Without a terminal to ask in, pass one of the two. Each import and each dry run counts toward the 10 imports an hour. We take at most 25 MiB of files in one import. We explain each reason we skip a file in An import left out some files.
Without --workspace, we import into the only workspace you can edit, or ask you to pick one. To import into a folder someone shared with you, name its workspace with --workspace and the folder with --to.
Usage
monton import <folder> [options]Arguments
<folder>- The folder on your computer to import.
Options
--workspace <slug>- The workspace. Default: the only one you can edit, or we ask.
--to <folder>- The folder in the workspace to import into. Default: the top level.
--dry-run- Show what we would import and skip, then stop without importing.
-y, --yes- Import without asking first (with --dry-run, a usage error).
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--json- Answer in JSON.
Text output
On standard error, the docs we would import and the files we would skip, with the reason for each, and the files we left out before uploading. Then one line on standard output: how many docs we imported, and the commit.
JSON answer
What we imported, or would import.
- Either
A preview: a dry run, nothing to import, or an import you declined.
workspacestringThe workspace's slug, as in its address.
folderstringThe folder in the workspace; empty for the top level.
previewobjectWhat we would import and skip.
idstringThe import's ID.
statusstringThe import's state, such as
previewedordone.viastringHow the files came in:
linkfor the CLI,webfor the web app.dryRunbooleanA dry run, which imports nothing.
folderstringThe folder in the workspace we import into; empty for the top level.
sourceanyThe name of the folder you imported.
strippedFolderanyA top-level folder that held everything, which we left out of the paths.
commitstring or nullThe import's commit, once it made one.
importedarray of stringsThe docs we imported, or would import.
skippedarray of objectsThe files we skipped, or would skip, and why.
namestringThe file's path in the folder.
reasonstringWhy we skipped it, such as
existsorother-type.pathstringoptionalWhere it would have gone in the workspace.
detailstringoptionalMore about the reason.
skippedLeftOutnumberHow many more files we skipped than
skippedlists.imagesobject or nullThe images in the docs;
nulluntil the import finishes, or without images.importedarray of stringsThe images we imported, by their paths in the folder.
refusedarray of objectsImages we didn't import.
namestringThe image's path in the folder.
reasonstringWhy we didn't import it.
countsobject or nullHow many files we imported and skipped;
nulluntil the import finishes.importednumberDocs imported.
skippednumberFiles skipped.
byReasonobject of numbersFiles skipped, by reason.
errorobject or nullWhy the import failed, if it did.
codestringThe error's code.
messagestringWhat went wrong.
createdAtstringWhen the import started, in ISO 8601.
finishedAtanyWhen it finished, in ISO 8601.
expiresAtanyWhen a preview stops working, in ISO 8601.
importedfalseoptionalfalseafter--dry-run, or when you said no; absent when there was nothing to import.- Or
A finished import.
workspacestringThe workspace's slug, as in its address.
folderstringThe folder in the workspace; empty for the top level.
importobjectWhat we imported and skipped. It has the same fields as
previewabove.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.no_workspaceexit code 1You can't reach the workspace you named, or you can't import into any workspace: that needs the editor or owner role, or a folder someone shared with you as editor. What to do: Run
monton workspacesto list yours. To import into a folder someone shared with you, name its workspace with--workspaceand the folder with--to.not_a_folderexit code 1The path you gave
monton importormonton cloneisn't a folder. What to do: Check the path, then run the command again.too_many_filesexit code 1The folder has more files than one import takes. The message gives the numbers. What to do: Import a smaller folder, such as each of its folders in turn.
too_largeexit code 1The folder's files add up to more than 25 MiB, the most one import takes. What to do: Import a smaller folder, such as each of its folders in turn.
no_docsexit code 1The folder has no markdown, HTML or text files to import. What to do: Check that you named the right folder.
import_failedexit code 1The import failed, and the server didn't say why. When it says why, the error has the server's code instead. What to do: Run the import again. Add
--dry-runto see what we would import first.import_not_previewedexit code 1The server didn't keep the import as a preview, so we stopped without importing anything. What to do: Run the import again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
A dry run, to see what we would import:
monton import ./handbook --workspace acme --to handbook --dry-run --json{"workspace":"acme","folder":"handbook","preview":{"id":"bfdc5e9e-d767-7cdc-3511-d2da65334486","status":"previewed","via":"web","dryRun":true,"folder":"handbook","source":"handbook","strippedFolder":null,"commit":null,"images":null,"imported":["handbook/onboarding.md","handbook/policies/leave.md"],"skipped":[],"skippedLeftOut":0,"counts":{"imported":2,"skipped":0,"byReason":{}},"error":null,"createdAt":"2026-11-14T10:00:00.000Z","finishedAt":null,"expiresAt":"2026-11-14T10:15:00.000Z"},"imported":false}The import itself, without asking:
monton import ./handbook --workspace acme --to handbook --yes --json{"workspace":"acme","folder":"handbook","import":{"id":"b2fd918e-5350-530b-becd-c00810ead42c","status":"done","via":"web","dryRun":false,"folder":"handbook","source":"handbook","strippedFolder":null,"commit":"9c0abe51c6e6655d81de2d044d4fb194931f058c0426c67c7285d8f5657ed64a","images":null,"imported":["handbook/onboarding.md","handbook/policies/leave.md"],"skipped":[],"skippedLeftOut":0,"counts":{"imported":2,"skipped":0,"byReason":{}},"error":null,"createdAt":"2026-11-14T10:00:00.000Z","finishedAt":"2026-11-14T10:00:01.000Z","expiresAt":null}}Over MCP and in the web app
Over MCP, an agent calls start_import to give you a link to the web app's import page, where you drop a folder or a zip file, and get_import to see what came in. An agent with a few docs at hand sends them with create_docs instead.
clone
Copies a workspace into a new folder on your computer, so you and your coding agents can edit its docs as files. We create the folder, named after the workspace unless you name it, and check out the docs an import would take. We leave a file already at a doc's path as it is, as your version of that doc, and we list it in differs. On a Monton server with images on, we put the images the docs use in attachments/ at the folder's root; we don't take images on monton.dev yet.
Afterwards, run every other command in that folder or a folder inside it. We explain what we keep in the clone in How clone, pull and push work together.
Usage
monton clone <workspace> [folder] [options]Arguments
<workspace>- The workspace to clone, by its slug or its ID.
[folder]optional- The folder to clone into, which we create if needed. By default, a folder named after the workspace in the current folder.
Options
--server <url>- The Monton server. Default: the last one you signed in to, or monton.dev.
--json- Answer in JSON.
Text output
One line with the workspace, the folder and the commit we checked out, then the docs we didn't check out, the files that differ from Monton's text, and the images we fetched or couldn't.
JSON answer
What we checked out.
workspacestringThe workspace's slug, as in its address.
serverstringThe Monton server, such as
https://monton.dev.folderstringThe folder we cloned into, as you gave it or named after the workspace.
commitstring or nullThe commit we checked out;
nullfor a workspace with none.docsnumberHow many docs we checked out.
notCheckedOutarray of objectsThe docs in Monton that we didn't check out, and why.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.blobstringThe hash of the doc's text at Monton's head.
reasonstringWhy: a hidden file or folder, inside a tool folder such as
node_modules, not markdown, HTML or text, a name we never write on disk, over 1 MiB, a file of yours in the way, or the disk refused it. One ofhidden,excluded,other-type,invalid-name,too-large,in-the-way,write-failed.blockedBystringoptionalFor
in-the-way: the file in the way.differsarray of stringsFiles that were in the folder already with text other than Monton's. We kept them; a push would send them.
conflictsarray of objectsThe docs with conflict markers from a pull, to resolve before you push.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringoptionalThe doc's file, when it isn't at
path.linesarray of objectsWhere the conflict markers are.
startnumberThe first line of the conflict, from 1.
endnumberIts last line.
imagesobjectThe images the docs use that we fetched into
attachments/.fetchedarray of stringsThe image files we added to
attachments/.failedarray of objectsImages we couldn't add.
filestringThe image file.
whystringWhy we couldn't add it.
laterbooleanA later pull may get it.
Errors
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.no_workspaceexit code 1You can't reach the workspace you named, or you can't import into any workspace: that needs the editor or owner role, or a folder someone shared with you as editor. What to do: Run
monton workspacesto list yours. To import into a folder someone shared with you, name its workspace with--workspaceand the folder with--to.already_a_cloneexit code 1The folder you gave
monton cloneis a clone already, or inside one. What to do: Clone into another folder, or runmonton pullin that clone.not_a_folderexit code 1The path you gave
monton importormonton cloneisn't a folder. What to do: Check the path, then run the command again.damaged_folderexit code 1A file in the clone's
.montonfolder is damaged or missing. What to do: Clone the workspace again into a new folder, and copy your changes over.bad_answerexit code 1The server answered something we can't read. We didn't change anything. What to do: Run the command again. If it fails the same way, update the CLI.
missing_textsexit code 1The server couldn't find some of the texts we asked for, or we lost track of one during a pull. We didn't change anything. What to do: Run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
monton clone acme --json{"workspace":"acme","server":"https://monton.dev","folder":"/Users/ana/acme","commit":"d0f631ca1ddba8db3bcfcb9e057cdc98d0379f1bee00e75a545147a27dadd982","docs":3,"notCheckedOut":[],"differs":[],"conflicts":[],"images":{"fetched":[],"failed":[]}}Over MCP and in the web app
There is no clone over MCP: an agent reads and writes one doc at a time with read_doc and write_doc, and lists the docs with get_tree.
status
Shows your changes to push: the docs you modified, renamed, created and deleted since your last pull or push, the files with conflict markers, the files a push can't take, and the docs we didn't check out. You can run it offline. With --remote, we also ask Monton what changed there since your last pull, without changing your files.
Run it before you push, and show it to the person you work for before a push that deletes or moves many docs.
Usage
monton status [options]Options
--remote- Also show what changed in Monton since your last pull.
--json- Answer in JSON.
Text output
The workspace, its server and the commit you last pulled, then a line per change under "Changes to push", such as modified: plans/q3.md, and lists of the files with conflict markers, the files a push can't take and the docs we didn't check out. With --remote, the changes in Monton follow.
JSON answer
Your changes to push.
workspacestringThe workspace's slug, as in its address.
serverstringThe Monton server, such as
https://monton.dev.commitstring or nullThe commit you last pulled;
nullbefore the first.changesarray of objectsYour changes to push.
- Either
A file that a push creates as a new doc.
kind"new"A new doc.
pathstring or nullThe new doc's path in Monton;
nullwhen Monton doesn't allow its name.diskstringThe file's path on disk, from the clone's root, with
/between folders.- Or
A doc whose file you deleted, which a push deletes in Monton.
kind"deleted"A deleted doc.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe deleted doc's path in Monton.
- Or
A doc whose text you changed.
kind"modified"A doc with new text.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringoptionalThe doc's file, when it isn't at
path.- Or
A doc whose file you renamed or moved.
kind"renamed"A renamed or moved doc.
fileIdstringA doc's ID in Monton, which stays when it moves.
fromstringThe doc's path in Monton before.
pathstring or nulloptionalIts new path in Monton;
nullwhen Monton doesn't allow the new name.diskstringoptionalWhere its file is now.
modifiedbooleanYou changed its text as well.
conflictsarray of objectsFiles with conflict markers, which a push refuses.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringThe file's path on disk, from the clone's root, with
/between folders.fileIdstringoptionalA doc's ID in Monton, which stays when it moves.
cantPusharray of objectsFiles a push can't take.
diskstringThe file's path on disk, from the clone's root, with
/between folders.pathstringoptionalThe synced doc's path in Monton, for a synced doc.
reasonstringWhy: its bytes aren't UTF-8 text, it's over 1 MiB, or Monton doesn't allow its name. One of
not-utf8,too-large,invalid-name.notCheckedOutarray of objectsThe docs in Monton that we didn't check out, and why.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.blobstringThe hash of the doc's text at Monton's head.
reasonstringWhy: a hidden file or folder, inside a tool folder such as
node_modules, not markdown, HTML or text, a name we never write on disk, over 1 MiB, a file of yours in the way, or the disk refused it. One ofhidden,excluded,other-type,invalid-name,too-large,in-the-way,write-failed.blockedBystringoptionalFor
in-the-way: the file in the way.remotearray of objectsoptionalWith
--remote: what changed in Monton since your last pull.- Either
A doc whose text someone changed in Monton.
kind"modified"Someone changed its text.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.basestringThe hash of the doc's text when you last pulled it.
blobstringThe hash of its text in Monton now.
- Or
A doc someone renamed or moved in Monton.
kind"renamed"Someone renamed or moved it.
fileIdstringA doc's ID in Monton, which stays when it moves.
fromstringIts path when you last pulled it.
pathstringIts path in Monton now.
basestringThe hash of the doc's text when you last pulled it.
blobstringThe hash of its text in Monton now.
- Or
A doc someone deleted in Monton.
kind"deleted"Someone deleted it.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.basestringThe hash of the doc's text when you last pulled it.
- Or
A doc someone created in Monton.
kind"new"Someone created it.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.blobstringThe hash of its text in Monton.
Errors
not_a_cloneexit code 1The command needs a clone, and the current folder isn't one, nor inside one. What to do: Run it in a folder you made with
monton clone, or clone the workspace first.damaged_folderexit code 1A file in the clone's
.montonfolder is damaged or missing. What to do: Clone the workspace again into a new folder, and copy your changes over.lockedexit code 1Another monton command is running in this clone. What to do: Wait for it to finish. If none is running, delete the lock file the message names.
pull_unfinishedexit code 1A pull in this clone stopped before it finished. What to do: Run
monton pullto finish it, then run your command again.configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.bad_answerexit code 1The server answered something we can't read. We didn't change anything. What to do: Run the command again. If it fails the same way, update the CLI.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
After Ana edits plans/q3.md, writes notes/retro.md and deletes notes/standup.md:
monton status --json{"workspace":"acme","server":"https://monton.dev","commit":"d0f631ca1ddba8db3bcfcb9e057cdc98d0379f1bee00e75a545147a27dadd982","changes":[{"kind":"new","path":"notes/retro.md","disk":"notes/retro.md"},{"kind":"deleted","fileId":"53d03498-d810-0458-482f-b457c786f38e","path":"notes/standup.md"},{"kind":"modified","fileId":"68fd4ab1-e3b5-5706-88b4-f14d5a3080ab","path":"plans/q3.md"}],"conflicts":[],"cantPush":[],"notCheckedOut":[]}Over MCP and in the web app
Over MCP, an agent lists the changes in a workspace with get_history. In the web app, you see them in History.
diff
Shows your changes as a unified diff against what you last pulled or pushed, for every doc or only for the docs at or under a path. You can run it offline. With --remote, we show Monton's changes since your last pull instead, without changing your files. Use it to check your changes before you push, or to see what you'd get from a pull.
Usage
monton diff [path] [options]Arguments
[path]optional- A doc or folder in the clone, relative to the current folder. By default, every doc.
Options
--remote- Show Monton's changes since your last pull instead.
--json- Answer in JSON.
Text output
A unified diff for each doc, in the format of git diff, with the doc's path in Monton in each file header.
JSON answer
Your changes, or Monton's with --remote, as diffs.
remotebooleanWith
--remote: the diffs are Monton's changes since your last pull.diffsarray of objectsEach doc's diff.
kindstringWhat changed. One of
modified,renamed,deleted,new.fromstring or nullThe path before;
nullfor a new doc.tostring or nullThe path after;
nullfor a deleted doc.linesarray of stringsThe unified diff's lines, without the file header.
addednumberLines added.
removednumberLines removed.
Errors
not_a_cloneexit code 1The command needs a clone, and the current folder isn't one, nor inside one. What to do: Run it in a folder you made with
monton clone, or clone the workspace first.damaged_folderexit code 1A file in the clone's
.montonfolder is damaged or missing. What to do: Clone the workspace again into a new folder, and copy your changes over.lockedexit code 1Another monton command is running in this clone. What to do: Wait for it to finish. If none is running, delete the lock file the message names.
pull_unfinishedexit code 1A pull in this clone stopped before it finished. What to do: Run
monton pullto finish it, then run your command again.configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.bad_answerexit code 1The server answered something we can't read. We didn't change anything. What to do: Run the command again. If it fails the same way, update the CLI.
missing_textsexit code 1The server couldn't find some of the texts we asked for, or we lost track of one during a pull. We didn't change anything. What to do: Run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
After Ana adds a line to plans/q3.md:
monton diff plans/q3.md --json{"remote":false,"diffs":[{"kind":"modified","from":"plans/q3.md","to":"plans/q3.md","lines":["@@ -2,3 +2,4 @@"," "," - Ship the docs site"," - Hire a designer","+- Plan the offsite"],"added":1,"removed":0}]}Over MCP and in the web app
Over MCP, an agent sees how a doc changed between two versions with get_diff. In the web app, you see each change in History.
pull
Brings Monton's changes into your files: new, edited, renamed, moved and deleted docs. We merge them with your changes since your last pull. Where you and someone in Monton changed the same lines, we write conflict markers into the file and exit with 3; see Conflicts to resolve them. On a Monton server with images on, we also fetch the images the docs use that attachments/ doesn't hold yet; we don't take images on monton.dev yet.
Pull before you start work, and again before a long task: people edit in Monton all the time. If a pull stops halfway, run it again to finish it; until then, we refuse to run status, diff and push in the clone.
Usage
monton pull [options]Options
--json- Answer in JSON.
Text output
One line with the commit we pulled and how many docs changed, were renamed, are new or were deleted, or that you were already up to date. Then a line for each doc that needs you, such as one you deleted that someone changed in Monton, the conflicts to resolve with their lines, and the images we fetched or couldn't.
JSON answer
What we brought into your files. Exits with 3 when it left conflicts.
commitstring or nullThe commit we pulled.
unchangedbooleanMonton's head was still the commit you last pulled.
docsarray of objectsThe docs the pull changed.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringoptionalThe doc's file, when it isn't at
path.outcomestringWhat the pull did to the doc. One of
unchanged,changed,added,deleted,restored,untracked,renamed-both,deleted-locally,left-out,blocked,skipped.textstringWhat the file holds now: your text, Monton's, a merge, or a merge with conflict markers. One of
kept,monton,merged,conflicted.whystringoptionalWhy we skipped the doc. One of
in-the-way,invalid-local-name,unresolved-conflict.blockedBystringoptionalWhat is in the way.
conflictsarray of objectsThe docs with conflict markers from a pull, to resolve before you push.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringoptionalThe doc's file, when it isn't at
path.linesarray of objectsWhere the conflict markers are.
startnumberThe first line of the conflict, from 1.
endnumberIts last line.
skippedarray of objectsFiles we left as they were.
fileIdstringA doc's ID in Monton, which stays when it moves.
diskstringThe file's path on disk, from the clone's root, with
/between folders.reasonstringoptionalWhy we left the file as it was: it changed while we pulled, something is in the way, or the disk refused. One of
changed,in-the-way,write-failed.blockedBystringoptionalWhat is in the way.
keptAsstringoptionalWhere we put your copy of a doc we could not move.
notCheckedOutarray of objectsThe docs in Monton that we didn't check out, and why.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.blobstringThe hash of the doc's text at Monton's head.
reasonstringWhy: a hidden file or folder, inside a tool folder such as
node_modules, not markdown, HTML or text, a name we never write on disk, over 1 MiB, a file of yours in the way, or the disk refused it. One ofhidden,excluded,other-type,invalid-name,too-large,in-the-way,write-failed.blockedBystringoptionalFor
in-the-way: the file in the way.imagesobjectThe images the docs use that we fetched into
attachments/.fetchedarray of stringsThe image files we added to
attachments/.failedarray of objectsImages we couldn't add.
filestringThe image file.
whystringWhy we couldn't add it.
laterbooleanA later pull may get it.
Errors
not_a_cloneexit code 1The command needs a clone, and the current folder isn't one, nor inside one. What to do: Run it in a folder you made with
monton clone, or clone the workspace first.damaged_folderexit code 1A file in the clone's
.montonfolder is damaged or missing. What to do: Clone the workspace again into a new folder, and copy your changes over.lockedexit code 1Another monton command is running in this clone. What to do: Wait for it to finish. If none is running, delete the lock file the message names.
configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.bad_answerexit code 1The server answered something we can't read. We didn't change anything. What to do: Run the command again. If it fails the same way, update the CLI.
missing_textsexit code 1The server couldn't find some of the texts we asked for, or we lost track of one during a pull. We didn't change anything. What to do: Run the command again.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
After someone adds a line to README.md in Monton:
monton pull --json{"commit":"7c1c97df17c066924822b0af09a65251554962c61e23329aed04cd19020dc3b8","unchanged":false,"docs":[{"fileId":"04c6e90f-aac2-675a-a89e-2176d2eec7d8","path":"README.md","outcome":"changed","text":"monton"}],"conflicts":[],"skipped":[],"notCheckedOut":[],"images":{"fetched":[],"failed":[]}}Over MCP and in the web app
Over MCP, an agent reads the latest text of one doc with read_doc. In the web app, you always see it.
push
Sends your changes to Monton as one commit: edited, new, renamed, moved and deleted docs. We merge them with what people typed since your last pull, so you never overwrite their work, and we leave your files as they are: run monton pull afterwards to see the merged text. With -m, you write the commit's message; otherwise we list what changed.
If your changes conflict with Monton's, we push nothing and exit with 3: run monton pull, resolve the conflicts, then push again. We also push nothing while a file has conflict markers, while a file can't go to Monton, or when you delete more than 5 docs without --allow-deletes, or your changes are bigger than one push may be without --split. We explain these two flags in Many deletes and big pushes.
We don't take images on monton.dev yet: there, when a doc gains a link to an image file in the folder, we push nothing and stop with image_refused. On a Monton server with images on, to add an image, put the PNG, JPEG, GIF or WebP file in the folder, link it from a doc by a relative path, and push: we upload it first, then point the link at its copy in attachments/. That's the only change we make to your files when you push. We explain more in Images in a clone.
Usage
monton push [options]Options
-m, --message <text>- The commit's message. Default: a list of what changed.
--allow-deletes- Push even if it deletes more than 5 docs.
--split- Send a push too big for one (over 200 docs to write, 2 MiB of text, or 2,000 renames, moves and deletes) as several commits.
--json- Answer in JSON.
Text output
One line with how many changes we pushed and the commit, or the commits with --split. Then the images we uploaded, the links to images we left as they were, and the docs we merged with changes in Monton.
JSON answer
What we sent to Monton.
- Either
Nothing to push.
commitnullNo commit.
pushedarray of objectsEmpty.
- Either
A file that a push creates as a new doc.
kind"new"A new doc.
pathstring or nullThe new doc's path in Monton;
nullwhen Monton doesn't allow its name.diskstringThe file's path on disk, from the clone's root, with
/between folders.- Or
A doc whose file you deleted, which a push deletes in Monton.
kind"deleted"A deleted doc.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe deleted doc's path in Monton.
- Or
A doc whose text you changed.
kind"modified"A doc with new text.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringThe doc's path in Monton, such as
plans/q3.md.diskstringoptionalThe doc's file, when it isn't at
path.- Or
A doc whose file you renamed or moved.
kind"renamed"A renamed or moved doc.
fileIdstringA doc's ID in Monton, which stays when it moves.
fromstringThe doc's path in Monton before.
pathstring or nulloptionalIts new path in Monton;
nullwhen Monton doesn't allow the new name.diskstringoptionalWhere its file is now.
modifiedbooleanYou changed its text as well.
- Or
What we pushed.
commitsarray of stringsThe commits we made: one, or several with
--split.commitstring or nullThe last commit;
nullwhen the push changed nothing in Monton.pushedarray of objectsThe changes we pushed. It has the same fields as
pushedabove.mergedarray of stringsDocs with changes in Monton since your last pull, which we merged with yours.
partsnumberHow many pushes we sent: 1, or more with
--split.imagesobjectThe images the pushed docs link to.
uploadedarray of objectsImages we uploaded.
pathstringThe image's path on disk, from the clone's root.
urlstringThe image's link in Monton.
reusedarray of objectsImages Monton already had, which we linked again.
pathstringThe image's path on disk, from the clone's root.
urlstringThe image's link in Monton.
missingarray of objectsLinks to images we didn't upload, which we left as they were.
docstringThe doc with the link.
pathstringThe image the link names.
whystringThe image isn't there, or is in a hidden folder. One of
missing,hidden.
Errors
not_a_cloneexit code 1The command needs a clone, and the current folder isn't one, nor inside one. What to do: Run it in a folder you made with
monton clone, or clone the workspace first.damaged_folderexit code 1A file in the clone's
.montonfolder is damaged or missing. What to do: Clone the workspace again into a new folder, and copy your changes over.lockedexit code 1Another monton command is running in this clone. What to do: Wait for it to finish. If none is running, delete the lock file the message names.
pull_unfinishedexit code 1A pull in this clone stopped before it finished. What to do: Run
monton pullto finish it, then run your command again.configexit code 1We couldn't read the CLI's config file, or it isn't valid JSON, or it isn't a Monton config. The message names the file. What to do: Fix the file, or delete it and run
monton loginagain.not_signed_inexit code 1The CLI has no token for this server, or the server doesn't accept it any more: it expired or someone revoked it. What to do: Run
monton login. An agent runsmonton login --jsonand sends its user the link and code from the first line.networkexit code 1We couldn't reach the server. What to do: Check the address in
--serverorMONTON_SERVERand your connection, then run the command again.bad_answerexit code 1The server answered something we can't read. We didn't change anything. What to do: Run the command again. If it fails the same way, update the CLI.
missing_textsexit code 1The server couldn't find some of the texts we asked for, or we lost track of one during a pull. We didn't change anything. What to do: Run the command again.
unresolved_conflictsexit code 3Some files still have conflict markers from a pull, so we pushed nothing. What to do: In each file, keep what should stay and delete the marker lines, then push again.
pathsarray of stringsThe files with conflict markers, by their paths in Monton.
cant_pushexit code 1Some files can't go to Monton: their bytes aren't UTF-8 text, they're over 1 MiB, or Monton doesn't allow their names. We pushed nothing. What to do: Fix or rename each file, or move it out of the clone, then push again.
filesarray of objectsThe files a push can't take.
diskstringThe file's path on disk, from the clone's root, with
/between folders.pathstringoptionalThe synced doc's path in Monton, for a synced doc.
reasonstringWhy: its bytes aren't UTF-8 text, it's over 1 MiB, or Monton doesn't allow its name. One of
not-utf8,too-large,invalid-name.too_many_deletesexit code 1The push would delete more than 5 docs, so we pushed nothing. What to do: Check the deletes with
monton status. If you mean them, runmonton push --allow-deletes.deletesarray of objectsThe docs the push would delete. It has the same fields as
pushedabove.doc_too_largeexit code 1Some docs have more than 2 MiB of text, the most one push takes, so we pushed nothing. What to do: Make each of those docs smaller, or split it into several docs.
pathsarray of stringsThe docs over 2 MiB.
push_too_largeexit code 2The push holds more than one push may: over 200 docs to write, 2 MiB of text, or 2,000 renames, moves and deletes. We pushed nothing. What to do: Push fewer changes at a time, or run
monton push --splitto send them as several commits.limitsobjectWhat one push may hold.
writtenDocsnumberThe most docs one push may write.
textBytesnumberThe most bytes of text one push may hold.
treeChangesnumberThe most renames, moves and deletes one push may hold.
countsobjectWhat this push holds.
docsnumberThe docs this push writes.
bytesnumberThe bytes of text this push holds.
treeChangesnumberThe renames, moves and deletes this push holds.
images_busyexit code 1Monton can't tell us right now whether it still has an image an earlier push uploaded, so we pushed nothing. What to do: Push again after
retryAfterseconds.pathstringThe image's path on disk, from the clone's root.
retryAfternumberHow many seconds to wait before you push again.
image_refusedexit code 1Monton didn't take an image a doc links to, or we couldn't read the image, so we pushed nothing. What to do: Read the message, then fix or replace the image and push again. Monton takes PNG, JPEG, GIF and WebP files up to 10 MB.
pathstringThe image's path on disk, from the clone's root.
serverCodestringoptionalWhen Monton refused the upload: the server's code, or an empty string.
statusnumberoptionalWhen Monton refused the upload: the answer's HTTP status.
unknown_baseexit code 1Monton doesn't know the versions some of your docs started from, so we pushed nothing. What to do: Run
monton pull, then push again.fileIdsarray of stringsThe docs whose base version Monton lacks.
commitsarray of stringsoptionalFor
monton push --split: the commits we had already pushed before the error, which are in Monton.conflictexit code 3Your changes conflict with changes someone made in Monton since your last pull, so we pushed nothing. What to do: Run
monton pull, resolve the conflicts it marks, then push again.conflictsarray of objectsWhat conflicts.
kindstringWhat conflicts:
contentfor the same lines changed on both sides, or a change to the tree such as a move onto a path someone took.pathstring or nullThe path in Monton the conflict is about, if any.
fileIdstringoptionalA doc's ID in Monton, which stays when it moves.
deletedBystringoptionalFor a doc one side deleted while the other changed it: who deleted it, this push or someone in Monton. One of
push,monton.commitsarray of stringsoptionalFor
monton push --split: the commits we had already pushed before the error, which are in Monton.history_pendingexit code 1Your edits are in Monton, but we couldn't save them as a commit, so your renames, new docs and deletes didn't happen. What to do: Push again to send the renames, new docs and deletes.
editedarray of objectsThe docs whose edits are in Monton.
fileIdstringA doc's ID in Monton, which stays when it moves.
versionstringThe version of the text we pushed.
mergedbooleanMonton had changes to this doc since your last pull, which we merged.
notAppliedobjectThe changes to the tree that didn't happen.
movesarray of objectsRenames and moves that didn't happen.
fileIdstringA doc's ID in Monton, which stays when it moves.
pathstringWhere the push moved it.
createsarray of stringsNew docs we didn't create.
deletesarray of stringsDocs we didn't delete.
commitsarray of stringsoptionalFor
monton push --split: the commits we had already pushed before the error, which are in Monton.
Besides these, it can fail with usage or internal, as any command can, or with an error from Monton's API.
Examples
After Ana adds a line to plans/q3.md:
monton push -m "Plan the offsite" --json{"commits":["9c0abe51c6e6655d81de2d044d4fb194931f058c0426c67c7285d8f5657ed64a"],"commit":"9c0abe51c6e6655d81de2d044d4fb194931f058c0426c67c7285d8f5657ed64a","pushed":[{"kind":"modified","fileId":"68fd4ab1-e3b5-5706-88b4-f14d5a3080ab","path":"plans/q3.md"}],"merged":[],"parts":1,"images":{"uploaded":[],"reused":[],"missing":[]}}After Ana and someone in Monton change the same line of notes/standup.md, the push fails with exit code 3:
monton push --json{"error":{"conflicts":[{"kind":"content","fileId":"53d03498-d810-0458-482f-b457c786f38e","path":"notes/standup.md"}],"code":"conflict","message":"We didn't push anything: 1 doc conflicts with changes in Monton since your last pull.\n notes/standup.md: you and someone in Monton changed the same lines.\nRun `monton pull` to merge those changes into your files, resolve the conflicts, then push again."}}Over MCP and in the web app
Over MCP, an agent changes one doc at a time with edit_doc and write_doc, and we merge a write with changes since its base version as we do a push. People edit in the web app, and we save as they type.
help agents
Prints a short guide for coding agents: how to sign in, pull before work, edit files, push, resolve conflicts, add images and import, and when to ask their user first. Paste it into your coding agents' instructions, such as a repo's AGENTS.md or CLAUDE.md, or give them the monton-cli skill, with which they learn to use the CLI and Monton's MCP tools together.
Run monton help <command> to see a command's help, as with monton <command> --help.
Usage
monton help agents [options]Options
--json- Answer in JSON.
Text output
The guide, in markdown.
JSON answer
The guide to paste into your coding agents' instructions.
guidestringThe guide for coding agents, in markdown.
Errors
Besides these, it can fail with usage or internal, as any command can.
Examples
We cut the guide short here:
monton help agents --json{"guide":"# Working in a Monton clone\n\nThis folder is a clone of a Monton workspace…"}How clone, pull and push work together
With monton clone, you make a folder that we keep in step with a workspace. You and your coding agents edit its docs as files, send your changes with monton push, and bring in what people and other agents changed in Monton with monton pull. Pull before you start, push when you're done, and pull again to see the merged text.
The folder
We check out each doc an import would take: .md, .markdown, .mdx, .html and .txt files up to 1 MiB, outside hidden folders and tool folders such as node_modules, with names we can write on your disk. We never write any other kind of file, so nobody can plant a script or a tool's settings on your computer through a workspace, and we never write outside the folder or follow links. Files of yours that aren't docs, such as code or notes in other formats, stay yours: we never read, push or delete them. Run monton status to see the docs we didn't check out, and why.
In the .monton folder at the clone's root, we keep the workspace and server the clone came from, the version of each doc you last pulled or pushed, and a copy of those versions, so you can run status and diff offline. Leave it as it is; if it gets damaged, clone the workspace again. We keep no token there.
Merges
We keep each doc's ID when someone renames or moves it, so we match docs by ID, not by path. When you push, we merge your changes with what people typed since your last pull, doc by doc, starting from the version each file started from, as write_doc does over MCP. We apply a push all at once or not at all, and record it as one commit by the CLI's agent; with --split, we apply and record each part that way. In one rare case, when we can't save the commit after we apply your edits, the edits stay in Monton without your renames, new docs and deletes, and the error says so: push again to send them. Apart from new image links, we never change your files when you push: run monton pull afterwards to see the merged text.
When you pull, we merge Monton's changes into your files the same way, and write each file through a temporary file, so a file never ends up half written. We never replace a file that changed while we pulled; the next pull merges it. If a pull stops halfway, run monton pull again to finish it.
Conflicts
A conflict happens when you and someone in Monton change the same lines of a doc, or make changes that can't both stand, such as two different renames of one doc. Then we push nothing and exit monton push with 3. Run monton pull: where both sides changed the same lines, we write conflict markers into the file and list the lines.
<<<<<<< current (in Monton)
their text
||||||| base (the version you started from)
the text before either change
=======
your text
>>>>>>> yoursKeep what should stay, delete the marker lines, then push. We refuse to push a file that still has these markers. We go through the steps in Troubleshooting.
Deletes and renames
Delete a file to delete its doc, and rename or move a file to rename or move its doc. We pair a renamed file with its doc by its text, as git does, and you see the pair in monton status before you push. When you rename a doc in the clone and someone edits it in Monton, we keep both changes. When one side deleted a doc and the other changed it, we keep the doc and say so: delete it again to push the delete. People can bring back a deleted doc from the "Recently deleted" page in the web app, with its history and comments, but not from the clone.
Many deletes and big pushes
To delete more than 5 docs in one push, you need --allow-deletes. We ask for it to catch a mistake, such as an agent clearing out a folder or someone running a script in the wrong place: without the flag, we push nothing and list the deletes. Check them with monton status first.
One push may write at most 200 docs, hold 2 MiB of text, and make 2,000 renames, moves and deletes, so that we hold the workspace only briefly while people type. To push more than that, you need --split, and then we send your changes as several commits instead of one. If we fail partway, we list the commits already in Monton in the error's commits field.
Coding agents should ask their user before they add either flag. We list the errors from these checks in Troubleshooting.
Images in a clone
We don't take images on monton.dev yet. There, when a doc in the clone gains a link to a PNG, JPEG, GIF or WebP file in the folder, such as , we push nothing, and we stop with image_refused and the message "This Monton server doesn't take images." Remove the link, or link to an image on the web instead, then push again. We leave links to images on the web as they are.
On a Monton server with images on, we put the images the docs use in attachments/ at the clone's root, and the docs link to them there by a relative path. When you pull, we fetch the images that attachments/ doesn't hold yet. To add an image, put the PNG, JPEG, GIF or WebP file anywhere in the folder, link it from a doc by a relative path, such as , and push: we upload it, then point the link at its copy in attachments/. We take images up to 10 MB. If we can't take one, we push nothing. Files in attachments/ are never docs, and when you delete one, we change nothing in Monton.
Set the CLI up for coding agents
Coding agents such as Claude Code and Codex work well with the CLI: they edit docs with their usual tools and push. To teach them how:
Paste the guide from
monton help agentsinto your repo'sAGENTS.mdorCLAUDE.md, or into your agent's instructions.Or add the monton-cli skill, which covers the CLI and Monton's MCP tools together.
An agent signs in with monton login --json. We print the link and the code on the first line. The agent sends both to its own user only, in their private chat, and waits while the user opens the link on any device where they're signed in to Monton, checks the code and connects the CLI. If that line has "thisComputerOnly": true, the link works only in a browser on the computer the agent runs on. Once the user connects the CLI, we print the second line and the command exits; an agent whose shell can't wait that long runs it in the background. Then the agent runs monton whoami and checks that it names its user's email; if it doesn't, the agent runs monton logout and tells its user. An agent never asks its user for a token.