pinets-cli 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pinets-cli.min.cjs
CHANGED
|
@@ -145,7 +145,7 @@ ${t}
|
|
|
145
145
|
Examples:
|
|
146
146
|
pinets run my_indicator.pine --symbol BTCUSDT
|
|
147
147
|
cat my_indicator.pine | pinets run --symbol BTCUSDT`):(Yt(a,"Reading indicator from stdin..."),n=await np(),n.trim()||Pt("Empty input received from stdin."),Yt(a,`Indicator: <stdin> (${n.length} chars)`));let o,u,c,h;if(e.data){const d=re.resolve(e.data);Xt.existsSync(d)||Pt(`Data file not found: ${d}`);let l;try{const x=Xt.readFileSync(d,"utf-8");l=JSON.parse(x)}catch(x){Pt(`Failed to parse JSON data file: ${x.message}`)}(!Array.isArray(l)||l.length===0)&&Pt("JSON data must be a non-empty array of candle objects.","Expected: [{ openTime, open, high, low, close, volume, closeTime }, ...]");const m=["open","high","low","close","volume"].filter(x=>l[0][x]===void 0);m.length>0&&Pt(`JSON candle data is missing required fields: ${m.join(", ")}`),o=l,Yt(a,`Data source: JSON file (${l.length} candles)`)}else e.symbol?(o=sp.Binance,u=e.symbol.toUpperCase(),c=e.timeframe,h=s,Yt(a,`Data source: Binance | ${u} | ${c} | ${s} candles`)):Pt("No data source provided.","Use --symbol <ticker> for live data or --data <file.json> for a JSON file.");try{const d=new wi(o,u,c,h);e.debug&&d.setDebugSettings({ln:!1,debug:!0}),Yt(a,"Executing...");const l=await d.run(n);Yt(a,"Done.");const m=ap(l,e.format,i,e.clean,e.plots),x=e.pretty!==void 0?!0:e.output?!1:!!process.stdout.isTTY;op(m,e.output,x,a)}catch(d){console.error(`Execution failed: ${d.message||d}`),e.debug&&d.stack&&console.error(d.stack),process.exit(1)}}async function hp(t,e){try{const i=new AbortController,r=setTimeout(()=>i.abort(),3e3),s=await fetch(`https://registry.npmjs.org/${e}/latest`,{signal:i.signal});if(clearTimeout(r),!s.ok)return null;const{version:a}=await s.json();return a&&a!==t?["",` Update available: ${t} \u2192 ${a}`,` Run: npm i -g ${e}`,""].join(`
|
|
148
|
-
`):null}catch{return null}}var lp="pinets-cli",pp="0.1.
|
|
148
|
+
`):null}catch{return null}}var lp="pinets-cli",pp="0.1.3",ls={name:lp,version:pp};const ps=ls.version,dp=ls.name,fp="Copyright (c) 2026 QuantForge.org",sr=`pinets cli v${ps}
|
|
149
149
|
${fp}`;async function mp(){const t=hp(ps,dp);qe.name("pinets").description("CLI for running Pine Script indicators via PineTS").version(sr,"-v, --version").addHelpText("after",`
|
|
150
150
|
${sr}`),qe.command("run").description("Execute a Pine Script indicator").argument("[file]","Path to indicator file (.pine or any text file)").option("-s, --symbol <ticker>","Symbol to query (e.g., BTCUSDT, ETHUSDT.P)").option("-t, --timeframe <tf>","Timeframe: 1, 5, 15, 60, 240, 1D, 1W, 1M","60").option("-d, --data <path>","Path to JSON data file (alternative to --symbol)").option("-o, --output <path>","Write output to file (default: stdout)").option("-f, --format <type>","Output format: default | full","default").option("--pretty","Pretty-print JSON output").option("--clean","Filter out null, false, and empty values from plot data").option("--plots <names>",'Comma-separated list of plot names to include, e.g. --plots "Buy,Sell"').option("-n, --candles <count>","Number of output candles","500").option("-w, --warmup <count>","Extra warmup candles for indicator init","0").option("--debug","Show transpiled code").option("-q, --quiet","Suppress informational messages").action(cp),await qe.parseAsync();const e=await Promise.race([t,new Promise(i=>setTimeout(()=>i(null),1e3))]);e&&console.error(e)}mp().catch(t=>{console.error(`Fatal: ${t.message||t}`),process.exit(1)});
|
|
151
151
|
//# sourceMappingURL=pinets-cli.min.cjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinets-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A CLI wrapper for PineTS that lets you run Pine Script indicators directly from the command line.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Pine",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pinets-cli": "./dist/pinets-cli.min.cjs"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
-
"dist"
|
|
32
|
+
"dist/pinets-cli.min.cjs"
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "cross-env BUILD=prod rollup -c",
|