diff --git a/package.json b/package.json index 25a4ecd..e81e4b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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", "main": "./dist/index.ts", "types": "./dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 2e93512..9fa3108 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import http from "node:http"; import open from "open"; -import os from 'os'; +import os from "os"; import { buildAtprotoLoopbackClientMetadata, NodeOAuthClient, @@ -229,10 +229,12 @@ async function main() { Options: --streamer Specify target streamer handle/DID to view and post chat messages. Defaults to your own handle if omitted. + --silent Suppress the information messages printed above the chat and prompt. Examples: npm start -- alice.bsky.social npm start -- alice.bsky.social --streamer streamer.bsky.social + npm start -- alice.bsky.social --silent `), ); process.exit(0); @@ -265,17 +267,19 @@ async function main() { console.clear(); - console.log( - c.green(c.bold("Connected as:")) + - ` @${connectedAsHandle} (${session.did})`, - ); - console.log( - c.yellow(c.bold("Chat room streamer:")) + - ` @${targetStreamerHandle} (${targetStreamerDid})`, - ); - console.log( - c.gray("Type your message and hit Enter. Commands: /quit, /help\n"), - ); + if (args.includes("--silent") === false) { + console.log( + c.green(c.bold("Connected as:")) + + ` @${connectedAsHandle} (${session.did})`, + ); + console.log( + c.yellow(c.bold("Chat room streamer:")) + + ` @${targetStreamerHandle} (${targetStreamerDid})`, + ); + console.log( + c.gray("Type your message and hit Enter. Commands: /quit, /help\n"), + ); + } const rl = readline.createInterface({ input: process.stdin,