Skip to main content
The Miramarket CLI lets you author, validate, and post strategies from a terminal instead of the visual builder. It is built for scripting and for AI coding agents that can run shell commands, but works just as well for a human typing commands directly. If you want a visual canvas instead, use the strategy builder.

Install

Sign in

This prints a short code and a verification link:
Open the link in any browser — it does not need to be on the same device you are running the CLI from, which is useful if you are working over SSH or on a server with no browser installed. Sign in with the usual Miramarket options (email, Google, Discord) and approve the request. The CLI then finishes authenticating automatically. Once you approve, the session stays signed in on that machine indefinitely — there is no need to log in again for routine use. If you ever want to check whether you are still signed in:

Finish account setup

Signing in starts a session, but two more things are required before you can trade: accepting the current Terms, Privacy Policy, and Risk Disclosure, and delegating your wallet. Check what is still needed:
This reports exactly what is missing and how to fix it. Two steps require you personally, and cannot be done by a script or an AI agent on your behalf:
  • Accept the current policies, from an interactive terminal:
  • Delegate your wallet, by opening app.miramarket.org and signing in once in a browser. miramarket-cli account status will confirm once this is done.
Run miramarket-cli account status again afterward to confirm you are ready to trade.

Post your first strategy

Use the guided wizard, which walks you through choosing a starting point, validating, previewing, and posting:
Or work with a strategy file directly:
Add --demo to post to simulate a run instead of using real funds.

Everyday commands

Every command supports a --json flag for machine-readable output, which agents and scripts should always use. Run any command with --help to see its full set of options. See the CLI reference for every command, flag, JSON shape, and exit code.

Using it with an AI agent

The CLI is designed so an AI coding agent (such as Claude Code) can drive it directly: run miramarket-cli account status --json first to confirm the account can trade, then miramarket-cli schema to learn the strategy format, then validate, preview, and post. Signing in and accepting policies still require a human — an agent should stop and ask you to complete those steps rather than attempting them. For the full strategy JSON format, worked examples, and the rules that determine whether a strategy actually behaves as intended (most of which validate can’t check for you), point your agent at /agent-strategy-guide.md — a single markdown file meant to be fetched and read directly, not browsed.