UNPKG

@koodosbots/kprcli

Version:

KprCli - Global CLI automation client for Telegram bot integration

138 lines (103 loc) • 3.62 kB
# KprCli - Telegram Bot Automation Client [![npm version](https://badge.fury.io/js/%40kprcli%2Fclient.svg)](https://www.npmjs.com/package/@kprcli/client) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/) Global CLI client for connecting your computer to a Telegram bot for automation tasks. ## šŸš€ Quick Install ```bash npm install -g @kprcli/client ``` That's it! Now you can use `kprcli` anywhere. ## šŸ“± Usage ### 1. Link Your Device ```bash kprcli login ``` - Go to your Telegram bot and run `/link` - Copy the 6-digit code - Enter it when prompted ### 2. Start Automation ```bash kprcli start ``` Your device is now ready to execute automation tasks from Telegram! ### 3. Check Status ```bash kprcli status # View device info kprcli help # Show all commands ``` ## šŸŽÆ How It Works 1. **Install globally** - Available as `kprcli` command everywhere 2. **Link to Telegram** - Authenticate with your bot using a secure code 3. **Auto-execute tasks** - Your CLI polls for jobs and executes them 4. **Real-time feedback** - Results sent back to Telegram instantly ## šŸ“‹ Commands | Command | Description | |---------|-------------| | `kprcli login` | Link device to Telegram bot | | `kprcli start` | Start automation agent | | `kprcli status` | Show device status | | `kprcli help` | Show help information | ## šŸ”§ Requirements - **Node.js 18+** (includes npm) - **Internet connection** - **Telegram bot** with KprCli integration ## 🌟 Features - āœ… **Zero dependencies** - Pure Node.js, no external packages - āœ… **Global installation** - Use `kprcli` from anywhere - āœ… **Secure authentication** - 6-digit codes with expiration - āœ… **Real-time polling** - Checks for jobs every 5 seconds - āœ… **Graceful shutdown** - Press Ctrl+C to stop - āœ… **Cross-platform** - Works on Windows, Mac, Linux - āœ… **Auto-save credentials** - Remembers your login ## šŸ”’ Security - Auth codes expire in 10 minutes - Credentials saved locally in `.kprcli-config` - No sensitive data transmitted - Device linking required per machine ## šŸ“ Example Session ```bash $ kprcli login šŸ¤– KprCli Login =============== 1. Go to your Telegram bot and run /link 2. Copy the 6-digit code from Telegram Enter authentication code: ABC123 šŸ” Authenticating with code: ABC123 āœ… Device authenticated successfully! šŸ“± Device ID: 12345678-abcd-efgh... šŸ’¾ Credentials saved to .kprcli-config $ kprcli start šŸš€ KprCli Agent Starting... šŸ“± Device: 12345678... šŸ”„ Polling for jobs every 5 seconds Press Ctrl+C to stop šŸ“¬ Found 1 job(s): • Job ID: task-456 • Task: form_fill • Status: pending ⚔ Executing job: task-456... āœ… Job task-456... completed successfully ``` ## šŸ› Troubleshooting ### "Command not found: kprcli" ```bash # Reinstall globally npm uninstall -g @kprcli/client npm install -g @kprcli/client ``` ### "Authentication failed" - Make sure you copied the exact 6-digit code from Telegram - Codes expire in 10 minutes - get a fresh one with `/link` - Check that your bot is running and accessible ### "Connection error" - Verify your bot server is running on the correct port - Check firewall settings - Ensure you have internet connectivity ## šŸ“„ License MIT License - see [LICENSE](LICENSE) file for details. ## šŸ¤ Support - šŸ› Report bugs: [GitHub Issues](https://github.com/yourusername/kprcli/issues) - šŸ’¬ Ask questions: [Telegram Support](https://t.me/kprcli_support) - šŸ“š Documentation: [Wiki](https://github.com/yourusername/kprcli/wiki) --- **Made with ā¤ļø by the KprCli Team**