file, git, agent
These commands read and write files on the Host machine, stage and commit Git changes, and list agents. Paths are resolved by the Host and belong to that machine. A caller with the Host token is authorized; production scripts keep paths inside a known workspace. A running Host and DIMO_TOKEN are required.
npx dimo file tree
List the file tree under a directory.
npx dimo file tree --path /home/you/src/demo
npx dimo file tree --path /home/you/src/demo --depth 2--path is required and is an absolute path on the Host. --depth is how many levels to expand, default 3, and must be a number. Use it in scripts to confirm layout before npx dimo file read / npx dimo file write. A missing path returns a Host error.
npx dimo file read
Read a file’s text and print it.
npx dimo file read --path /home/you/src/demo/README.md--path is required. Large or binary files may be truncated or rejected; the error code is in the response. Default print is the text; with --json the whole contents are a JSON string.
npx dimo file write
Write contents to a file on the Host. Supply --text or --file; if both are present, --text is used.
npx dimo file write --path /home/you/src/demo/notes.md --text "hello"
npx dimo file write --path /home/you/src/demo/notes.md --file ./local.md--path is required. --file points at a local file on the machine running the CLI; contents are read as UTF-8 and sent to the Host. This writes disk directly, with no agent permission prompt. Missing both content sources raises Missing required --file.
npx dimo git status
Read Git status (changed files, branch, and related fields) for a workspace repository.
npx dimo git status --workspace WORKSPACE_ID --repo REPO_ID--workspace and --repo are required. --repo comes from the repository list in npx dimo project show --id PROJECT_ID. Exact fields are those in the JSON.
npx dimo git stage
Stage one path inside the workspace.
npx dimo git stage --workspace WORKSPACE_ID --repo REPO_ID --path relative/path.tsAll three flags are required. --path is relative to the workspace. One path per call; repeat the command for more files.
npx dimo git commit
Create a commit from staged changes.
npx dimo git commit --workspace WORKSPACE_ID --repo REPO_ID --message "describe this change"--workspace, --repo, and --message are required. An empty index returns a Host error. Push, pull requests, and rebase stay in the desktop Git panel, or an agent performs them after approval. This CLI stops at commit.
npx dimo agent list
List agents added to the Host, with install, auth, and enabled status.
npx dimo agent list
npx dimo agent list --jsonNo extra flags. The stable kind in the array (for example claude_code) is the value for --agent. Disabled or unauthenticated rows still appear; npx dimo conversation create against them is rejected. Enable and sign in under desktop Settings → Agents first.
This command needs a running Host and DIMO_TOKEN. To list installable Agents and write Runtime and ACP on this machine, use npx dimo list and npx dimo install; HTTP can stay down. See Install Agents locally. Sign-in remains desktop Settings → Agents.