shellmail 1.0.2 ā 1.0.4
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/index.js +23 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ program
|
|
|
20
20
|
.description("Create a new ShellMail address interactively")
|
|
21
21
|
.option("-l, --local <name>", "Local part of email address")
|
|
22
22
|
.option("-r, --recovery <email>", "Recovery email address")
|
|
23
|
+
.option("-a, --auto", "Auto-generate a random address")
|
|
23
24
|
.action(async (options) => {
|
|
24
25
|
console.log(chalk.bold("\nš§ ShellMail Setup\n"));
|
|
25
26
|
let local = options.local;
|
|
@@ -44,14 +45,20 @@ program
|
|
|
44
45
|
// Loop until we get a valid address
|
|
45
46
|
const api = new ShellMailAPI();
|
|
46
47
|
let result = null;
|
|
48
|
+
// If --auto flag, skip the name prompt
|
|
49
|
+
if (options.auto) {
|
|
50
|
+
local = "auto";
|
|
51
|
+
}
|
|
47
52
|
while (!result) {
|
|
48
53
|
if (!local) {
|
|
49
54
|
const answers = await inquirer.prompt([
|
|
50
55
|
{
|
|
51
56
|
type: "input",
|
|
52
57
|
name: "local",
|
|
53
|
-
message: `Choose your address:\n ${chalk.gray("_")}${chalk.cyan("@shellmail.ai")}\n `,
|
|
58
|
+
message: `Choose your address (or type "auto" for random):\n ${chalk.gray("_")}${chalk.cyan("@shellmail.ai")}\n `,
|
|
54
59
|
validate: (input) => {
|
|
60
|
+
if (input === "auto")
|
|
61
|
+
return true;
|
|
55
62
|
if (!input || input.length < 2)
|
|
56
63
|
return "Must be at least 2 characters";
|
|
57
64
|
if (!/^[a-z0-9][a-z0-9._-]*[a-z0-9]$/i.test(input) && input.length > 2) {
|
|
@@ -102,18 +109,26 @@ program
|
|
|
102
109
|
address: result.address,
|
|
103
110
|
});
|
|
104
111
|
console.log(chalk.green("\nā Config saved!\n"));
|
|
105
|
-
console.log(chalk.bold("Next steps:\n"));
|
|
106
|
-
console.log(` ${chalk.cyan("shellmail inbox")} Check your inbox`);
|
|
107
|
-
console.log(` ${chalk.cyan("shellmail otp -w 30")} Wait for an OTP code`);
|
|
108
|
-
console.log(` ${chalk.cyan("shellmail status")} Verify setup\n`);
|
|
109
112
|
}
|
|
110
113
|
else {
|
|
111
114
|
console.log(chalk.gray("\nSet SHELLMAIL_TOKEN env var to use the CLI:\n"));
|
|
112
115
|
console.log(chalk.cyan(` export SHELLMAIL_TOKEN="${result.token}"\n`));
|
|
113
|
-
console.log(chalk.bold("Then try:\n"));
|
|
114
|
-
console.log(` ${chalk.cyan("shellmail inbox")} Check your inbox`);
|
|
115
|
-
console.log(` ${chalk.cyan("shellmail otp -w 30")} Wait for an OTP code\n`);
|
|
116
116
|
}
|
|
117
|
+
// Show OpenClaw integration snippet
|
|
118
|
+
console.log(chalk.bold("ā".repeat(50)));
|
|
119
|
+
console.log(chalk.bold("\nOpenClaw Integration\n"));
|
|
120
|
+
console.log(chalk.gray("Add this to your openclaw.json:\n"));
|
|
121
|
+
console.log(chalk.cyan(`"shellmail": {
|
|
122
|
+
"apiUrl": "https://shellmail.ai",
|
|
123
|
+
"token": "${result.token}"
|
|
124
|
+
}`));
|
|
125
|
+
console.log(chalk.gray("\n(inside skills.entries)\n"));
|
|
126
|
+
// Show CLI commands
|
|
127
|
+
console.log(chalk.bold("ā".repeat(50)));
|
|
128
|
+
console.log(chalk.bold("\nCLI Commands\n"));
|
|
129
|
+
console.log(` ${chalk.cyan("shellmail inbox")} Check your inbox`);
|
|
130
|
+
console.log(` ${chalk.cyan("shellmail otp -w 30")} Wait for an OTP code`);
|
|
131
|
+
console.log(` ${chalk.cyan("shellmail status")} Verify setup\n`);
|
|
117
132
|
});
|
|
118
133
|
// āā Inbox Command āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
119
134
|
program
|