feat: add a silent flag

This commit is contained in:
Stevan Freeborn committed 2026-08-27 19:08:29 -05:00
1 parent 4ceee2072e
commit 7af9657bcf
2 files changed
+17 -13

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@stevanfreeborn/streamplace-term-chat", "name": "@stevanfreeborn/streamplace-term-chat",
"version": "0.0.0", "version": "0.1.0",
"description": "Terminal chat client for Streamplace built on AT Protocol and Jetstream", "description": "Terminal chat client for Streamplace built on AT Protocol and Jetstream",
"main": "./dist/index.ts", "main": "./dist/index.ts",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
+16 -12
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env node #!/usr/bin/env node
import http from "node:http"; import http from "node:http";
import open from "open"; import open from "open";
import os from 'os'; import os from "os";
import { import {
buildAtprotoLoopbackClientMetadata, buildAtprotoLoopbackClientMetadata,
NodeOAuthClient, NodeOAuthClient,
@@ -229,10 +229,12 @@ async function main() {
Options: Options:
--streamer Specify target streamer handle/DID to view and post chat messages. --streamer Specify target streamer handle/DID to view and post chat messages.
Defaults to your own handle if omitted. Defaults to your own handle if omitted.
--silent Suppress the information messages printed above the chat and prompt.
Examples: Examples:
npm start -- alice.bsky.social npm start -- alice.bsky.social
npm start -- alice.bsky.social --streamer streamer.bsky.social npm start -- alice.bsky.social --streamer streamer.bsky.social
npm start -- alice.bsky.social --silent
`), `),
); );
process.exit(0); process.exit(0);
@@ -265,17 +267,19 @@ async function main() {
console.clear(); console.clear();
console.log( if (args.includes("--silent") === false) {
c.green(c.bold("Connected as:")) + console.log(
` @${connectedAsHandle} (${session.did})`, c.green(c.bold("Connected as:")) +
); ` @${connectedAsHandle} (${session.did})`,
console.log( );
c.yellow(c.bold("Chat room streamer:")) + console.log(
` @${targetStreamerHandle} (${targetStreamerDid})`, c.yellow(c.bold("Chat room streamer:")) +
); ` @${targetStreamerHandle} (${targetStreamerDid})`,
console.log( );
c.gray("Type your message and hit Enter. Commands: /quit, /help\n"), console.log(
); c.gray("Type your message and hit Enter. Commands: /quit, /help\n"),
);
}
const rl = readline.createInterface({ const rl = readline.createInterface({
input: process.stdin, input: process.stdin,