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
+6 -2

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",
+5 -1
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,6 +267,7 @@ async function main() {
console.clear(); console.clear();
if (args.includes("--silent") === false) {
console.log( console.log(
c.green(c.bold("Connected as:")) + c.green(c.bold("Connected as:")) +
` @${connectedAsHandle} (${session.did})`, ` @${connectedAsHandle} (${session.did})`,
@@ -276,6 +279,7 @@ async function main() {
console.log( console.log(
c.gray("Type your message and hit Enter. Commands: /quit, /help\n"), 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,