@tigrisdata/cli 2.18.0-beta.2 → 2.18.0
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/README.md +296 -342
- package/SKILL.md +0 -3
- package/dist/{chunk-ZUJOS5T2.js → chunk-3L2I7HZB.js} +1 -1
- package/dist/chunk-DQMSOC2W.js +8 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/buckets/migrate.js +3 -3
- package/dist/lib/update.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +10 -10
- package/dist/chunk-BBX3M4S2.js +0 -8
package/SKILL.md
CHANGED
|
@@ -13,8 +13,6 @@ Use Tigris for all object storage tasks. Prefer the Tigris CLI (`tigris` or shor
|
|
|
13
13
|
- **Single endpoint**: `https://t3.storage.dev`
|
|
14
14
|
- **Region**: `auto` (Tigris handles routing automatically)
|
|
15
15
|
|
|
16
|
-
```
|
|
17
|
-
|
|
18
16
|
## Key Commands
|
|
19
17
|
|
|
20
18
|
### Authentication
|
|
@@ -56,4 +54,3 @@ Use Tigris for all object storage tasks. Prefer the Tigris CLI (`tigris` or shor
|
|
|
56
54
|
- Use `t3://` URI prefix for remote paths (e.g., `t3://my-bucket/path/file.txt`).
|
|
57
55
|
- The `t3` shorthand works for all commands: `t3 ls`, `t3 cp`, etc.
|
|
58
56
|
- Paths support both `t3://` and `tigris://` prefixes.
|
|
59
|
-
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,f as l}from"./chunk-
|
|
1
|
+
import{a as s,f as l}from"./chunk-DQMSOC2W.js";import{a as i,k as m}from"./chunk-QWBEROER.js";import{b as t}from"./chunk-PPNBQWSR.js";import{existsSync as c}from"fs";import{dirname as u,join as a}from"path";import{fileURLToPath as f}from"url";i();var j=f(import.meta.url),d=u(j),h=t(),y=o=>{if(o.length===0)return!1;let e=a(d,"lib",...o)+".js";if(c(e))return!0;let r=a(d,"lib",...o,"index.js");return!!c(r)},b=async o=>{let e=[`./lib/${o.join("/")}.js`,`./lib/${o.join("/")}/index.js`];for(let p of e){let n=await import(p).catch(()=>null);if(n)return{module:n,error:null}}return{module:null,error:`Command not found: ${o.join(" ")}`}},x=m({specs:h,version:s,loadModule:b,hasImplementation:y});x.parse();l();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as w,readFileSync as _,realpathSync as E,writeFileSync as I}from"fs";import T from"https";import{homedir as g}from"os";import{join as h}from"path";var u="2.18.0";var b=h(g(),".tigris","update-check.json");function y(){try{let e=_(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function v(e){try{w(h(g(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let a=i=>{let s=i.startsWith("v")?i.slice(1):i,l=null,o=s.indexOf("-");o!==-1&&(l=s.slice(o+1),s=s.slice(0,o));let c=s.split(".");if(c.length!==3)return null;let p=c.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:l}},r=a(e),t=a(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function x(){if(process.platform==="win32")return!1;try{let e=E(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function M(){return globalThis.__TIGRIS_BINARY===!0?x()?"brew upgrade tigris":process.platform==="win32"?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function k(e={}){return new Promise((n,a)=>{let r=T.get(d,{timeout:1e4},t=>{let i="";t.on("data",s=>{i+=s}),t.on("end",()=>{try{let s=JSON.parse(i);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),n(s.version)):a(new Error("Unexpected registry response"))}catch{a(new Error("Failed to parse registry response"))}})});r.on("error",t=>{a(t)}),r.on("timeout",()=>{r.destroy(),a(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function j(){k({unref:!0}).catch(()=>{})}function O(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(u,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${u} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',i=Math.max(r.length,t.length)+4,s="\u250C"+"\u2500".repeat(i-2)+"\u2510",l="\u2514"+"\u2500".repeat(i-2)+"\u2518",o=c=>"\u2502 "+c.padEnd(i-4)+" \u2502";console.log(`
|
|
2
|
+
${s}
|
|
3
|
+
${o("")}
|
|
4
|
+
${o(r)}
|
|
5
|
+
${o(t)}
|
|
6
|
+
${o("")}
|
|
7
|
+
${l}
|
|
8
|
+
`),v({...e,lastNotified:Date.now()})}let a=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>a)&&j()}export{u as a,y as b,N as c,M as d,k as e,O as f};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-3L2I7HZB.js";import"./chunk-DQMSOC2W.js";import"./chunk-QWBEROER.js";import"./chunk-SMBIT5FI.js";import"./chunk-DV3LCXRH.js";import"./chunk-JP3PXFIQ.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-3L2I7HZB.js";import"./chunk-DQMSOC2W.js";import"./chunk-QWBEROER.js";import"./chunk-SMBIT5FI.js";import"./chunk-DV3LCXRH.js";import"./chunk-JP3PXFIQ.js";import"./chunk-PPNBQWSR.js";import"./chunk-ATBINUDP.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as w}from"../../chunk-SAAGVLRE.js";import{a as
|
|
2
|
-
Interrupted. ${e.confirmed} confirmed, ${e.inFlight.length} still in-flight, ${e.total-e.scheduled} not yet scheduled.`),process.exit(1)),e.failed>0){if(S(u,`${e.failed} object(s) failed to migrate. ${e.confirmed} migrated successfully in ${I}.`),process.stderr.isTTY&&!globalThis.__TIGRIS_JSON_MODE&&e.errors.length>0){let f=e.errors.slice(0,10);for(let
|
|
3
|
-
Migration complete: ${e.confirmed.toLocaleString()} object(s) migrated (${
|
|
1
|
+
import{a as w}from"../../chunk-SAAGVLRE.js";import{a as h}from"../../chunk-IRDNZN7R.js";import{f as F}from"../../chunk-JQUG732D.js";import{d as v}from"../../chunk-EKLR55EQ.js";import{a as M}from"../../chunk-S6KFKBMY.js";import{b as m}from"../../chunk-SMBIT5FI.js";import"../../chunk-DV3LCXRH.js";import{d as S,j as y}from"../../chunk-JP3PXFIQ.js";import"../../chunk-PPNBQWSR.js";import"../../chunk-ATBINUDP.js";import"../../chunk-KK7FZ7QM.js";import"../../chunk-OHGCOC5Q.js";import{isMigrated as x,list as B,migrate as R}from"@tigrisdata/storage";var u=y("buckets","migrate"),N=10*1024*1024*1024,b=50,z=5e3,D=50,k=3,_=class{constructor(r,i,s,c){this.bucket=r;this.source=i;this.prefix=s;this.config=c}bucket;source;prefix;config;buffer=[];index=0;token;_done=!1;get done(){return this._done&&this.index>=this.buffer.length}async current(){return this.index<this.buffer.length?this.buffer[this.index]:this._done?null:(await this.fetchPage(),this.index<this.buffer.length?this.buffer[this.index]:null)}advance(){this.index++}async fetchPage(){if(this._done)return;let{data:r,error:i}=await B({prefix:this.prefix,source:this.source,...this.token?{paginationToken:this.token}:{},config:{...this.config,bucket:this.bucket}});if(i)throw i;this.buffer=r.items??[],this.index=0,this.token=r.paginationToken,!r.paginationToken&&!r.hasMore&&(this._done=!0)}};async function C(t,r,i){let s=new _(t,"shadow",r,i),c=new _(t,"tigris",r,i),o=[],n=await s.current(),a=await c.current();for(;n!==null;){if(a===null){o.push({name:n.name,size:n.size}),s.advance(),n=await s.current();continue}n.name<a.name?(o.push({name:n.name,size:n.size}),s.advance(),n=await s.current()):n.name>a.name?(c.advance(),a=await c.current()):(s.advance(),c.advance(),n=await s.current(),a=await c.current())}return o}function L(t){return new Promise(r=>setTimeout(r,t))}function E(t){let r=Math.floor(t/1e3),i=Math.floor(r/60),s=r%60;return i===0?`${s}s`:`${i}m ${s}s`}function p(t,r){if(!process.stderr.isTTY||globalThis.__TIGRIS_JSON_MODE)return;let i=E(Date.now()-t.startTime),s=`\rMigrating ${r}: ${t.confirmed.toLocaleString()} / ${t.total.toLocaleString()} objects | In-flight: ${h(t.inFlightBytes)} | ${i}`;process.stderr.write(s+" ".repeat(Math.max(0,100-s.length)))}function T(){!process.stderr.isTTY||globalThis.__TIGRIS_JSON_MODE||process.stderr.write("\r"+" ".repeat(100)+"\r")}async function $(t,r,i,s){let c=await w(t.map(o=>()=>R(o.name,{config:{...i,bucket:s}})),b);for(let o=0;o<c.length;o++){let n=c[o],a=t[o];n.error?(r.failed++,r.errors.push({name:a.name,error:n.error.message})):(r.inFlight.push({...a,checkFailures:0}),r.inFlightBytes+=a.size,r.scheduled++)}}async function O(t,r,i){if(t.inFlight.length===0)return;let s=t.inFlight.slice(0,b),c=await w(s.map(n=>()=>x(n.name,{config:{...r,bucket:i}})),b),o=new Set;for(let n=0;n<c.length;n++){let a=c[n],l=s[n];a.error?(l.checkFailures++,l.checkFailures>=k&&(o.add(l.name),t.failed++,t.inFlightBytes-=l.size,t.errors.push({name:l.name,error:`Failed to verify migration status after ${k} attempts`}))):a.data&&(o.add(l.name),t.confirmed++,t.confirmedBytes+=l.size,t.inFlightBytes-=l.size)}o.size>0&&(t.inFlight=t.inFlight.filter(n=>!o.has(n.name))),o.size===0&&await L(z)}async function P(t){let r=M(t,["path"]);r||m(u,"Bucket name or path is required");let{bucket:i,path:s}=F(r);i||m(u,"Invalid path");let c=await v(),o=!1,n=()=>{o=!0};process.on("SIGINT",n);try{process.stderr.isTTY&&!globalThis.__TIGRIS_JSON_MODE&&process.stderr.write("Discovering objects to migrate...");let a;try{a=await C(i,s,c)}catch(f){T(),m(u,f)}if(T(),a.length===0){process.stderr.isTTY&&!globalThis.__TIGRIS_JSON_MODE&&console.error("All objects are already migrated."),globalThis.__TIGRIS_JSON_MODE&&console.log(JSON.stringify({action:"migrate",bucket:i,toMigrate:0,confirmed:0,failed:0}));return}let l=a.reduce((f,d)=>f+d.size,0);process.stderr.isTTY&&!globalThis.__TIGRIS_JSON_MODE&&console.error(`Found ${a.length.toLocaleString()} objects to migrate (${h(l)})`);let e={total:a.length,totalBytes:l,scheduled:0,confirmed:0,confirmedBytes:0,failed:0,inFlight:[],inFlightBytes:0,errors:[],startTime:Date.now()},g=[];for(let f of a){if(o)break;for(;e.inFlightBytes+f.size>N&&e.inFlight.length>0&&!o;)await O(e,c,i),p(e,i);if(o)break;g.push(f),g.length>=D&&(await $(g,e,c,i),g=[],p(e,i))}for(g.length>0&&!o&&(await $(g,e,c,i),p(e,i));e.inFlight.length>0&&!o;)await O(e,c,i),p(e,i);T();let I=E(Date.now()-e.startTime);if(globalThis.__TIGRIS_JSON_MODE&&console.log(JSON.stringify({action:"migrate",bucket:i,toMigrate:e.total,scheduled:e.scheduled,confirmed:e.confirmed,failed:e.failed,elapsed:I,...e.errors.length>0?{errors:e.errors.slice(0,20)}:{}})),o&&(console.error(`
|
|
2
|
+
Interrupted. ${e.confirmed} confirmed, ${e.inFlight.length} still in-flight, ${e.total-e.scheduled} not yet scheduled.`),process.exit(1)),e.failed>0){if(S(u,`${e.failed} object(s) failed to migrate. ${e.confirmed} migrated successfully in ${I}.`),process.stderr.isTTY&&!globalThis.__TIGRIS_JSON_MODE&&e.errors.length>0){let f=e.errors.slice(0,10);for(let d of f)console.error(` ${d.name}: ${d.error}`);e.errors.length>10&&console.error(` ... and ${e.errors.length-10} more`)}process.exit(1)}console.error(`
|
|
3
|
+
Migration complete: ${e.confirmed.toLocaleString()} object(s) migrated (${h(e.confirmedBytes)}) in ${I}`)}finally{process.removeListener("SIGINT",n)}}export{P as default};
|
package/dist/lib/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-
|
|
1
|
+
import{b as d}from"../chunk-S6KFKBMY.js";import{a as t,c as l,d as p,e as f}from"../chunk-DQMSOC2W.js";import{b as m}from"../chunk-SMBIT5FI.js";import"../chunk-DV3LCXRH.js";import{b as s,c as i,f as a,j as c}from"../chunk-JP3PXFIQ.js";import"../chunk-PPNBQWSR.js";import"../chunk-ATBINUDP.js";import{execSync as h}from"child_process";var r=c("update");async function v(u={}){let g=d(u);s(r);try{let o=await f(),e=l(t,o),n=p();if(g==="json"){console.log(JSON.stringify({currentVersion:t,latestVersion:o,updateAvailable:e,updateCommand:n}));return}console.log(`Current version: ${t}`),e?(console.log(`Latest version: ${o}`),console.log("Updating..."),h(n,{stdio:"inherit",...process.platform==="win32"?{shell:"powershell.exe"}:{}}),i(r,{latestVersion:o})):a(r,{currentVersion:t})}catch(o){m(r,o)}}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"../chunk-DQMSOC2W.js";import"../chunk-ATBINUDP.js";export{e as checkForUpdates,d as fetchLatestVersion,c as getUpdateCommand,b as isNewerVersion,a as readUpdateCache};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "2.18.0
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@aws-sdk/credential-providers": "^3.
|
|
94
|
-
"@smithy/shared-ini-file-loader": "^4.4.
|
|
93
|
+
"@aws-sdk/credential-providers": "^3.1035.0",
|
|
94
|
+
"@smithy/shared-ini-file-loader": "^4.4.9",
|
|
95
95
|
"@tigrisdata/iam": "^2.1.0",
|
|
96
|
-
"@tigrisdata/storage": "^3.
|
|
96
|
+
"@tigrisdata/storage": "^3.2.0",
|
|
97
97
|
"commander": "^14.0.3",
|
|
98
98
|
"enquirer": "^2.4.1",
|
|
99
99
|
"jose": "^6.2.2",
|
|
@@ -105,17 +105,17 @@
|
|
|
105
105
|
"@commitlint/config-conventional": "^20.5.0",
|
|
106
106
|
"@eslint/js": "^10.0.1",
|
|
107
107
|
"@types/node": "^22.19.11",
|
|
108
|
-
"dotenv": "^17.4.
|
|
109
|
-
"eslint": "^10.2.
|
|
110
|
-
"eslint-plugin-simple-import-sort": "^
|
|
108
|
+
"dotenv": "^17.4.2",
|
|
109
|
+
"eslint": "^10.2.1",
|
|
110
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
111
111
|
"husky": "^9.1.7",
|
|
112
|
-
"prettier": "^3.8.
|
|
112
|
+
"prettier": "^3.8.3",
|
|
113
113
|
"publint": "^0.3.18",
|
|
114
114
|
"semantic-release": "^25.0.3",
|
|
115
115
|
"tsup": "^8.5.1",
|
|
116
116
|
"tsx": "^4.21.0",
|
|
117
117
|
"typescript": "^5.9.3",
|
|
118
|
-
"typescript-eslint": "^8.
|
|
119
|
-
"vitest": "^4.1.
|
|
118
|
+
"typescript-eslint": "^8.59.0",
|
|
119
|
+
"vitest": "^4.1.5"
|
|
120
120
|
}
|
|
121
121
|
}
|
package/dist/chunk-BBX3M4S2.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d,e as m,f}from"./chunk-ATBINUDP.js";import{mkdirSync as w,readFileSync as _,realpathSync as E,writeFileSync as I}from"fs";import T from"https";import{homedir as g}from"os";import{join as h}from"path";var u="2.18.0-beta.2";var b=h(g(),".tigris","update-check.json");function y(){try{let e=_(b,"utf-8"),n=JSON.parse(e);return typeof n.latestVersion=="string"&&typeof n.lastChecked=="number"?n:null}catch{return null}}function v(e){try{w(h(g(),".tigris"),{recursive:!0}),I(b,JSON.stringify(e),"utf-8")}catch{}}function N(e,n){let a=i=>{let s=i.startsWith("v")?i.slice(1):i,l=null,o=s.indexOf("-");o!==-1&&(l=s.slice(o+1),s=s.slice(0,o));let c=s.split(".");if(c.length!==3)return null;let p=c.map(Number);return p.some(isNaN)?null:{major:p[0],minor:p[1],patch:p[2],prerelease:l}},r=a(e),t=a(n);return!r||!t?!1:t.major>r.major?!0:t.major<r.major?!1:t.minor>r.minor?!0:t.minor<r.minor?!1:t.patch>r.patch?!0:t.patch<r.patch?!1:r.prerelease&&!t.prerelease?!0:(!r.prerelease&&t.prerelease,!1)}function x(){if(process.platform==="win32")return!1;try{let e=E(process.execPath);return e.includes("/Cellar/")||e.includes("/Caskroom/")}catch{return!1}}function M(){return globalThis.__TIGRIS_BINARY===!0?x()?"brew upgrade tigris":process.platform==="win32"?"irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex":"curl -fsSL https://github.com/tigrisdata/cli/releases/latest/download/install.sh | sh":"npm install -g @tigrisdata/cli"}function k(e={}){return new Promise((n,a)=>{let r=T.get(d,{timeout:1e4},t=>{let i="";t.on("data",s=>{i+=s}),t.on("end",()=>{try{let s=JSON.parse(i);typeof s.version=="string"?(v({...y(),latestVersion:s.version,lastChecked:Date.now()}),n(s.version)):a(new Error("Unexpected registry response"))}catch{a(new Error("Failed to parse registry response"))}})});r.on("error",t=>{a(t)}),r.on("timeout",()=>{r.destroy(),a(new Error("Request timed out"))}),e.unref&&r.on("socket",t=>{t.unref()}),r.end()})}function j(){k({unref:!0}).catch(()=>{})}function O(){if(process.env.TIGRIS_NO_UPDATE_CHECK==="1"||!process.stdout.isTTY)return;let e=y(),n=Number(process.env.TIGRIS_UPDATE_NOTIFY_INTERVAL_MS)||36e5;if(e&&N(u,e.latestVersion)&&(!e.lastNotified||Date.now()-e.lastNotified>n)){let r=`Update available: ${u} \u2192 ${e.latestVersion}`,t='Run "tigris update" to upgrade.',i=Math.max(r.length,t.length)+4,s="\u250C"+"\u2500".repeat(i-2)+"\u2510",l="\u2514"+"\u2500".repeat(i-2)+"\u2518",o=c=>"\u2502 "+c.padEnd(i-4)+" \u2502";console.log(`
|
|
2
|
-
${s}
|
|
3
|
-
${o("")}
|
|
4
|
-
${o(r)}
|
|
5
|
-
${o(t)}
|
|
6
|
-
${o("")}
|
|
7
|
-
${l}
|
|
8
|
-
`),v({...e,lastNotified:Date.now()})}let a=Number(process.env.TIGRIS_UPDATE_CHECK_INTERVAL_MS)||216e5;(!e||Date.now()-e.lastChecked>a)&&j()}export{u as a,y as b,N as c,M as d,k as e,O as f};
|