boring-business-card-generator
v1.0.3
Published
A CLI tool to generate personalized business card CLI packages for npm
Maintainers
Readme
Boring Business Card Generator
A CLI tool to generate personalized business card CLI packages for npm. By running npx boring-business-card-generator, users can answer a series of prompts about their professional details, provide npm credentials, and automatically create and publish a custom npm package. This package, when executed with npx <your-package-name>, displays a professional business card in the terminal, styled with a cyan double border and black background, similar to the pinak95 card.
How It Works
The boring-business-card-generator simplifies the creation of a digital business card that runs as a CLI tool. Here's a detailed breakdown of the process:
Run the Generator:
- Execute
npx boring-business-card-generatorin your terminal. - The tool clears the terminal and displays a welcome message.
- Execute
Answer Prompts for Personal Details:
- Full Name: Your full name (e.g., "Eren Yeager").
- Handle: Your social media handle (e.g., "@attacktitan").
- Job Profile: Your current role or status (e.g., "Software Developer").
- GitHub URL: Your GitHub profile URL (optional, e.g., "https://github.com/attacktitan").
- LinkedIn URL: Your LinkedIn profile URL (optional, e.g., "https://www.linkedin.com/in/attacktitan/"). The messaging ID is automatically extracted from this URL.
- Portfolio URL: Your portfolio website URL (optional, e.g., "https://attacktitan.com").
- Certifications: Any certifications you hold (e.g., "AWS Certified Developer" or "none").
- Tagline: A personal or professional tagline (optional, e.g., "Pinnacle of Speed, Power & Skill").
- Email: Your email address (e.g., "[email protected]").
- Package Name: The npm package name for your card (e.g., "attacktitan", must be lowercase).
Provide npm Credentials:
- Username: Your npm username (create an account at npmjs.com if needed).
- Password: Your npm password (input is masked for security).
- Email: Your npm account email.
- 2FA Code: Your npm two-factor authentication code (optional, if enabled).
- These credentials are used to authenticate with npm and publish the package.
Package Generation:
- The tool creates a directory named after your package (e.g.,
attacktitan) containing:- card.js: The main CLI script that displays your business card with interactive options (email, LinkedIn messaging, portfolio, GitHub, exit).
- package.json: Configures the package for npm publishing, including dependencies and metadata.
- README.md: Documents the card’s usage, features, and contact details.
- LICENSE: MIT License with your name.
- The card is styled with a cyan double border, black background, and optimized text alignment.
- The tool creates a directory named after your package (e.g.,
Authentication and Publishing:
- The tool authenticates with npm using your credentials.
- Installs dependencies (
npm install) in the generated directory. - Publishes the package to npm (
npm publish). - If authentication or publishing fails (e.g., package name taken, invalid credentials), instructions are provided for manual publishing.
Run Your Card:
- After publishing, run
npx <your-package-name>(e.g.,npx attacktitan) anywhere to display your card. - The card shows your details and offers interactive options to open links or exit.
- After publishing, run
Example Output
For a user named Eren Yeager with the handle @attacktitan, the card might look like this (simulated terminal output):
┌─────────────────────────── Eren Yeager's Business Card ───────────────────────────┐
│ │
│ Eren Yeager / @attacktitan │
│ │
│ Work: Software Developer │
│ GitHub: github.com/attacktitan │
│ LinkedIn: linkedin.com/in/attacktitan │
│ │
│ Card: npx attacktitan │
│ Pinnacle of Speed, Power & Skill │
│ │
└───────────────────────────────────────────────────────────────────────────────────┘
Tip: cmd/ctrl + click on links to open them
What would you like to do?
> Send me an email 📧
Message me on LinkedIn 💬
Check my GitHub 💻
ExitSelecting an option (e.g., "Send me an email") opens the default email client with mailto:[email protected].
Features
- Interactive CLI: Collects user details and npm credentials via intuitive prompts.
- Customizable Card:
- Displays only provided details (e.g., skips GitHub if not provided).
- Supports optional fields for flexibility.
- Includes a LinkedIn messaging option if a LinkedIn URL is provided.
- Professional Styling:
- Cyan double border with a black background, inspired by the
pinak95card. - Centered title and aligned text for readability.
- Cyan double border with a black background, inspired by the
- Performance:
- Cached strings to reduce runtime concatenation.
- Async operations for opening links.
- Generated Package:
- ESM-based (
"type": "module") for modern JavaScript. - Dependencies:
[email protected],[email protected],[email protected],[email protected],[email protected]. - MIT License for open-source compatibility.
- ESM-based (
- NPM Integration:
- Automates authentication and publishing.
- Handles errors with clear manual publishing steps.
- Compatibility: Runs on Node.js v22.5.1 or later.
Installation
Run the tool directly via npm:
npx boring-business-card-generatorLocal Setup
- Clone the repository:
git clone https://github.com/pinak95/boringBusinessCardGenerator.git cd boringBusinessCardGenerator - Ensure Node.js v22.5.1 is installed:
node -v - Install dependencies:
npm install - Run the tool:
npm start
Usage
- Run the Generator:
npx boring-business-card-generator - Answer Prompts:
- Provide your personal details and npm credentials as described above.
- Generated Package:
- A directory (e.g.,
attacktitan) is created withcard.js,package.json,README.md, andLICENSE.
- A directory (e.g.,
- Publish:
- The tool automatically installs dependencies and publishes to npm.
- If publishing fails, follow the manual steps:
cd <your-package-name> npm install npm login npm publish
- Test Your Card:
npx <your-package-name> - Optional: Update Repository:
- Update the
repository.urlin the generatedpackage.jsonto your GitHub repository. - Push to GitHub for version control:
git init git add . git commit -m "Initial commit" git remote add origin <your-repo-url> git push -u origin main
- Update the
Dependencies
[email protected]: Colors and styles terminal output.[email protected]: Clears the terminal for a clean display.[email protected]: Handles file operations for package generation.[email protected]: Provides interactive CLI prompts.
Development
To contribute or modify the tool:
- Fork and clone the repository:
git clone https://github.com/pinak95/boringBusinessCardGenerator.git - Install dependencies:
npm install - Edit
index.js(uses ESM with"type": "module"). - Test changes:
npm start - Submit a pull request to pinak95/boringBusinessCardGenerator.
Publishing
To publish the boring-business-card-generator tool to npm:
npm login
npm publishEnsure you have publishing rights for the boring-business-card-generator package.
Troubleshooting
- NPM Authentication Issues:
- Verify your npm account at npmjs.com.
- Ensure correct username, password, and email.
- For 2FA, provide a valid code or disable it temporarily.
- Publishing Errors:
- If the package name is taken, use a unique name (e.g.,
@username/card). - For 403 errors, increment the version in
package.json(e.g.,npm version patch).
- If the package name is taken, use a unique name (e.g.,
- Dependencies:
- If errors occur, delete
node_modulesandpackage-lock.json, then:npm install
- If errors occur, delete
- Node.js Version:
- Confirm Node.js v22.5.1:
node -v
- Confirm Node.js v22.5.1:
- Logs:
- Check
~/.npm/_logs(Linux/macOS) orC:\Users\<YourUser>\AppData\Local\npm-cache\_logs(Windows) for details.
- Check
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
Created by Pinak Thakar (@pinak95):
- Email: [email protected]
- LinkedIn: pinak95
- Portfolio: pinak95.onrender.com
- GitHub: pinak95
Run npx boring-business-card-generator to create your own professional CLI business card!
