slack-term 1.32.5 → 1.33.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 +10 -0
- package/dist/cli.js +70 -70
- package/package.json +1 -1
- package/ts/auth.ts +1 -1
- package/ts/cli.ts +6 -2
- package/ts/profiles.ts +1 -1
- package/ts/slack.ts +1 -1
package/package.json
CHANGED
package/ts/auth.ts
CHANGED
|
@@ -342,7 +342,7 @@ export async function cmdAuthChrome(opts: { workspace?: string } = {}): Promise<
|
|
|
342
342
|
export async function cmdAuthFirefox(opts: { workspace?: string } = {}): Promise<void> {
|
|
343
343
|
const profiles = listProfiles();
|
|
344
344
|
if (profiles.length === 0) {
|
|
345
|
-
console.error("No workspaces configured. Run: slack auth
|
|
345
|
+
console.error("No workspaces configured. Run: slack auth login");
|
|
346
346
|
process.exit(1);
|
|
347
347
|
}
|
|
348
348
|
|
package/ts/cli.ts
CHANGED
|
@@ -530,7 +530,7 @@ async function cmdSearch(token: string, query: string, count: number, json: bool
|
|
|
530
530
|
} else {
|
|
531
531
|
console.error(
|
|
532
532
|
"Error: search requires a user token (xoxp-/xoxc-) — the active profile is a bot token (xoxb-), which Slack rejects for search.messages.\n" +
|
|
533
|
-
" Add a user-token profile: slack auth login (or slack auth token)\n" +
|
|
533
|
+
" Add a user-token profile: slack auth login (or slack auth login --token <token>)\n" +
|
|
534
534
|
" Then select it: slack auth use <name> (or pass --workspace <name>)",
|
|
535
535
|
);
|
|
536
536
|
process.exit(1);
|
|
@@ -4479,11 +4479,15 @@ async function main(): Promise<void> {
|
|
|
4479
4479
|
(y) => y
|
|
4480
4480
|
.command(
|
|
4481
4481
|
"token",
|
|
4482
|
-
"
|
|
4482
|
+
"Print the active token (or save one with --token)",
|
|
4483
4483
|
(y2) => y2
|
|
4484
4484
|
.option("token", { type: "string", describe: "Token to save directly (non-interactive)" })
|
|
4485
4485
|
.option("name", { type: "string", describe: "Workspace name (used with --token)" }),
|
|
4486
4486
|
async (argv) => {
|
|
4487
|
+
if (argv.token === undefined) {
|
|
4488
|
+
console.log(resolveToken(argv.workspace));
|
|
4489
|
+
return;
|
|
4490
|
+
}
|
|
4487
4491
|
await cmdAuthToken({
|
|
4488
4492
|
...(argv.token !== undefined ? { token: argv.token } : {}),
|
|
4489
4493
|
...(argv.name !== undefined ? { name: argv.name } : {}),
|
package/ts/profiles.ts
CHANGED
|
@@ -270,7 +270,7 @@ export function resolveToken(workspaceFlag?: string): string {
|
|
|
270
270
|
throw new Error(
|
|
271
271
|
"No Slack token found.\n" +
|
|
272
272
|
" Run one of:\n" +
|
|
273
|
-
" slack auth
|
|
273
|
+
" slack auth login — paste an existing xoxp-/xoxb- token\n" +
|
|
274
274
|
" slack auth chrome — import from Chrome browser (macOS)\n" +
|
|
275
275
|
" slack auth app — guided Slack app creation\n" +
|
|
276
276
|
" Or set SLACK_TOKEN=xoxp-... in .slack-term/.env.local",
|
package/ts/slack.ts
CHANGED
|
@@ -49,7 +49,7 @@ async function call(token: string, method: string, init: RequestInit, cookie?: s
|
|
|
49
49
|
`Desktop app token (xoxc-) needs its session cookie to be accepted by the public Slack API.\n` +
|
|
50
50
|
`Attach it: slack auth chrome (macOS) or slack auth firefox\n` +
|
|
51
51
|
`Or replace the token with an xoxp- user token:\n` +
|
|
52
|
-
` slack auth
|
|
52
|
+
` slack auth login`,
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
// Bot tokens (xoxb-) can't act as a user: they lack user scopes (missing_scope) and can't
|