dong4j v4.5.11
npx-card
👋 Hey there! This is my NPX card, a command-line business card that you can run using npx dong4j
.
And get to know me in unique style.
I spent a non-trivial amount of effort building and designing this iteration of npx card, and I am proud of it! All I ask of you all is to put a star ⭐ on this project and not claim this effort as your own ♥.
SCREENSHOT
The final output might look something like this:
STEPS TO CREATE YOUR OWN
The article written by our friend @jackboberg. I used the same for the reference to deploy the package. Write a Simple npx Business Card.
Features
- 📧 Direct email contact
- 📄 Resume download
- 🦖 Interactive Dino Runner game
- 🤖 AI Chat Assistant
- 🎨 Beautiful CLI interface
Usage
Just run:
npx dong4j
You'll see an interactive menu with several options:
- Send an email
- Download resume
- Play Dino Runner game
- Chat with AI Assistant
- Exit
AI Chat Configuration
The AI Chat feature uses OpenAI's API and can be configured in multiple ways:
1. Environment Variables
Create a .env
file in the root directory with the following variables:
OPENAI_API_KEY=your_api_key_here
OPENAI_API_BASE=https://api.openai.com/v1 # Optional: for custom API endpoint
OPENAI_MODEL=gpt-3.5-turbo # Optional: default is gpt-3.5-turbo
CONFIG_SERVER_PORT=3000 # Optional: for configuration server
2. Configuration Server
You can run a local configuration server to manage AI settings:
- Copy
tools/configServer.example.js
totools/configServer.js
- Set up your environment variables
- Run the server:
node tools/configServer.js
3. Generate Encrypted Configuration
To create an encrypted configuration file:
- Copy
tools/generateConfig.example.js
totools/generateConfig.js
- Update the configuration values
- Generate the config:
node tools/generateConfig.js
This will create an encrypted configuration file at lib/ai/defaultConfig.js
.
Configuration Priority
The AI Chat system will try to load configuration in the following order:
- Remote configuration server (if available)
- Local encrypted configuration
- Custom configuration (user input)
Project Structure
.
├── lib/
│ ├── ai/ # AI-related functionality
│ │ ├── chat.js # AI chat implementation
│ │ ├── config.js # AI configuration management
│ │ └── defaultConfig.js # Encrypted default configuration
│ ├── cli/ # CLI-related code
│ │ └── banner.js # CLI banner display
│ ├── core/ # Core functionality
│ │ └── data.js # Basic information
│ ├── game/ # Game-related code
│ │ └── dino.js # Dino runner game
│ └── utils/ # Utility functions
│ └── logger.js # Logging utility
├── tools/ # Development tools
│ ├── configServer.js # Configuration server
│ └── generateConfig.js # Config generation tool
├── .env # Environment variables
├── .env.example # Example environment variables
└── card.js # Main entry point
Development
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
Edit
.env
with your configurationFor local testing:
node card.js
- Auth testing:
node test/auth.test.js --config .env
Security
- API keys and sensitive configurations are never committed to the repository
- Configuration can be encrypted for distribution
- Environment variables are used for local development
- Remote configuration server supports secure transmission
Contributing
Feel free to open issues or submit pull requests!
License
MIT
Todo List
- 社交媒体集成
- 添加更多社交媒体链接选项(如 Twitter、LinkedIn、GitHub、微信等)
- 可以直接在终端预览最近的社交媒体动态
- 个性化主题
- 添加多种颜色主题供选择
- 支持自定义终端显示样式
- 添加更多动画效果
- 互动功能
- 添加一个简单的小游戏或者彩蛋
- 添加一个简单的问答环节,让访问者可以更好地了解你
- 添加一个留言板功能,访问者可以直接在终端给你留言
- 技术展示
- 添加一个选项来展示你的技术栈
- 展示你的主要项目列表
- 显示你的 GitHub 统计数据
- 实用工具
- 添加一个日程安排功能,让别人可以直接通过终端预约会面时间
- 提供一个订阅功能,让感兴趣的人可以订阅你的更新
- 添加一个分享功能,让访问者可以方便地将你的名片分享给他人
- 本地化支持
- 添加多语言支持(中文、英文等)
- 根据访问者的时区显示相应的时间
- 性能优化
- 添加缓存机制,提高加载速度
- 添加离线支持,即使在没有网络的情况下也能显示基本信息
- 数据统计
- 添加访问统计功能
- 记录哪些功能最受欢迎
- 生成使用报告
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago