pinets-cli

raw JSON →
0.1.14 verified Fri May 01 auth: no javascript

pinets-cli is a CLI wrapper for PineTS (v0.1.14), an open-source transpiler that runs Pine Script indicators outside of TradingView. It allows executing .pine files directly from the command line with live market data (Binance) or custom JSON datasets. The release cadence is irregular as it is early-stage. Key differentiators: no code setup, JSON output, stdin support, and multiple timeframe options. It is ideal for quick backtesting and indicator prototyping without an IDE.

error Error: Unsupported symbol. Please use a valid Binance symbol.
cause Symbol ticker is not recognized by Binance exchange.
fix
Use correct symbol like 'BTCUSDT', 'ETHUSDT', or 'BNBUSDT'.
error Error: Timeframe must be one of: 1, 5, 15, 60, 240, 1D, 1W, 1M
cause Invalid timeframe value provided via --timeframe option.
fix
Use one of the supported values: '1', '5', '15', '60', '240', '1D', '1W', '1M'.
error Error: File not found: ./nonexistent.pine
cause Pine script file path is incorrect or file does not exist.
fix
Ensure the file path is correct and file exists.
gotcha Symbol must be a Binance-valid ticker (e.g., BTCUSDT).
fix Use correct symbol format like BTCUSDT, ETHUSDT, etc.
deprecated The --data option accepts JSON but format must match internal candle structure (open, high, low, close, volume).
fix Ensure JSON file has array of objects with keys: open, high, low, close, volume as numbers.
breaking Version 0.1.0 changed from npx pinets to npx pinets-cli run.
fix Use 'pinets run' instead of 'pinets' directly.
gotcha Piped stdin may not work on Windows without cat or equivalent.
fix Use file argument or PowerShell's Get-Content pipe.
gotcha Output format 'full' (--format full) includes pinescript lines as keys which can be large.
fix Use --format default for cleaner output.
npm install pinets-cli
yarn add pinets-cli
pnpm add pinets-cli

Install pinets-cli globally, create a sample Pine Script file with SMA cross, and run it on BTCUSDT hourly data to get JSON output.

npm install -g pinets-cli
cat << 'EOF' > sma_cross.pine
//@version=5
indicator("SMA Cross", overlay=true)
fast = ta.sma(close, 9)
slow = ta.sma(close, 21)
plot(fast, "Fast SMA", color=color.blue)
plot(slow, "Slow SMA", color=color.red)
EOF
pinets run sma_cross.pine --symbol BTCUSDT --timeframe 60