envlink 1.0.6 → 1.0.7

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.

Potentially problematic release.


This version of envlink might be problematic. Click here for more details.

package/README.md CHANGED
@@ -52,8 +52,8 @@ That's it! Your environment files are now installed.
52
52
 
53
53
  ## Documentation
54
54
 
55
- - **[commands.md](./commands.md)** - Complete command reference including update, expire, and advanced options
56
- - **[faq.md](./faq.md)** - Frequently Asked Questions
55
+ - **[Command Reference](https://envlink.ababilspark.com)** - Complete command reference
56
+ - **[FAQ](https://envlink.ababilspark.com/faq)** - Frequently Asked Questions
57
57
 
58
58
  ## Security
59
59
 
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @description Secure and anonymous environment file sharing CLI
6
6
  * @author Ababil Hossain <hi@ababilspark.com>
7
7
  * @license MIT
8
- * @version 1.0.6
8
+ * @version 1.0.7
9
9
  * @repository https://github.com/AbabilCore/envlink.git
10
10
  **/
11
11
  "use strict";var m3=Object.create;var Jp=Object.defineProperty;var g3=Object.getOwnPropertyDescriptor;var y3=Object.getOwnPropertyNames;var _3=Object.getPrototypeOf,D3=Object.prototype.hasOwnProperty;var c=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var w3=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y3(e))!D3.call(r,i)&&i!==t&&Jp(r,i,{get:()=>e[i],enumerable:!(n=g3(e,i))||n.enumerable});return r};var fr=(r,e,t)=>(t=r!=null?m3(_3(r)):{},w3(e||!r||!r.__esModule?Jp(t,"default",{value:r,enumerable:!0}):t,r));var Kn=c(hc=>{"use strict";var na=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},dc=class extends na{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};hc.CommanderError=na;hc.InvalidArgumentError=dc});var ia=c(pc=>{"use strict";var{InvalidArgumentError:E3}=Kn(),xc=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new E3(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function O3(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}pc.Argument=xc;pc.humanReadableArgName=O3});var mc=c(vc=>{"use strict";var{humanReadableArgName:S3}=ia(),bc=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,a)=>i.name().localeCompare(a.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),a=n.long&&e._findOption(n.long);!i&&!a?t.push(n):n.long&&!a?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(a=>!a.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>S3(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(a=>{let o=n(a);i.has(o)||i.set(o,[])}),t.forEach(a=>{let o=n(a);i.has(o)||i.set(o,[]),i.get(o).push(a)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function a(h,p){return t.formatItem(h,n,p,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],u=t.commandDescription(e);u.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(u),i),""]));let s=t.visibleArguments(e).map(h=>a(t.styleArgumentTerm(t.argumentTerm(h)),t.styleArgumentDescription(t.argumentDescription(h))));if(o=o.concat(this.formatItemList("Arguments:",s,t)),this.groupItems(e.options,t.visibleOptions(e),h=>h.helpGroupHeading??"Options:").forEach((h,p)=>{let v=h.map(b=>a(t.styleOptionTerm(t.optionTerm(b)),t.styleOptionDescription(t.optionDescription(b))));o=o.concat(this.formatItemList(p,v,t))}),t.showGlobalOptions){let h=t.visibleGlobalOptions(e).map(p=>a(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",h,t))}return this.groupItems(e.commands,t.visibleCommands(e),h=>h.helpGroup()||"Commands:").forEach((h,p)=>{let v=h.map(b=>a(t.styleSubcommandTerm(t.subcommandTerm(b)),t.styleSubcommandDescription(t.subcommandDescription(b))));o=o.concat(this.formatItemList(p,v,t))}),o.join(`
@@ -115,6 +115,6 @@ ${E.default.bold("Expiration password:")} ${E.default.green("Updated")}`);else{l
115
115
  ${E.default.bold("Expiration password:")} ${E.default.red("Removed")}`))}D.log("");let{confirm:o}=await ce.default.prompt([{type:"confirm",name:"confirm",message:"Proceed with update?",default:!1}]);if(!o){D.warn("Update cancelled.");return}D.start("Updating EnvLink...");let u=await Kr.post("/envlinks/update",{id:r,...i}),s=u.data.expiresAt?new Date(u.data.expiresAt).toLocaleString():"Never";D.success(`EnvLink updated successfully!
116
116
  `),D.log(E.default.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),D.log(` ${P.LINK} ${E.default.bold("ID:")} ${E.default.white(u.data.id)}`),u.data.filesCount&&D.log(` ${P.FILE} ${E.default.bold("Files:")} ${E.default.white(String(u.data.filesCount))}`),D.log(` ${P.CLOCK} ${E.default.bold("Expires:")} ${E.default.yellow(s)}`),D.log(E.default.cyan(`\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
117
117
  `))}catch(t){D.error(`Failed to update EnvLink: ${ra(t)}`,{terminate:!0,code:1})}};var gae=(r,e)=>{r.configureOutput({writeErr:()=>{},writeOut:t=>process.stdout.write(t)}),r.showHelpAfterError(!1),r.showSuggestionAfterError(!1),r.exitOverride(t=>{if(t.code==="commander.unknownOption"){let n=t.message.match(/unknown option '([^']+)'/)?.[1]||"option",i=e?` for ${e} command`:"";D.error(`Unknown option '${n}'${i}
118
- ${P.INFO} Try envlink ${e?`${e} `:""}--help for valid options.`,{terminate:!0,code:1});return}if((t.code==="commander.help"||t.code==="commander.version"||t.code==="commander.helpDisplayed")&&process.exit(0),t.code&&t.code.startsWith("commander.")){D.error(`Command error: ${t.message}`,{terminate:!0,code:1});return}throw t})},zr=gae;var d3=r=>{zr(r.command("create").description("Create a new EnvLink from local .env files").option("--exp <duration>","Set expiration (e.g., 30m, 24h, 5d, 6M, 1y, never)").option("--exp-pass <password>","Set expiration password").action(e=>{u3(e)}),"create")},h3=r=>{zr(r.command("install [id]").description("Install environment files from an EnvLink").option("-s, --select-files","Manually select files to install").action((e,t)=>{s3(e,t)}),"install")},x3=r=>{zr(r.command("update [id]").description("Update an existing EnvLink").option("--exp <duration>","Update expiration (e.g., 30m, 24h, 5d, 6M, 1y, never)").option("--exp-pass <password>","Update expiration password").option("--current-pass <password>","Current password (required for protected EnvLinks)").option("-f, --files","Update files from current directory").action((e,t)=>{f3(e,t)}),"update")},p3=r=>{zr(r.command("info [id]").description("Show EnvLink information (files, expiry, install count)").action(e=>{c3(e)}),"info")},b3=r=>{zr(r.command("expire [id]").description("Manually expire an EnvLink").option("--exp-pass <password>","Expiration password (if set during creation)").action((e,t)=>{l3(e,t)}),"expire")};var _ae={name:"envlink",version:"1.0.6",description:"Secure and anonymous environment file sharing CLI"},fc=_ae;var Ye=new f2;zr(Ye);var ta=process.argv;if(ta.includes("-v")&&!ta.includes("--version")&&!ta.includes("-V")){let r=ta.indexOf("-v");ta[r]="-V"}Ye.name(fc.name).description(fc.description).version(fc.version,"-V, --version","output the version number").helpOption("-h, --help","display help for command");d3(Ye);h3(Ye);x3(Ye);p3(Ye);b3(Ye);Ye.on("command:*",([r])=>{D.error(`Invalid command: ${r}
118
+ ${P.INFO} Try envlink ${e?`${e} `:""}--help for valid options.`,{terminate:!0,code:1});return}if((t.code==="commander.help"||t.code==="commander.version"||t.code==="commander.helpDisplayed")&&process.exit(0),t.code&&t.code.startsWith("commander.")){D.error(`Command error: ${t.message}`,{terminate:!0,code:1});return}throw t})},zr=gae;var d3=r=>{zr(r.command("create").description("Create a new EnvLink from local .env files").option("--exp <duration>","Set expiration (e.g., 30m, 24h, 5d, 6M, 1y, never)").option("--exp-pass <password>","Set expiration password").action(e=>{u3(e)}),"create")},h3=r=>{zr(r.command("install [id]").description("Install environment files from an EnvLink").option("-s, --select-files","Manually select files to install").action((e,t)=>{s3(e,t)}),"install")},x3=r=>{zr(r.command("update [id]").description("Update an existing EnvLink").option("--exp <duration>","Update expiration (e.g., 30m, 24h, 5d, 6M, 1y, never)").option("--exp-pass <password>","Update expiration password").option("--current-pass <password>","Current password (required for protected EnvLinks)").option("-f, --files","Update files from current directory").action((e,t)=>{f3(e,t)}),"update")},p3=r=>{zr(r.command("info [id]").description("Show EnvLink information (files, expiry, install count)").action(e=>{c3(e)}),"info")},b3=r=>{zr(r.command("expire [id]").description("Manually expire an EnvLink").option("--exp-pass <password>","Expiration password (if set during creation)").action((e,t)=>{l3(e,t)}),"expire")};var _ae={name:"envlink",version:"1.0.7",description:"Secure and anonymous environment file sharing CLI"},fc=_ae;var Ye=new f2;zr(Ye);var ta=process.argv;if(ta.includes("-v")&&!ta.includes("--version")&&!ta.includes("-V")){let r=ta.indexOf("-v");ta[r]="-V"}Ye.name(fc.name).description(fc.description).version(fc.version,"-V, --version","output the version number").helpOption("-h, --help","display help for command");d3(Ye);h3(Ye);x3(Ye);p3(Ye);b3(Ye);Ye.on("command:*",([r])=>{D.error(`Invalid command: ${r}
119
119
  ${P.INFO} Try envlink --help for a list of available commands.`,{terminate:!0,code:1})});process.argv.slice(2).length||(Ye.outputHelp(),D.log(""),D.error("No command provided! Try envlink --help to see available commands.",{terminate:!0,code:1}));Ye.parse(process.argv);
120
120
  //# sourceMappingURL=index.js.map
package/faq.md ADDED
@@ -0,0 +1,166 @@
1
+ # EnvLink FAQ
2
+
3
+ ## General
4
+
5
+ <details>
6
+ <summary>What is EnvLink?</summary>
7
+
8
+ EnvLink is a secure and anonymous CLI tool for sharing environment (.env) files with your team. It allows you to share sensitive configuration files with built-in expiration and optional password protection without requiring signup or authentication.
9
+
10
+ </details>
11
+
12
+ <details>
13
+ <summary>How do I install EnvLink?</summary>
14
+
15
+ You can install EnvLink globally with `npm install -g envlink`, or use it without installation via `npx envlink`, `bunx envlink`, or `pnpm dlx envlink`.
16
+
17
+ </details>
18
+
19
+ <details>
20
+ <summary>What is the basic workflow for sharing .env files?</summary>
21
+
22
+ Run `envlink create` in your project directory to create an EnvLink and get a unique ID (e.g., el_abc123xyz456). Share this ID with your team, and they can run `envlink install el_abc123xyz456` to receive the files.
23
+
24
+ </details>
25
+
26
+ <details>
27
+ <summary>Do I need to create an account to use EnvLink?</summary>
28
+
29
+ No, EnvLink is completely anonymous and does not require any signup or authentication.
30
+
31
+ </details>
32
+
33
+ <details>
34
+ <summary>What Node.js version is required?</summary>
35
+
36
+ EnvLink requires Node.js version 18.0.0 or higher.
37
+
38
+ </details>
39
+
40
+ ## Commands
41
+
42
+ <details>
43
+ <summary>How do I see all available commands?</summary>
44
+
45
+ Run `envlink --help` to see all commands, or `envlink <command> --help` for help with a specific command.
46
+
47
+ </details>
48
+
49
+ <details>
50
+ <summary>How do I check the status of an EnvLink?</summary>
51
+
52
+ Use `envlink info <id>` to view details including status, file count, expiration date, install count, and file names.
53
+
54
+ </details>
55
+
56
+ <details>
57
+ <summary>Can I update an existing EnvLink?</summary>
58
+
59
+ Yes, use `envlink update <id>` with options like `--files` to update files, `--exp` to change expiration, or `--exp-pass` to modify the password. Protected links require `--current-pass` for authentication.
60
+
61
+ </details>
62
+
63
+ <details>
64
+ <summary>How do I manually expire an EnvLink?</summary>
65
+
66
+ Use `envlink expire <id>` to manually expire a link. If the link is password-protected, include `--exp-pass <password>` for validation.
67
+
68
+ </details>
69
+
70
+ <details>
71
+ <summary>Can I select which files to install?</summary>
72
+
73
+ Yes, use `envlink install <id> --select-files` or `-s` to get a prompt allowing you to choose which files to install.
74
+
75
+ </details>
76
+
77
+ ## Expiration
78
+
79
+ <details>
80
+ <summary>What expiration formats are supported?</summary>
81
+
82
+ EnvLink supports: minutes (m), hours (h), days (d), months (M), years (y), or 'never'. Examples: `30m` for 30 minutes, `24h` for 24 hours, `5d` for 5 days, `6M` for 6 months, `1y` for 1 year, or `never` for permanent links.
83
+
84
+ </details>
85
+
86
+ <details>
87
+ <summary>What is the default expiration time?</summary>
88
+
89
+ The default expiration time is 1 day if not specified during creation.
90
+
91
+ </details>
92
+
93
+ <details>
94
+ <summary>Can I create an EnvLink that never expires?</summary>
95
+
96
+ Yes, use `--exp never` when creating or updating an EnvLink to make it permanent.
97
+
98
+ </details>
99
+
100
+ <details>
101
+ <summary>What happens to expired EnvLinks?</summary>
102
+
103
+ Expired EnvLinks cannot be installed or updated. The status automatically changes to 'expired' when the expiration date is reached or when manually expired. Additionally, the record will be deleted from the EnvLink server after expiration.
104
+
105
+ </details>
106
+
107
+ ## Security
108
+
109
+ <details>
110
+ <summary>Can I protect my EnvLink with a password?</summary>
111
+
112
+ Yes, use the `--exp-pass <password>` option when creating or updating an EnvLink. Password-protected links require authentication for updates and manual expiration.
113
+
114
+ </details>
115
+
116
+ <details>
117
+ <summary>How is my data secured?</summary>
118
+
119
+ All file content is encrypted using AES-256-GCM encryption before storage. The encryption uses a unique initialization vector (IV) for each EnvLink, and passwords are hashed using bcrypt.
120
+
121
+ </details>
122
+
123
+ ## File Limits
124
+
125
+ <details>
126
+ <summary>How many files can I share in one EnvLink?</summary>
127
+
128
+ You can share up to 10 .env files in a single EnvLink.
129
+
130
+ </details>
131
+
132
+ <details>
133
+ <summary>What is the file size limit?</summary>
134
+
135
+ Each individual file can be up to 100KB, and the total payload for all files combined cannot exceed 500KB.
136
+
137
+ </details>
138
+
139
+ <details>
140
+ <summary>What file naming patterns are accepted?</summary>
141
+
142
+ Files must follow the .env naming pattern: `.env` or `.env.{suffix}` where suffix can contain alphanumeric characters, underscores, or hyphens (e.g., .env, .env.local, .env.production).
143
+
144
+ </details>
145
+
146
+ ## Technical
147
+
148
+ <details>
149
+ <summary>What is the format of an EnvLink ID?</summary>
150
+
151
+ EnvLink IDs follow the format `el_` followed by 16 alphanumeric characters (e.g., el_abc123xyz456).
152
+
153
+ </details>
154
+
155
+ <details>
156
+ <summary>What happens if a file already exists during installation?</summary>
157
+
158
+ EnvLink will detect existing files and prompt you to confirm overwriting them. Files marked as existing will show a warning indicator during the selection process.
159
+
160
+ </details>
161
+
162
+ ## Note:
163
+
164
+ > **"If EnvLink doesn't resonate with your workflow, that's perfectly fine—you're free to choose what works best for you. But if it does, I hope it makes sharing environment files just a little bit easier and safer for your team."**
165
+ >
166
+ > — _**envlink** developer team_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envlink",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Secure and anonymous environment file sharing CLI",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -45,6 +45,7 @@
45
45
  "dist/index.js",
46
46
  "README.md",
47
47
  "commands.md",
48
+ "faq.md",
48
49
  "LICENSE"
49
50
  ],
50
51
  "devDependencies": {