@sdk.markets/cli
v0.1.9
Published
CLI for creating SDK Markets from the terminal.
Readme
markets-cli
Installable CLI for creating markets from the terminal.
Current scope:
hostedmode for the platform-backed Convex/Privy flowlocal-walletmode for agents, bots, and power users- browser login handoff for hosted user sessions
- generate or import a local EVM wallet
- create Base Sepolia markets from a JSON payload through hosted or local-wallet mode
auth bootstrap remains available as a temporary dev fallback. Normal hosted
CLI usage should use auth login.
auth login opens a browser, the user signs into Privy, and the page calls
Privy's addSigners to register the platform's backend signer on their
embedded wallet. After that the backend can sign transactions from the user's
wallet without a per-tx prompt, until the user revokes. See
apps/platforms-markets/README.md (Wallet signing model) for the full
trust chain, env vars, and policy-scoping notes.
Usage
markets auth status
markets auth login --project-key "$MARKETS_PROJECT_KEY"
markets wallet show
markets wallet balance
markets login --project-key "$MARKETS_PROJECT_KEY"
markets wallet
markets balance
markets create
markets create --detach
markets jobs get <job-id>
markets create --file apps/cli/examples/create-market.json
markets create --file apps/cli/examples/create-market.json --output=jsonFor local development from the monorepo:
bun run markets -- --help
bun run markets -- createbun run markets defaults to the dev profile, http://localhost:3003, and the
local sandbox project key pmk_sandbox_local. The installed markets CLI
defaults to the prod profile and https://platform.markets.
markets create runs interactively when no file is provided. It prompts for
the market question, outcomes, close time, resolution mode, and challenge
window. In hosted mode it starts a creation job and waits for completion by
default. Pass --detach to return the job ID immediately, then use
markets jobs get <job-id> to inspect status later. Pass --file for a JSON
payload when wrapping the CLI from scripts or agents.
Production config is stored at ~/.config/markets/config.json. Development
config is stored separately at ~/.config/markets/config.dev.json so switching
between prod and dev does not require logging in again.
Hosted mode defaults to production at https://platform.markets for the
installed CLI. Override with --base-url http://localhost:3003 or
MARKETS_BASE_URL for local development or another deployment. The CLI
automatically uses the dev config for localhost base URLs. You can also force
the config profile with MARKETS_ENV=dev or MARKETS_ENV=prod.
Use --json on auth and wallet commands, or --output=json on create, for
machine-readable output. The legacy markets create --json market.json form is
still accepted as an alias for --file.
Example payload
{
"question": "Will the CLI create a market?",
"options": ["Yes", "No"],
"closeTime": "2026-06-01T00:00:00Z",
"resolutionMode": "SingleAdmin"
}