diff --git a/README.md b/README.md index 5decc7a..a45988b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,86 @@ -# splat-cli-releases -Public release assets for the Splat CLI +# Splat CLI Releases + +This repo hosts the public release assets for the Splat CLI. + +## Purpose + +The source code for the CLI and backend remains private in: + +- `protastudios/splat-trading-backend` + +This repo is public so installers and Homebrew can fetch release assets without needing access to the private source repository. + +## Install + +The installer script lives in this public repo and downloads release assets from this public repo: + +```bash +curl -fsSL https://raw.githubusercontent.com/protastudios/splat-cli-releases/main/install-release.sh | bash +``` + +## Homebrew + +The Homebrew formula in `protastudios/homebrew-tap` points at the GitHub releases published here. + +Target install command: + +```bash +brew install protastudios/tap/splat +``` + +## Agent Skills + +This repo also publishes agent-facing guidance for the Splat CLI: + +- Codex skill: `skills/splat-cli/SKILL.md` +- Claude Code command: `claude/commands/splat.md` +- Claude Code memory snippet: `claude/CLAUDE.md.snippet` + +The Codex skill teaches agents to inspect the live CLI surface with `splat --json commands` and to use staged/explicit confirmation flows for trading, signing, bridge, reward, token, and grant operations. + +Install both Codex and Claude Code guidance with npm: + +```bash +npx @splat/agent-skills install +``` + +Install only one target: + +```bash +npx @splat/agent-skills install --codex +npx @splat/agent-skills install --claude +``` + +After installation, restart Codex or Claude Code so the new skill or command is discovered. + +The no-npm fallback is: + +```bash +curl -fsSL https://raw.githubusercontent.com/protastudios/splat-cli-releases/main/install-agent-skills.sh | bash +``` + +Fallback install for only one target: + +```bash +curl -fsSL https://raw.githubusercontent.com/protastudios/splat-cli-releases/main/install-agent-skills.sh | SPLAT_INSTALL_CLAUDE=0 bash +curl -fsSL https://raw.githubusercontent.com/protastudios/splat-cli-releases/main/install-agent-skills.sh | SPLAT_INSTALL_CODEX=0 bash +``` + +Publish the npm installer after logging into an npm account with access to the `@splat` scope: + +```bash +npm test +npm pack --dry-run +npm publish --access public +``` + +## Contents + +Tagged releases in this repo are expected to include: + +- macOS tarballs +- Linux tarballs +- Windows zip archives +- `checksums.txt` + +The backend release workflow publishes those assets here automatically when distribution secrets are configured. diff --git a/bin/install.js b/bin/install.js new file mode 100755 index 0000000..c42f0a0 --- /dev/null +++ b/bin/install.js @@ -0,0 +1,150 @@ +#!/usr/bin/env node +"use strict"; + +const fs = require("fs"); +const os = require("os"); +const path = require("path"); + +const packageRoot = path.resolve(__dirname, ".."); + +function printHelp() { + console.log(`Usage: + splat-agent-skills install [options] + splat-agent-skills --help + +Options: + --codex Install only the Codex skill + --claude Install only the Claude Code command/snippet + --codex-home Override Codex home directory + --claude-home Override Claude home directory + --dry-run Print planned file operations without writing + +Environment: + CODEX_HOME Codex home directory, default ~/.codex + CLAUDE_HOME Claude home directory, default ~/.claude +`); +} + +function parseArgs(argv) { + const options = { + command: "install", + codex: false, + claude: false, + codexHome: process.env.CODEX_HOME || path.join(os.homedir(), ".codex"), + claudeHome: process.env.CLAUDE_HOME || path.join(os.homedir(), ".claude"), + dryRun: false, + }; + + const args = [...argv]; + if (args[0] && !args[0].startsWith("-")) { + options.command = args.shift(); + } + + for (let index = 0; index < args.length; index += 1) { + const arg = args[index]; + + if (arg === "--help" || arg === "-h") { + options.command = "help"; + } else if (arg === "--codex") { + options.codex = true; + } else if (arg === "--claude") { + options.claude = true; + } else if (arg === "--dry-run") { + options.dryRun = true; + } else if (arg === "--codex-home") { + options.codexHome = readValue(args, index, arg); + index += 1; + } else if (arg === "--claude-home") { + options.claudeHome = readValue(args, index, arg); + index += 1; + } else { + throw new Error(`Unknown option: ${arg}`); + } + } + + if (!options.codex && !options.claude) { + options.codex = true; + options.claude = true; + } + + return options; +} + +function readValue(args, index, flag) { + const value = args[index + 1]; + if (!value || value.startsWith("-")) { + throw new Error(`${flag} requires a path value`); + } + return path.resolve(value); +} + +function copyDirectory(source, destination, dryRun) { + if (dryRun) { + console.log(`[dry-run] copy directory ${source} -> ${destination}`); + return; + } + + fs.rmSync(destination, { recursive: true, force: true }); + fs.mkdirSync(path.dirname(destination), { recursive: true }); + fs.cpSync(source, destination, { recursive: true }); +} + +function copyFile(source, destination, dryRun) { + if (dryRun) { + console.log(`[dry-run] copy file ${source} -> ${destination}`); + return; + } + + fs.mkdirSync(path.dirname(destination), { recursive: true }); + fs.copyFileSync(source, destination); +} + +function installCodex(options) { + const source = path.join(packageRoot, "skills", "splat-cli"); + const destination = path.join(options.codexHome, "skills", "splat-cli"); + + copyDirectory(source, destination, options.dryRun); + console.log(`Installed Codex skill to ${destination}`); +} + +function installClaude(options) { + const commandSource = path.join(packageRoot, "claude", "commands", "splat.md"); + const snippetSource = path.join(packageRoot, "claude", "CLAUDE.md.snippet"); + const commandDestination = path.join(options.claudeHome, "commands", "splat.md"); + const snippetDestination = path.join(options.claudeHome, "SPLAT_CLAUDE.md"); + + copyFile(commandSource, commandDestination, options.dryRun); + copyFile(snippetSource, snippetDestination, options.dryRun); + console.log(`Installed Claude command to ${commandDestination}`); + console.log(`Installed Claude memory snippet to ${snippetDestination}`); +} + +function main() { + const options = parseArgs(process.argv.slice(2)); + + if (options.command === "help") { + printHelp(); + return; + } + + if (options.command !== "install") { + throw new Error(`Unknown command: ${options.command}`); + } + + if (options.codex) { + installCodex(options); + } + + if (options.claude) { + installClaude(options); + } + + console.log("Done. Restart Codex or Claude Code if the new guidance is not discovered immediately."); +} + +try { + main(); +} catch (error) { + console.error(error instanceof Error ? error.message : String(error)); + process.exit(1); +} diff --git a/claude/CLAUDE.md.snippet b/claude/CLAUDE.md.snippet new file mode 100644 index 0000000..7733a1b --- /dev/null +++ b/claude/CLAUDE.md.snippet @@ -0,0 +1,10 @@ +# Splat CLI + +When working with Splat CLI tasks, inspect the live command surface before giving detailed command advice: + +```bash +splat --json commands +``` + +Use `splat doctor`, `splat auth status`, and `splat me` to verify local setup and authentication. Prefer staging or prepare/execute flows before final submit/confirm actions. Never run final trade, swap, bridge, reward-claim, token-revoke, grant-update, or signer-submit commands unless the user explicitly asks for that final action in the current task. + diff --git a/claude/commands/splat.md b/claude/commands/splat.md new file mode 100644 index 0000000..33bee8c --- /dev/null +++ b/claude/commands/splat.md @@ -0,0 +1,27 @@ +--- +description: Inspect and use the Splat CLI safely +argument-hint: [task] +--- + +Use the Splat CLI to help with this task: + +`$ARGUMENTS` + +Before giving detailed command advice, inspect the installed CLI when possible: + +```bash +splat --json commands +``` + +Also check setup when the task involves auth, API reachability, trading, signing, or local environments: + +```bash +splat doctor +splat auth status +``` + +Follow these rules: + +- Do not invent flags or command names. Use the live command catalog or `splat help `. +- Prefer read-only inspection before writes, signing, trading, token changes, or grant changes. +- Do not run final submit, confirm, revoke, claim, bridge, or signing commands unless the user explicitly asks for that final action. diff --git a/install-agent-skills.sh b/install-agent-skills.sh new file mode 100755 index 0000000..939fced --- /dev/null +++ b/install-agent-skills.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -euo pipefail + +SPLAT_SKILLS_REPO="${SPLAT_SKILLS_REPO:-protastudios/splat-cli-releases}" +SPLAT_SKILLS_BRANCH="${SPLAT_SKILLS_BRANCH:-main}" +SPLAT_INSTALL_CODEX="${SPLAT_INSTALL_CODEX:-1}" +SPLAT_INSTALL_CLAUDE="${SPLAT_INSTALL_CLAUDE:-1}" + +raw_base="https://raw.githubusercontent.com/${SPLAT_SKILLS_REPO}/${SPLAT_SKILLS_BRANCH}" +tmp_dir="$(mktemp -d)" + +cleanup() { + rm -rf "${tmp_dir}" +} +trap cleanup EXIT + +download() { + local remote_path="$1" + local local_path="$2" + mkdir -p "$(dirname "${local_path}")" + curl -fsSL "${raw_base}/${remote_path}" -o "${local_path}" +} + +if [[ "${SPLAT_INSTALL_CODEX}" == "1" ]]; then + codex_home="${CODEX_HOME:-${HOME}/.codex}" + codex_skill_dir="${codex_home}/skills/splat-cli" + + download "skills/splat-cli/SKILL.md" "${tmp_dir}/codex/SKILL.md" + download "skills/splat-cli/agents/openai.yaml" "${tmp_dir}/codex/agents/openai.yaml" + download "skills/splat-cli/references/install.md" "${tmp_dir}/codex/references/install.md" + download "skills/splat-cli/references/auth.md" "${tmp_dir}/codex/references/auth.md" + download "skills/splat-cli/references/safety.md" "${tmp_dir}/codex/references/safety.md" + download "skills/splat-cli/references/commands.md" "${tmp_dir}/codex/references/commands.md" + + rm -rf "${codex_skill_dir}" + mkdir -p "$(dirname "${codex_skill_dir}")" + cp -R "${tmp_dir}/codex" "${codex_skill_dir}" + echo "Installed Codex skill to ${codex_skill_dir}" +fi + +if [[ "${SPLAT_INSTALL_CLAUDE}" == "1" ]]; then + claude_home="${CLAUDE_HOME:-${HOME}/.claude}" + claude_command_dir="${claude_home}/commands" + + download "claude/commands/splat.md" "${tmp_dir}/claude/commands/splat.md" + download "claude/CLAUDE.md.snippet" "${tmp_dir}/claude/CLAUDE.md.snippet" + + mkdir -p "${claude_command_dir}" + cp "${tmp_dir}/claude/commands/splat.md" "${claude_command_dir}/splat.md" + cp "${tmp_dir}/claude/CLAUDE.md.snippet" "${claude_home}/SPLAT_CLAUDE.md" + echo "Installed Claude command to ${claude_command_dir}/splat.md" + echo "Installed Claude memory snippet to ${claude_home}/SPLAT_CLAUDE.md" +fi + +echo "Done. Restart Codex or Claude Code if the new guidance is not discovered immediately." diff --git a/package.json b/package.json new file mode 100644 index 0000000..e8aec88 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "@splat/agent-skills", + "version": "1.0.0", + "description": "Codex and Claude Code guidance for the Splat CLI.", + "bin": { + "splat-agent-skills": "bin/install.js" + }, + "files": [ + "bin", + "skills", + "claude", + "README.md" + ], + "scripts": { + "test": "node --check bin/install.js && bash -n install-agent-skills.sh", + "pack:dry-run": "npm pack --dry-run" + }, + "keywords": [ + "splat", + "codex", + "claude", + "skills", + "cli", + "trading" + ], + "homepage": "https://asksplat.com", + "repository": { + "type": "git", + "url": "git+https://github.com/protastudios/splat-cli-releases.git" + }, + "bugs": { + "url": "https://github.com/protastudios/splat-cli-releases/issues" + }, + "license": "UNLICENSED", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=18" + } +} diff --git a/skills/splat-cli/SKILL.md b/skills/splat-cli/SKILL.md new file mode 100644 index 0000000..a313aeb --- /dev/null +++ b/skills/splat-cli/SKILL.md @@ -0,0 +1,47 @@ +--- +name: splat-cli +description: Use when helping a user operate the Splat CLI for Splat platform auth, market data, portfolio inspection, Solana swaps, Hyperliquid orders, rewards, bridge flows, OAuth/API tokens, or delegated agent signing. This skill teaches agents to inspect the live CLI surface instead of relying on stale command memory. +--- + +# Splat CLI + +Use this skill when the user wants to install, configure, inspect, or automate the `splat` command. + +## First Checks + +1. Check whether the CLI is installed: + +```bash +splat --help +``` + +2. Check local setup and API reachability: + +```bash +splat doctor +``` + +3. Inspect the current command surface before giving detailed command advice: + +```bash +splat --json commands +``` + +Use `splat help ` for group-specific usage, such as `splat help auth`, `splat help orders`, or `splat help solana`. + +## References + +- Installation: read `references/install.md` when the user needs to install or update the CLI. +- Authentication and environments: read `references/auth.md` before login, staging, local dev, token, OAuth, or API-token work. +- Command catalog: read `references/commands.md` for the generated snapshot, but prefer live `splat --json commands` when available. +- Safety rules: read `references/safety.md` before signing, submitting, swapping, bridging, ordering, claiming rewards, or changing grants. + +## Operating Rules + +- Prefer JSON output where available when another tool or agent will parse the result. +- Do not invent command flags. Run `splat --json commands` or `splat help ` first. +- For authenticated commands, check `splat auth status` and `splat me` before assuming the user is logged in. +- For trading or signing flows, prefer quote, inspect, prepare, or execute/stage commands before any final submit/confirm step. +- For normal use, require explicit current-task intent before final submit/confirm actions. If the user wants agentic trading, ask for an explicit autonomous-trading mandate that defines the scope, duration, allowed actions, and approval mode. When that mandate authorizes auto-approval, it counts as current-task intent for Splat-scoped auth, bridge, swap, order, grant, and signer setup needed to trade, provided live inspection and safety gates pass. +- When the user asks for local development URLs, use `splat auth login --dev`. When testing staging, use `--staging` with explicit `--api-url` and `--web-url`. + diff --git a/skills/splat-cli/agents/openai.yaml b/skills/splat-cli/agents/openai.yaml new file mode 100644 index 0000000..2292123 --- /dev/null +++ b/skills/splat-cli/agents/openai.yaml @@ -0,0 +1,7 @@ +interface: + display_name: "Splat CLI" + short_description: "Operate the Splat trading CLI" + default_prompt: "Use $splat-cli to inspect my Splat CLI setup and pick the right command." +policy: + allow_implicit_invocation: true + diff --git a/skills/splat-cli/references/auth.md b/skills/splat-cli/references/auth.md new file mode 100644 index 0000000..c1957fb --- /dev/null +++ b/skills/splat-cli/references/auth.md @@ -0,0 +1,62 @@ +# Auth And Environments + +## Production Login + +```bash +splat auth login +splat auth status +splat me +``` + +`splat auth` is an alias for the default production login flow. + +## Local Development + +Use the development platform targets: + +```bash +splat auth login --dev +splat doctor +``` + +Use `--enable-trading` only when the user explicitly wants delegated trading credential setup: + +```bash +splat auth login --dev --enable-trading +``` + +## Staging + +Always pass explicit staging targets: + +```bash +splat auth login --staging \ + --api-url https://api.staging.asksplat.com \ + --web-url https://terminal.staging.asksplat.com +``` + +## Existing Tokens + +Save an existing platform token: + +```bash +splat auth save [apiUrl] +``` + +Manage personal API tokens: + +```bash +splat auth token list +splat auth token create "Local Agent" profile:read,market-data:read +splat auth token revoke +``` + +## OAuth + +OAuth commands exist for client management and token exchange. Inspect current usage first: + +```bash +splat help oauth +splat --json commands +``` + diff --git a/skills/splat-cli/references/commands.md b/skills/splat-cli/references/commands.md new file mode 100644 index 0000000..c44d4a1 --- /dev/null +++ b/skills/splat-cli/references/commands.md @@ -0,0 +1,1076 @@ +# Splat CLI Command Catalog + +This file is generated from `splat --json commands`. + +Regenerate it from `splat-trading-backend` with: + +```bash +bun run skill:sync-commands +``` + +Generated command count: 85. + +## api + +### splat api get + +Call a backend GET route directly + +Auth required: no. + +Examples: + +```bash +splat api get /health +``` + +### splat api post [jsonBody] + +Call a backend POST route directly + +Auth required: no. + +Examples: + +```bash +splat api post /order/create-perp-position '{"assetIndex":0,"assetName":"BTC","price":50000.5,"size":"1.5","vaultAddress":"0xabc","isLong":true}' +``` + +### splat api patch [jsonBody] + +Call a backend PATCH route directly + +Auth required: no. + +Examples: + +```bash +splat api patch /order/update-tpsl '{"coin":"BTC","isBuy":true,"position":"1","takeProfitPrice":60000,"stopLossPrice":48000}' +``` + +### splat api delete [jsonBody] + +Call a backend DELETE route directly + +Auth required: no. + +Examples: + +```bash +splat api delete /platform/api-tokens '{"apiTokenId":"api_token_123"}' +``` + +## account + +### splat account open-orders [userAddress] + +Fetch open orders for the authenticated Hyperliquid wallet or an override + +Auth required: yes. + +Examples: + +```bash +splat account open-orders +splat account open-orders 0xuser +``` + +### splat account spot-balances [userAddress] + +Fetch spot balances for the authenticated Hyperliquid wallet or an override + +Auth required: yes. + +Examples: + +```bash +splat account spot-balances +splat account spot-balances 0xuser +``` + +### splat account perp-balance [userAddress] + +Fetch current perp account value for the authenticated Hyperliquid wallet or an override + +Auth required: yes. + +Examples: + +```bash +splat account perp-balance +splat account perp-balance 0xuser +``` + +### splat account portfolio [userAddress] + +Fetch Hyperliquid portfolio history for the authenticated wallet or an override + +Auth required: yes. + +Examples: + +```bash +splat account portfolio +splat account portfolio 0xuser +``` + +## transfers + +### splat transfers spot-perp + +Create a spot-perp transfer instruction + +Auth required: no. + +Examples: + +```bash +splat transfers spot-perp 1000 true +``` + +### splat transfers usdc + +Create a USDC transfer instruction + +Auth required: no. + +Examples: + +```bash +splat transfers usdc 1000 0xrecipient +``` + +### splat transfers spot-asset + +Create a spot asset transfer instruction + +Auth required: no. + +Examples: + +```bash +splat transfers spot-asset UBTC 10 0xrecipient +``` + +## orders + +### splat orders perp open [--market] [--vault
] + +Create a perpetual order with explicit CLI arguments + +Auth required: no. + +Examples: + +```bash +splat orders perp open 0 BTC 50000.5 1.5 true --market --vault 0xabc +``` + +### splat orders perp execute [--market] [--vault
] + +Stage a perpetual order for explicit CLI confirmation and backend submission + +Auth required: no. + +Examples: + +```bash +splat orders perp execute 0 BTC 50000.5 1.5 true --market +``` + +### splat orders perp close [--market] [--vault
] [--leverage ] + +Close a perpetual position with explicit CLI arguments + +Auth required: no. + +Examples: + +```bash +splat orders perp close 0 BTC 51000.25 1.5 0xuser true --market +``` + +### splat orders spot create [--market] [--vault
] + +Create a spot order with explicit CLI arguments + +Auth required: no. + +Examples: + +```bash +splat orders spot create UBTC buy 1000 1000 --market +``` + +### splat orders spot execute [--market] [--vault
] + +Stage a spot order for explicit CLI confirmation and backend submission + +Auth required: no. + +Examples: + +```bash +splat orders spot execute UBTC buy 5 1000 --market +``` + +### splat orders cancel [--vault
] + +Cancel an existing perp or spot order + +Auth required: no. + +Examples: + +```bash +splat orders cancel BTC 1234 perp +``` + +### splat orders pending|show|confirm + +Inspect and confirm staged Hyperliquid executions + +Auth required: no. + +Examples: + +```bash +splat orders pending +splat orders show splat_exec_123 +splat orders confirm splat_exec_123 +``` + +### splat orders builder-fee check [userAddress] [builderAddress] + +Check the Hyperliquid builder fee approval for a wallet + +Auth required: yes. + +Examples: + +```bash +splat orders builder-fee check +``` + +### splat orders builder-fee approve|execute + +Create or stage a Hyperliquid builder fee approval + +Auth required: no. + +Examples: + +```bash +splat orders builder-fee execute +``` + +### splat orders tpsl create|execute [--tp ] [--sl ] [--tp-size ] [--sl-size ] [--vault
] + +Create or stage take-profit and stop-loss orders + +Auth required: no. + +Examples: + +```bash +splat orders tpsl execute 0 true 1.5 --tp 60000 --sl 48000 +``` + +### splat orders tpsl cancel|cancel-execute [--vault
] + +Create or stage TP/SL cancellation orders + +Auth required: no. + +Examples: + +```bash +splat orders tpsl cancel-execute 0 123,456 +``` + +## rewards + +### splat rewards unclaimed + +Fetch unclaimed reward totals for a backend user + +Auth required: no. + +Examples: + +```bash +splat rewards unclaimed user_123 +``` + +### splat rewards claimed + +Fetch claimed reward totals for a backend user + +Auth required: no. + +Examples: + +```bash +splat rewards claimed user_123 +``` + +### splat rewards total + +Fetch total reward totals for a backend user + +Auth required: no. + +Examples: + +```bash +splat rewards total user_123 +``` + +### splat rewards summary + +Fetch claimed, unclaimed, and total reward summaries together + +Auth required: no. + +Examples: + +```bash +splat rewards summary user_123 +``` + +### splat rewards staking-vault + +Fetch staking vault APY data + +Auth required: no. + +Examples: + +```bash +splat rewards staking-vault +``` + +### splat rewards staking-earnings [timeWindow] + +Fetch staking earnings for a wallet, optionally filtered by a window like 30d + +Auth required: no. + +Examples: + +```bash +splat rewards staking-earnings wallet_123 30d +``` + +### splat rewards claim-solana [userId] + +Claim unclaimed SOL rewards by signing a claim message with the CLI trading credential + +Auth required: yes. + +Examples: + +```bash +splat rewards claim-solana +``` + +### splat rewards claim-hyperliquid [userId] + +Claim unclaimed Hyperliquid USDC rewards by signing a claim message with the CLI trading credential + +Auth required: yes. + +Examples: + +```bash +splat rewards claim-hyperliquid +``` + +## bridge + +### splat bridge create + +Create a Solana-to-Arbitrum bridge transaction and return the payload token + +Auth required: no. + +Examples: + +```bash +splat bridge create 100 0xrecipient SolanaSender +``` + +### splat bridge send --payload-token + +Send a prepared bridge transaction using the payload token from bridge create + +Auth required: no. + +Examples: + +```bash +splat bridge send BASE64_TX 0xuser 1712345678 0xsig 1000000 --payload-token bridge_token +``` + +### splat bridge arbitrum-to-hyperliquid + +Create an Arbitrum-to-Hyperliquid bridge transaction + +Auth required: no. + +Examples: + +```bash +splat bridge arbitrum-to-hyperliquid 0xuser 1712345678 0xsig 1000000 +``` + +### splat bridge withdraw-arbitrum + +Create a Hyperliquid-to-Arbitrum withdrawal transaction + +Auth required: no. + +Examples: + +```bash +splat bridge withdraw-arbitrum 100 wallet_123 message sig +``` + +### splat bridge create-quote + +Create a withdraw quote for Arbitrum-to-Solana withdrawal + +Auth required: no. + +Examples: + +```bash +splat bridge create-quote wallet_123 SolanaWallet 100 message sig +``` + +### splat bridge withdraw-solana + +Send an Arbitrum-to-Solana withdrawal using a serialized quote payload + +Auth required: no. + +Examples: + +```bash +splat bridge withdraw-solana '{"quote":true}' wallet_123 message sig +``` + +### splat bridge poll + +Poll withdrawal state for a user address + +Auth required: no. + +Examples: + +```bash +splat bridge poll wallet_123 +``` + +## user + +### splat user get + +Fetch a user by id, email, EVM address, or Solana address + +Auth required: no. + +Examples: + +```bash +splat user get id user_123 +``` + +### splat user get-or-create [referredByCodeOrDash] + +Get or create a user using the backend user identity flow + +Auth required: no. + +Examples: + +```bash +splat user get-or-create joe@example.com Joe - 0xwallet SolWallet 0xturnkey TurnkeySol TurnkeySolMeme +``` + +### splat user update-name + +Update a user's display name + +Auth required: no. + +Examples: + +```bash +splat user update-name user_123 Joe +``` + +### splat user update-image + +Update a user's profile image URL + +Auth required: no. + +Examples: + +```bash +splat user update-image user_123 https://example.com/avatar.png +``` + +### splat user update-referral + +Update a user's referral code + +Auth required: no. + +Examples: + +```bash +splat user update-referral user_123 SPLATCODE +``` + +### splat user upload-url + +Create a one-time user profile upload URL + +Auth required: no. + +Examples: + +```bash +splat user upload-url +``` + +### splat user leverage + +Create a leverage update instruction + +Auth required: no. + +Examples: + +```bash +splat user leverage ETH 5 +``` + +## solana + +### splat solana swap quote + +Fetch a Solana swap quote + +Auth required: no. + +Examples: + +```bash +splat solana swap quote EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v So11111111111111111111111111111111111111112 100000 +``` + +### splat solana swap market + +Build a market swap transaction for a Solana wallet + +Auth required: no. + +Examples: + +```bash +splat solana swap market EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v So11111111111111111111111111111111111111112 100000 wallet_123 +``` + +### splat solana swap execute + +Build, sign, and submit a market swap with the delegated Turnkey CLI credential + +Auth required: yes. + +Examples: + +```bash +splat solana swap execute So11111111111111111111111111111111111111112 SPLAT_MINT 10000 wallet_123 +``` + +### splat solana swap submit + +Sign and submit a prepared Solana swap transaction with the delegated Turnkey CLI credential + +Auth required: yes. + +Examples: + +```bash +splat solana swap submit wallet_123 +``` + +### splat solana swap limit + +Build a limit swap transaction for a Solana wallet + +Auth required: no. + +Examples: + +```bash +splat solana swap limit EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v So11111111111111111111111111111111111111112 100000 98000 wallet_123 +``` + +### splat solana swap limit-execute + +Build, sign, and submit a Solana limit swap with the delegated Turnkey CLI credential + +Auth required: yes. + +Examples: + +```bash +splat solana swap limit-execute EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v So11111111111111111111111111111111111111112 100000 98000 wallet_123 +``` + +### splat solana swap limit-orders list + +List active Solana limit orders for a wallet + +Auth required: no. + +Examples: + +```bash +splat solana swap limit-orders list wallet_123 +``` + +### splat solana swap limit-orders cancel + +Build, sign, and submit Solana limit order cancellation transactions + +Auth required: yes. + +Examples: + +```bash +splat solana swap limit-orders cancel wallet_123 order_1,order_2 +``` + +### splat solana tokens + +List user token accounts for a Solana wallet + +Auth required: no. + +Examples: + +```bash +splat solana tokens wallet_123 +``` + +### splat solana pnl [day|week|month|all] + +Fetch Solana PnL data from the trading backend + +Auth required: no. + +Examples: + +```bash +splat solana pnl wallet_123 week +``` + +### splat solana trading-history + +Fetch Solana trading history by backend user id + +Auth required: no. + +Examples: + +```bash +splat solana trading-history user_123 +``` + +## commands + +### splat commands + +Show a structured catalog of CLI commands + +Auth required: no. + +Examples: + +```bash +splat commands +splat --json commands +``` + +## doctor + +### splat doctor + +Check CLI config, API reachability, and scope endpoint availability + +Auth required: no. + +Examples: + +```bash +splat doctor +splat --json doctor +``` + +## auth + +### splat auth + +Start first-party CLI login against the production platform by default + +Auth required: no. + +Examples: + +```bash +splat auth +splat auth login --dev +``` + +### splat auth login [--prod|--dev|--staging] [--api-url ] [--web-url ] [--no-open] [--enable-trading] + +Start first-party CLI login with production defaults, dev defaults, or explicit staging URLs + +Auth required: no. + +Examples: + +```bash +splat auth login +splat auth login --dev +splat auth login --dev --enable-trading +splat auth login --staging --api-url https://api.staging.asksplat.com --web-url https://terminal.staging.asksplate.com +``` + +### splat auth firebase-login [connectedEvmAddress] [connectedSolanaAddress] + +Developer-only Firebase token exchange flow for local backend testing + +Auth required: no. + +Examples: + +```bash +splat auth firebase-login FIREBASE_ID_TOKEN 0xTURNKEY_EVM TURNKEY_SOLANA TURNKEY_SOLANA_MEME +``` + +### splat auth save [apiUrl] + +Save an existing personal API token for CLI use + +Auth required: no. + +Examples: + +```bash +splat auth save splat_pat_value https://api.asksplat.com +``` + +### splat auth status + +Show whether local CLI auth is configured + +Auth required: no. + +Examples: + +```bash +splat auth status +``` + +### splat auth logout + +Clear saved local CLI auth + +Auth required: no. + +Examples: + +```bash +splat auth logout +``` + +### splat auth token list + +List personal API tokens using the saved or env-provided platform token + +Auth required: yes. + +Examples: + +```bash +splat auth token list +``` + +### splat auth token create