The mog CLI trades from a terminal. A person can use it by hand, and an agent or a strategy can use it unattended. It never prompts: every input is a flag or an environment variable.
Install
Section titled “Install”| Platform | Command |
|---|---|
| macOS, Linux | brew install mog-xyz/tap/mog |
| Windows | scoop bucket add mog-xyz https://github.com/Mog-xyz/homebrew-tap, then scoop install mog |
A new install starts on testnet. mog network mainnet switches to mainnet.
Connect
Section titled “Connect”mog connectThe CLI makes a session key and opens the app’s connect page. Your wallet signs one grant there. The private key stays on your machine. The CLI stores it with owner-only permissions. Set MOG_PASSPHRASE to encrypt it.
For an agent that has no browser, mog session new --account 0xYOUR_WALLET prints the request for your wallet to sign. Your wallet key never reaches the machine that trades.
Fund and trade
Section titled “Fund and trade”mog deposit # your deposit address and a QR codemog marketsmog price BTCmog long BTC 10 --lev 50 --dry-runmog long BTC 10 --lev 50mog positionsmog close BTC <posId> --fraction 50%An order fills at the next attested price, not the price you see when you send it. A market order usually fills within a few seconds. See Positions and leverage.
--dry-run signs and sends nothing. It shows the order the CLI would sign.
Machine output
Section titled “Machine output”Add --json to any command. The output is one object:
{ "ok": true, "data": { } }{ "ok": false, "error": { "code": "…", "message": "…", "retryable": false, "exit": 4 } }Progress goes to stderr. mog schema prints every command and exit code as JSON. Read the exit code before you retry: see Errors. Exit code 6 means a signed instruction may already be on chain.
Agents
Section titled “Agents”mog skill install adds the agent guide for Claude Code. mog skill show prints it for any other agent.
- Run
mog doctorwhen something fails. It checks the network, the keys and the endpoints. - Learn the fees and the close curve before you automate. A strategy that trades often pays the open fee every time.