slack-term 1.33.0 → 1.34.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 +6 -0
- package/dist/cli.js +83 -82
- package/package.json +1 -1
- package/ts/cli.ts +20 -0
package/package.json
CHANGED
package/ts/cli.ts
CHANGED
|
@@ -4494,6 +4494,26 @@ async function main(): Promise<void> {
|
|
|
4494
4494
|
});
|
|
4495
4495
|
},
|
|
4496
4496
|
)
|
|
4497
|
+
.command(
|
|
4498
|
+
"env",
|
|
4499
|
+
"Print active workspace credentials in dotenv format",
|
|
4500
|
+
() => {},
|
|
4501
|
+
(argv) => {
|
|
4502
|
+
const token = resolveToken(argv.workspace);
|
|
4503
|
+
const cookie = token.startsWith("xoxc-") ? resolveCookie(argv.workspace) : undefined;
|
|
4504
|
+
const entries = [["SLACK_TOKEN", token]];
|
|
4505
|
+
if (cookie) entries.push(["SLACK_COOKIE", cookie]);
|
|
4506
|
+
// Single quotes keep dotenv and shell consumers from expanding values.
|
|
4507
|
+
// Validate everything before printing so failures cannot leave partial output.
|
|
4508
|
+
const lines = entries.map(([key, value]) => {
|
|
4509
|
+
if (/[\r\n\0']/.test(value!)) {
|
|
4510
|
+
throw new Error(`Cannot export ${key}: unsupported characters in credential`);
|
|
4511
|
+
}
|
|
4512
|
+
return `${key}='${value}'`;
|
|
4513
|
+
});
|
|
4514
|
+
console.log(lines.join("\n"));
|
|
4515
|
+
},
|
|
4516
|
+
)
|
|
4497
4517
|
.command(
|
|
4498
4518
|
"app",
|
|
4499
4519
|
"Create a new Slack app and obtain a token (guided wizard)",
|