{"slug": "how-to-use-the-moshcode-cli", "title": "How to Use the Moshcode CLI", "summary": "Moshcode 0.56.0, a CLI tool that installs and drives multiple coding engines including opencode, Claude Code, codex, gemini, kimi, qwen, deepseek, and aider, is now available. The tool, described as a 'metal wrapper for coding engines,' adds persistent sessions, account sync, and a namespace for built projects. It requires Node.js 18 or newer and is installed via a script from moshcoding.com, with the home page at moshcode.sh.", "body_md": "# How to use the moshcode CLI\n\n*2026-08-14, by Anthony “chovy” Ettinger.*\n\n**How this was written:** drafted with an AI assistant from my notes and from the\nCLI's own help output, then checked against a real install. Commands below were run against\nmoshcode 0.56.0.\n\n## What moshcode actually is\n\nmoshcode calls itself “a metal wrapper for coding engines.” That is the honest\ndescription. It is not another coding agent competing with the ones you already use — it\n*installs and drives* them. opencode, Claude Code, codex, gemini, kimi, qwen, deepseek,\naider and a few more all sit behind one command surface, so you stop memorising five different\nCLIs with five different flag conventions.\n\nOn top of that it adds the things you actually need around an agent: sessions that survive a\nclosed terminal, an account you can sync settings to, and a namespace where you can park what you\nbuild. Home page is [moshcode.sh](https://moshcode.sh).\n\n## Installing it\n\n```\ncurl -fsSL https://moshcoding.com/install.sh | sh\n```\n\nYes, the site is `moshcode.sh`\n\nand the installer is served from\n`moshcoding.com`\n\n. They are two different properties and that trips people up. The\ninstall script is the one above.\n\nIt is zero-dependency ESM, so the only requirement is Node.js 18 or newer. The same script handles the other two lifecycle jobs:\n\n```\ncurl -fsSL https://moshcoding.com/install.sh | sh -s -- update\ncurl -fsSL https://moshcoding.com/install.sh | sh -s -- remove\n```\n\n**Do not put sudo in front of that.** moshcode escalates on its own\nfor the steps that genuinely need root. If you run the installer or an update as root, it installs\ninto root's home directory instead of yours, and then you have two copies and a confusing\nafternoon. Run it as you.\n\n## Finding your way around\n\nRun it with no command at all and it opens the mosh pit — the interactive view. When you want the map instead:\n\n```\nmoshcode help                # the groups\nmoshcode help <command>      # flags and examples for one\nmoshcode help --all          # the whole wall\nmoshcode help --json         # the same thing, for a script\n```\n\nThe commands are grouped, which is the fastest way to understand the tool: **engines**\n(agents, install, upgrade), **runtime** (herd, ps, attach, kill, restore),\n**tools** (stocks, crypto, news, rss, trade), **extend** (mcp, skill,\nplugin), **script** (prd, commands, run), **account** (login, whoami,\nsave, load), and **hosting** (dns, doh, site, template). There is also an arcade with\ntwenty-two games in it, because of course there is.\n\nThat `--json`\n\nflag is not decoration. Nearly every command takes it, which is what\nmakes moshcode scriptable rather than merely interactive.\n\n## Driving an engine\n\n```\nmoshcode engines             # what exists, and what's installed here\nmoshcode install claude      # put one on this machine\nmoshcode agents              # engines and their status\nmoshcode agents claude       # open that engine's agent view\n```\n\nOne warning, straight from the CLI's own help text: *autonomous modes bypass approval\nprompts.* Use them in a container or a workspace you trust, and not in the checkout you care\nabout. That is not me being cautious for the sake of it — an agent that never asks is exactly\nas dangerous as it sounds.\n\n## The herd: sessions that outlive the terminal\n\nThis is the feature I use most and the one that is hardest to appreciate until you have it. A herd session keeps running when you close the window.\n\n```\nmoshcode herd start          # start a session, hand the prompt back\nmoshcode herd ps             # the roster and every session's state\nmoshcode attach              # get back into one\nmoshcode herd tile           # every member on screen at once\nmoshcode herd ui             # sidebar of members, selected one beside it\nmoshcode kill                # stop one\nmoshcode restore             # bring sessions back\n```\n\nOnce you are running three or four agents at once, `herd tile`\n\nand the roster stop\nbeing conveniences and start being the only way you keep track of anything.\n\n## Logging in\n\nAn account lives at [app.moshcode.sh](https://app.moshcode.sh) and the CLI\nauthenticates against it:\n\n```\nmoshcode login               # browser flow\nmoshcode login --device      # device-code flow, for a headless box\nmoshcode whoami              # who am I currently\nmoshcode whoami --json       # same, for a script\nmoshcode logout\n```\n\nThe device flow is the one you want over SSH; moshcode picks it automatically when stdin is not a TTY, but you can force it. Once you are signed in, your settings become portable:\n\n```\nmoshcode save --dry-run      # what would go up\nmoshcode save                # push aliases + herd rules to your account\nmoshcode load                # pull them onto another machine\n```\n\nThat is the whole reason to bother logging in: set a box up once, then `moshcode load`\n\non the next one instead of doing it all again.\n\n## Joining the Pit network\n\nThe Pit, at [app.moshcode.sh/pit](https://app.moshcode.sh/pit), is the part people\nfind strangest, so here is the plain version. It is a namespace that lives *outside* the\ntraditional DNS root. You claim an *ending* — the moral equivalent of a TLD, something\nlike `.eggs`\n\n— on a first-come, first-served basis, and then you mint as many names\nunder it as you like. Sign in with the same moshcode account the CLI uses, and claim one.\n\nBecause these names are not in the public DNS root, a normal machine has no idea what to do with\nthem. That is what the `dns`\n\ncommand is for:\n\n```\nsudo moshcode dns enable     # route Moshpit endings to the local bridge\nmoshcode dns status          # what's running, what's routed, does it work\nmoshcode dns resolve blue.eggs   # what a machine actually gets, and why\nmoshcode dns tlds            # every ending claimed in the Pit\nmoshcode dns refresh         # re-apply routing for endings claimed since\n```\n\n`dns enable`\n\nis the one command here that genuinely does want `sudo`\n\n, and\nthe CLI says so itself — it is rewriting your machine's resolver configuration. This is worth\ntyping deliberately rather than pasting on autopilot: it changes how *everything* on that box\nresolves names, so do it on a machine where you would be comfortable explaining what changed. It is\nreversible with `dns disable`\n\n.\n\nThen put something behind the name:\n\n```\nmoshcode template list                     # available stacks\nmoshcode template install bun-caddy-sqlite # scaffold into the current dir\nmoshcode site                              # web-server config for a Moshpit name\n```\n\nIf you would rather not touch your resolver at all, there is a DNS-over-HTTPS endpoint you can\npoint a client at instead — `moshcode help doh`\n\ncovers it.\n\n## The bits nobody mentions\n\nSome of the most useful surface is filed under “tools” and easy to miss:\n\n`moshcode stocks`\n\nand`moshcode crypto`\n\n— market research from advis0r.com, straight in the terminal,`--json`\n\nincluded`moshcode news`\n\nand`moshcode rss`\n\n— feeds without a reader`moshcode mcp`\n\n,`skill`\n\n,`plugin`\n\n— how you extend an engine rather than replace it`moshcode secrets`\n\n,`railway`\n\n,`gh`\n\n,`supabase`\n\n,`turso`\n\n— the adjacent tools it will install and drive for you`moshcode upgrade --check`\n\n— what is stale, without installing anything\n\n## A sensible first hour\n\n- Install it with the curl line. No sudo.\n`moshcode help`\n\n, then`moshcode help herd`\n\n.`moshcode install`\n\nwhichever engine you already pay for.`moshcode login`\n\n—`--device`\n\nif you are on a server.- Start one thing under\n`herd start`\n\nand close the terminal on purpose. Reattach. That moment is when it clicks. - Only then go claim an ending in\n[the Pit](https://app.moshcode.sh/pit).\n\nLeave `dns enable`\n\nuntil you actually want to reach a Moshpit name from that machine.\nIt is the one step with system-wide consequences, and there is no reason to take it on day one.\n\nWritten against moshcode 0.56.0; commands and flags move, so\n`moshcode help <command>`\n\nis always more current than a blog post. Disclosure: I\nbuild moshcode, so I am hardly a neutral reviewer of it.", "url": "https://wpnews.pro/news/how-to-use-the-moshcode-cli", "canonical_source": "https://anthony.dev.profullstack.com/blog/002-post.html", "published_at": "2026-08-14 12:34:59+00:00", "updated_at": "2026-08-14 12:42:40.562843+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Moshcode", "Anthony Ettinger", "opencode", "Claude Code", "codex", "gemini", "kimi", "qwen"], "alternates": {"html": "https://wpnews.pro/news/how-to-use-the-moshcode-cli", "markdown": "https://wpnews.pro/news/how-to-use-the-moshcode-cli.md", "text": "https://wpnews.pro/news/how-to-use-the-moshcode-cli.txt", "jsonld": "https://wpnews.pro/news/how-to-use-the-moshcode-cli.jsonld"}}