Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polylayer CLI

Agent-friendly access to Polylayer’s public v1 API. Both executable names are identical:

polylayer --help
plyr --help

Install

With npm:

npm install --global @polylayer/cli

Until the npm package is published, install the same npm package from GitHub:

npm install --global github:polylayer/polylayer-cli

Or install the latest checksummed release artifact:

curl -fsSL https://raw.githubusercontent.com/polylayer/polylayer-cli/refs/heads/main/install.sh | sh

The installer downloads a versioned release archive and SHA256SUMS, verifies the archive, installs its runtime under ~/.local/lib/polylayer-cli and the polylayer/plyr command links under ~/.local/bin, and never uses sudo. Pin a release with POLYLAYER_VERSION=0.1.1.

Authenticate

Create a unified or paper-only key in Polylayer Settings → API Keys, then:

polylayer login plyr_...
polylayer whoami
polylayer doctor

Key precedence is --key, POLYLAYER_API_KEY, then the owner-only config file at ${XDG_CONFIG_HOME:-~/.config}/polylayer/config.json. The CLI never prints the key.

Reads and paper trading

polylayer positions --platform hyperliquid
polylayer fills --platform polymarket

polylayer paper accounts
polylayer paper create '{"displayName":"Agent sandbox","startingCapitalUsd":25000}'
polylayer paper order paper_123 order.json
polylayer paper portfolio paper_123

The paper username is required only for the first sandbox. Paper starting capital cannot be reset or topped up; create a new sandbox instead.

Automations and agents

polylayer docs > polylayer-docs.md
polylayer strategies schema > strategy-schema.json
polylayer strategies validate strategy.json
polylayer strategies create strategy.json --yes
polylayer strategies list

The recommended agent workflow is: give the agent the CLI and official docs, have it author a StrategyBodyV2, validate, inspect, then deploy with an explicit --yes. Paper-only keys can only deploy paper strategies.

Live writes

Live/destructive commands require an interactive yes or explicit --yes:

polylayer hyperliquid order order.json --yes
polylayer jupiter open position.json --yes
polylayer polymarket order order.json --yes
polylayer yield deposit deposit.json --yes

Use --idempotency-key when a caller needs a stable retry key. --output compact emits one-line JSON. The api passthrough accepts only relative v1 paths so a bearer key cannot accidentally be sent to another origin.

Official documentation: https://polylayer.gitbook.io/docs/

About

Official agent-friendly CLI for Polylayer trading, paper sandboxes, and automations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages