A secure, real-time command-line interface (CLI) chat application that enables developers to communicate anonymously using GitHub authentication. Built with Node.js, Firebase, and GitHub OAuth.
- GitHub Authentication - Seamless login using your GitHub account via OAuth device flow
- Real-time Messaging - Instant message delivery powered by Firebase Firestore
- Private & Global Chat - Send messages to specific users or broadcast to everyone
- Anonymous Communication - Chat using your GitHub username without exposing personal information
- Secure - Environment-based configuration keeps your credentials safe
- Developer-Friendly - Simple CLI interface designed for terminal enthusiasts
-
Clone the repository
git clone https://github.com/harshithvarma01/Git-CLI-Chat_App.git cd Git-CLI-Chat_App -
Install dependencies
npm install
-
Configure environment variables
Copy the example environment file:
cp .env.example .env
Edit
.envand add your credentials:# Firebase Configuration FIREBASE_API_KEY=your_firebase_api_key FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain FIREBASE_PROJECT_ID=your_firebase_project_id FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id FIREBASE_APP_ID=your_app_id # GitHub OAuth GITHUB_CLIENT_ID=your_github_oauth_client_id
- Go to Firebase Console
- Create a new project or use an existing one
- Enable Firestore Database in your project
- Go to Project Settings → General → Your apps
- Add a web app and copy the configuration values to your
.envfile
- Go to GitHub Developer Settings
- Click New OAuth App
- Fill in the application details:
- Application name: Git CLI Chat App (or your preferred name)
- Homepage URL:
http://localhost(or your app URL) - Authorization callback URL: Leave blank for device flow
- Click Register application
- Copy the Client ID to your
.envfile
Start the application:
npm start- The app will prompt you to authenticate with GitHub
- Open the provided URL in your browser
- Enter the verification code displayed in your terminal
- Authorize the application
- Select a recipient: Enter a GitHub username or type
allfor global chat - Start chatting: Type your message and press Enter
- Exit: Type
exitto quit the application
-
Global Messages - Visible to all users (sent to
all)[GLOBAL] @username: Hello everyone! -
Private Messages - Only visible to the specified recipient
[PRIVATE] @username: Hey, this is private!
- Node.js - Runtime environment
- Firebase Firestore - Real-time database
- GitHub OAuth - Authentication
- Inquirer.js - Interactive CLI prompts
- Chalk - Terminal styling
- dotenv - Environment variable management
Git-CLI-Chat_App/
├── index.js # Main application file
├── package.json # Dependencies and scripts
├── .env # Environment variables (not in git)
├── .env.example # Environment template
├── .gitignore # Git ignore rules
└── README.md # Documentation
- All sensitive credentials are stored in
.envfile - The
.envfile is excluded from version control via.gitignore - Never commit API keys or OAuth credentials to the repository
- Use the
.env.exampletemplate to share configuration structure
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Harshith Varma
- GitHub: @harshithvarma01
- Firebase for real-time database capabilities
- GitHub for OAuth authentication
- The open-source community for amazing tools and libraries
⭐ If you find this project useful, please consider giving it a star!