@sentimentor/pinenode-cli
v0.1.0
Published
Sentimentor PineNode CLI — run PineNode strategies, fetch market data, optimize parameters, and deploy to paper/live trading from your terminal.
Maintainers
Readme
@sentimentor/pinenode-cli
The PineNode command-line interface. Run PineNode strategies, fetch market data, optimize parameters, and deploy to paper / live trading — all from your terminal.
Plan-aware. The CLI is part of every Sentimentor subscription. Pro runs local backtests against your own data; anything that calls a Sentimentor API (data fetch, sentimentor inputs, optimizer, cloud library, deploy) requires Elite or Trader; live deploy is Trader-only. See the plan matrix.
Install
npm install -g @sentimentor/pinenode-cliThis installs a sentimentor binary. The pinenode keyword is the CLI's namespace:
sentimentor pinenode help(Plain sentimentor run ... also works — the pinenode prefix is optional.)
Authentication
The CLI is free to install. Most features need a Sentimentor account:
sentimentor pinenode loginThat opens https://app.sentimentor.com/account/cli-tokens. Click Generate token, copy the value, paste it back at the CLI prompt. The token is stored in ~/.config/sentimentor/credentials.json (mode 600). To check what's saved:
sentimentor pinenode whoamiSign out (revokes the token server-side too):
sentimentor pinenode logoutCommands
Backtest (pinenode run)
Local backtest against your own data — all plans (Pro, Elite, Trader):
sentimentor pinenode run strategy.pinenode --bars bars.json
sentimentor pinenode run strategy.pine --bars bars.csv --capital 25000 --jsonFetched bars + optional Sentimentor inputs — Elite or Trader:
sentimentor pinenode run strategy.pinenode --ticker NVDA --days 365 --timeframe 1d
sentimentor pinenode run strategy.pinenode --ticker NVDA --sentimentorData (pinenode fetch)
Pull historical OHLCV bars to disk — Elite or Trader:
sentimentor pinenode fetch --ticker AAPL --days 730 --timeframe 1d --out aapl.jsonOptimize (pinenode optimize)
Grid-search every pn.param(...) declaration in the strategy on Sentimentor's optimizer service — Elite or Trader:
sentimentor pinenode optimize strategy.pinenode --ticker NVDA --days 365
sentimentor pinenode optimize strategy.pinenode --ticker NVDA --grid grid.json --jsongrid.json shape:
{
"Fast Period": { "min": 5, "max": 50, "step": 5 },
"Slow Period": { "min": 20, "max": 200, "step": 10 }
}When --grid is omitted, the optimizer uses the bounds declared in each pn.param(...) call.
Cloud library (pinenode push / pull)
Round-trip strategies through your Sentimentor cloud library — Elite or Trader:
sentimentor pinenode push strategy.pinenode --name "NVDA EMA Cross"
sentimentor pinenode pull # list saved strategies
sentimentor pinenode pull <id> --out strat.pinenodeDeploy (pinenode deploy)
Paper trading — Elite or Trader:
sentimentor pinenode deploy strategy.pinenode --ticker NVDA --paper --capital 10000Live trading — Trader (prompts for confirmation unless --yes):
sentimentor pinenode deploy strategy.pinenode --ticker NVDA --live --capital 5000 \
--stop-loss-pct 2 --take-profit-pct 6 --position-size-pct 25 --yesStop a running deployment:
sentimentor pinenode deploy stop <deployment-id>File formats
Strategies
| Extension | Treated as |
|---|---|
| .pinenode, .js, .ts | PineNode JS — executed as-is |
| .pine | Pine v5 — auto-transpiled before execution; warnings are surfaced |
Bars
JSON:
[
{ "time": 1735689600000, "open": 100.5, "high": 101.2, "low": 100.1, "close": 100.8, "volume": 1234567 }
]CSV (header required, columns order-independent):
time,open,high,low,close,volume
2024-01-02T09:30:00Z,100.5,101.2,100.1,100.8,1234567time accepts Unix milliseconds, an integer string, or any ISO-8601 datetime.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Command completed successfully |
| 1 | Usage error / bad input |
| 2 | Strategy failed to load (transpile / sandbox error) |
| 3 | Backtest threw at runtime |
| 4 | Upgrade required — your plan doesn't include this command |
| 5 | Not logged in — run sentimentor pinenode login |
| 6 | API error from api.sentimentor.com |
| 99 | Unexpected CLI bug — please file an issue |
Environment overrides
| Variable | Default | Use case |
|---|---|---|
| SENTIMENTOR_API_BASE | https://api.sentimentor.com | Point at staging / dev environments |
| SENTIMENTOR_WEB_BASE | https://app.sentimentor.com | Same, for the login URL |
| NO_COLOR | 0 | Disable ANSI colors |
| XDG_CONFIG_HOME | ~/.config | Move credentials file location |
Plan matrix
Sentimentor has three subscription tiers — Pro, Elite, and Trader. The CLI ships with every plan; what you can do with it scales with your tier. The general rule: anything that calls a Sentimentor API needs Elite or Trader, and live execution is Trader-only.
| Command | Pro | Elite | Trader |
|---|---|---|---|
| login / logout / whoami / help | ✓ | ✓ | ✓ |
| run --bars <file> (local backtest) | ✓ | ✓ | ✓ |
| run --ticker / fetch | — | ✓ | ✓ |
| run --sentimentor | — | ✓ | ✓ |
| optimize | — | ✓ | ✓ |
| push / pull (cloud library) | — | ✓ | ✓ |
| deploy --paper (ships in 2.2) | — | ✓ | ✓ |
| deploy --live (ships in 2.2) | — | — | ✓ |
When the CLI tries to run a command your current tier doesn't include, it exits with code 4 and a colored "Upgrade required" message that links straight to billing.
License
Apache-2.0
