taptap-cli
Version:
A simple and powerful CLI tool to deploy static HTML/CSS/JS projects directly from your terminal.
544 lines (424 loc) โข 23.4 kB
Markdown
# Taptap CLI
> A lightning-fast, secure command-line tool for deploying static web projects with built-in authentication, zero configuration hassle, and now featuring an intelligent AI Agent for automatic project generation.
## ๐ Overview
Taptap CLI revolutionizes the deployment experience for front-end developers, students, and teams working on static web projects. Deploy your HTML, CSS, and JavaScript applications to production-ready URLs in seconds, not minutes. Now with the power of AI, you can generate complete web projects from a single text prompt.
With intelligent project detection, secure user authentication, automated deployment pipelines, custom domain naming, and our revolutionary AI Agent, Taptap CLI transforms complex development and deployment workflows into a single command experience.
## โจ Key Features
- **๐ค AI-Powered Project Generation** - Create complete web projects from simple text prompts
- **๐ Enhanced Security** - Streamlined authentication with internal user ID management
- **๐ฏ Custom Project Names** - Control your deployment URLs with the `--domain` flag
- **โก Lightning Fast** - Deploy in seconds with optimized compression and transfer
- **๐ก๏ธ Conflict Prevention** - Smart handling of duplicate project names with clear error messages
- **๐ Improved Deployment Management** - Per-deployment isolation with selective deletion
- **๐ Local Preview** - Test your site locally before going live
- **๐ Instant URLs** - Get production-ready URLs immediately after deployment
- **๐ Smart File Filtering** - Automatically includes only necessary web assets
- **๐๏ธ Deployment History** - Complete audit trail with enhanced user quota management
## ๐ฆ Installation
Install Taptap CLI globally via npm:
```bash
npm install -g taptap-cli
```
## ๐ ๏ธ One-Step Installer (No Node.js Needed)
Choose your platform and run the installer file:
| OS | Installer Script |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ๐ช Windows | [๐ฅ install-windows.ps1 (auto-setup + PATH)](https://github.com/anuragco/Taptap-lightning-fast-command-line-tool-for-Deployment/releases/download/v2.6.0/install-windows.ps1) |
| ๐ง Linux | [๐ฅ install-linux.sh (auto-setup)](https://github.com/anuragco/Taptap-lightning-fast-command-line-tool-for-Deployment/releases/download/v2.6.0/install-linux.sh) |
| ๐ macOS | [๐ฅ install-macos.sh (auto-setup)](https://github.com/anuragco/Taptap-lightning-fast-command-line-tool-for-Deployment/releases/download/v2.6.0/install-macos.sh) |
**System Requirements:**
- Node.js 14+
- npm 6+
- Internet connection for deployment
## ๐ค AI Agent: Revolutionary Project Generation
We've introduced a powerful AI Agent feature that transforms the development process by enabling you to build complete web projects from a single text prompt. Simply describe what you want to create, and our intelligent AI will generate a fully functional website with all necessary files, styling, and interactive elements. The AI Agent provides real-time feedback during the generation process and can ask for clarification if your request needs more details. Once complete, you'll have a ready-to-deploy project in your current directory without any manual setup or configuration.
### ๐ง AI Agent Capabilities
- **๐จ Complete Web Projects** - Generate HTML, CSS, JavaScript, and assets from text descriptions
- **๐ฑ Responsive Design** - Creates mobile-first, responsive layouts automatically
- **๐ฏ Interactive Elements** - Builds functional components, forms, and user interactions
- **๐ผ๏ธ Asset Generation** - Creates placeholder images, icons, and media content
- **โก Framework Support** - Generates vanilla JavaScript, React, Vue, or framework-specific projects
- **๐ Modern Styling** - Implements contemporary design trends and best practices
- **๐ Dynamic Content** - Creates interactive charts, animations, and data visualizations
### ๐ AI Agent Quick Start
```bash
# Generate a complete portfolio website
taptap --agent --prompt "Create a modern portfolio website for a web developer with dark theme"
# Build an interactive landing page
taptap --agent --prompt "Make a landing page for a SaaS product with hero section, features, and contact form"
# Create a business website
taptap --agent --prompt "Build a restaurant website with menu, gallery, and online reservation system"
# Generate an educational project
taptap --agent --prompt "Create an interactive learning dashboard for students with progress tracking"
```
### ๐ AI Agent Workflow
```mermaid
graph LR
A[User Prompt] --> B[Secure Upload]
B --> C[AI Analysis]
C --> D[Project Planning]
D --> E[Code Generation]
E --> F{Clarification Needed?}
F -->|Yes| G[Request Details]
G --> H[User Input]
H --> E
F -->|No| I[File Creation]
I --> J[Asset Generation]
J --> K[Project Packaging]
K --> L[Download & Extract]
L --> M[Ready to Deploy]
```
### ๐ก AI Agent Examples
#### Simple Project Generation
```bash
taptap --agent --prompt "Personal blog with clean design"
```
#### Complex Interactive Projects
```bash
taptap --agent --prompt "E-commerce product showcase with cart functionality and payment form"
```
#### Educational Content
```bash
taptap --agent --prompt "Interactive quiz app for learning JavaScript with score tracking"
```
#### Business Solutions
```bash
taptap --agent --prompt "Corporate website with team profiles, services section, and contact form"
```
## ๐ Authentication System
Taptap CLI features a streamlined authentication system that uses your unique user ID internally for all deployment operations, eliminating the need for registration numbers and improving security.
### First Time Setup
1. **Register a new account:**
```bash
taptap --register
```
2. **Login to your account:**
```bash
taptap --login
```
3. **Verify your session:**
```bash
taptap --whoami
```
### Authentication Methods
| Method | Command | Description |
|--------|---------|-------------|
| Browser Auth | `taptap --login` | Secure browser-based authentication (recommended) |
| Auto-Open Browser | `taptap --login --open` | Opens auth page automatically |
| Direct CLI | `taptap --login --direct` | Email/password prompt in terminal |
## ๐ Quick Start Guide
### 1. Initialize Your Project
```bash
# Create a new project with template files
taptap --init
# Or generate a project with AI
taptap --agent --prompt "Your project description here"
```
### 2. Authenticate
```bash
# Register new account
taptap --register
# Login to existing account
taptap --login
```
### 3. Deploy Your Site
```bash
# Navigate to your project directory (if not using AI agent)
cd my-awesome-project
# Deploy with automatic project naming
taptap --deploy
# Deploy with custom project name
taptap --deploy --domain my-portfolio
```
### 4. Manage Your Deployments
```bash
# View all your deployed sites
taptap --deploy-list
# Open your latest site
taptap --open
# Delete a specific deployment (with interactive selection)
taptap --delete
```
## ๐ Complete Command Reference
### ๐ค AI Agent Commands
| Flag | Alias | Description | Auth Required |
|------|-------|-------------|---------------|
| `--agent --prompt "<text>"` | `agent --prompt "<text>"` | Generate complete project from text description | โ
|
### Core Commands
| Flag | Alias | Description | Auth Required |
|------|-------|-------------|---------------|
| `--init` | `init`, `-i` | Initialize new project with template files | โ |
| `--deploy` | `deploy`, `-d` | Deploy current folder to live URL | โ
|
| `--deploy --domain <name>` | `-d --domain <name>` | Deploy with custom project name | โ
|
| `--preview` | `preview`, `-p` | Preview site locally before deploying | โ |
| `--open` | `open`, `-o` | Open most recent deployment in browser | โ |
### Deployment Management
| Flag | Alias | Description | Auth Required |
|------|-------|-------------|---------------|
| `--deploy-list` | `deploy-list`, `-dl` | Show all past deployments from server | โ
|
| `--delete` | `delete`, `-del` | Interactive deletion of selected deployment | โ
|
| `--logs` | `logs`, `-l` | Show local deployment logs | โ |
### Authentication
| Flag | Alias | Description |
|------|-------|-------------|
| `--register` | `register`, `-r` | Register new CLI user account |
| `--login` | `login` | Log in using browser-based auth |
| `--login --open` | - | Login and auto-open auth page |
| `--login --direct` | - | Direct CLI login (email/password) |
| `--logout` | `logout` | Logout current user session |
| `--logout --silent` | `logout -s` | Logout quietly without output |
| `--whoami` | `whoami`, `-w` | Display current logged-in user info |
### Utility Commands
| Flag | Alias | Description |
|------|-------|-------------|
| `--update` | `update`, `-u` | Check for CLI updates |
| `--version` | `version`, `-v` | Show current CLI version |
| `--about` | `about`, `-a` | Show CLI and author information |
| `--help` | `help` | Display help and usage instructions |
## ๐ฏ Enhanced Deployment Features
### Custom Domain Naming
The new `--domain` flag gives you full control over your deployment URLs:
```bash
# Deploy with custom project name
taptap --deploy --domain my-awesome-portfolio
# Resulting URL: https://taptap.dev/my-awesome-portfolio
```
### Conflict Handling
When a project name already exists, Taptap CLI provides clear guidance:
```bash
taptap --deploy --domain existing-project
# Output:
# โ Error 409: Conflict
# A project named 'existing-project' already exists.
#
# Options:
# 1. Choose a different project name: taptap --deploy --domain new-name
# 2. Delete the existing project: taptap --delete
```
### Streamlined Authentication Flow
- **No Registration Numbers**: The CLI now uses your authenticated user ID internally
- **Structured Headers**: All requests include `x-user-uuid`, `x-user-email`, and `x-endpoint` headers
- **Enhanced Validation**: Robust server-side middleware enforces authentication checks
- **Quota Management**: Automatic enforcement of deployment limits per user
## ๐ File Processing Rules
### โ
Included Files
```
๐ HTML Files โ .html, .htm
๐จ Stylesheets โ .css, .scss, .sass
โก JavaScript โ .js, .mjs, .ts
๐ผ๏ธ Images โ .png, .jpg, .jpeg, .gif, .svg, .webp, .ico
๐ฅ Videos โ .mp4, .webm, .ogg, .avi
๐ค Fonts โ .woff, .woff2, .ttf, .otf, .eot
๐ Data Files โ .json, .xml
๐ Documents โ .pdf, .txt
```
### โ Excluded Files
```
๐ Hidden Files โ .*, .env, .gitignore
๐ฆ Dependencies โ node_modules/, vendor/
๐๏ธ Version Control โ .git/, .svn/
๐ Documentation โ .md, .markdown, README.*
๐๏ธ Archives โ .zip, .rar, .tar, .gz
๐ Logs โ .log, .logs
โ๏ธ Config Files โ package.json, webpack.config.js
```
## ๐ Enhanced Deployment Workflow
### Automated Deployment Process
```mermaid
graph LR
A[Project Scan] --> B[Authentication Check]
B --> C[Domain Validation]
C --> D[Conflict Detection]
D --> E[File Filtering]
E --> F[Temporary Packaging]
F --> G[Compression]
G --> H[Secure Upload]
H --> I[URL Generation]
I --> J[Cleanup]
J --> K[Success Notification]
```
1. **๐ Project Detection** - Enhanced validation of `index.html` presence and project structure
2. **๐ Authentication Verification** - Streamlined user session validation with internal ID management
3. **๐ฏ Domain Validation** - Checks custom project names and handles conflicts
4. **โ ๏ธ Conflict Detection** - Prevents overwrites with clear 409 Conflict responses
5. **๐ File Collection** - Gathers deployable assets using inclusion rules
6. **๐ฆ Temporary Packaging** - Creates optimized deployment bundle with improved zipping
7. **๐๏ธ Compression** - Efficient zip compression for faster transfer
8. **๐ Secure Upload** - Encrypted transfer with detailed error handling
9. **๐ URL Assignment** - Generates unique, production-ready URL with custom naming
10. **๐งน Cleanup** - Enhanced cleanup logic removes temporary files and artifacts
## ๐๏ธ Improved Deletion System
### Per-Deployment Isolation
The enhanced `--delete` command now provides:
- **Interactive Selection**: Choose from a list of your deployments
- **Per-Project Deletion**: Only the selected project folder gets deleted
- **No Cross-Contamination**: Other deployments remain completely unaffected
- **User-Specific Filtering**: Only shows deployments belonging to your authenticated user
```bash
taptap --delete
# Interactive output:
# ๐ Your Deployments:
# 1. my-portfolio (deployed 2 days ago)
# 2. landing-page (deployed 1 week ago)
# 3. blog-site (deployed 3 weeks ago)
#
# Select deployment to delete (1-3): 2
#
# โ
Successfully deleted 'landing-page'
```
## ๐๏ธ Project Structure Examples
### โ
Valid Project Structure
```
my-portfolio/
โโโ index.html โ
Entry point (enhanced validation)
โโโ styles/
โ โโโ main.css โ
Stylesheets
โ โโโ responsive.css โ
Additional CSS
โโโ scripts/
โ โโโ app.js โ
JavaScript
โ โโโ utils.js โ
Utilities
โโโ assets/
โ โโโ logo.png โ
Images
โ โโโ hero-video.mp4 โ
Media
โ โโโ fonts/
โ โโโ custom.woff2 โ
Fonts
โโโ data/
โ โโโ config.json โ
Data files
โโโ README.md โ Excluded
โโโ package.json โ Excluded
โโโ node_modules/ โ Excluded
```
### โ ๏ธ Missing Requirements
```
broken-project/
โโโ main.html โ No index.html (enhanced error message)
โโโ style.css โ
CSS present
โโโ script.js โ
JS present
```
## ๐ก๏ธ Enhanced Security & Privacy
### Advanced Data Protection
- **๐ Internal ID Management** - No more external registration numbers
- **๐ HTTPS Only** - All communications encrypted in transit
- **๐ซ No Source Code Storage** - Temporary processing only with improved cleanup
- **๐ User Isolation** - Complete separation between user accounts with enhanced validation
- **โฐ Session Management** - Automatic token expiration and renewal
- **๐ Quota Enforcement** - Server-side limits prevent abuse
- **๐ค AI Privacy** - Prompts processed securely with no permanent storage
### Enhanced Privacy Commitment
- Structured header authentication for better security
- Enhanced server-side middleware validation
- Improved error handling prevents information leakage
- Complete user data control and deletion rights
- Transparent data handling practices
- AI-generated content privacy protection
## โ ๏ธ Important Notices
### Hosting Duration
- **๐ Free Tier**: Sites automatically removed after **120 days**
- **๐ผ Extended Hosting**: Contact support for longer hosting periods
- **โก Renewal**: Simply redeploy to reset the 120-day timer
### Enhanced Best Practices
- Always test with `--preview` before deploying
- Use meaningful project names with the `--domain` flag for easy identification
- Handle 409 Conflicts promptly by choosing unique names or deleting old projects
- Regularly backup your deployment URLs
- Keep your CLI updated for latest features and security enhancements
- Be specific with AI prompts for better project generation results
- Review AI-generated code before deployment for quality assurance
## ๐ง Enhanced Troubleshooting
### Common Issues & Solutions
| Issue | Cause | Solution |
|-------|-------|----------|
| "No index.html found" | Missing entry point | Ensure `index.html` exists in project root (enhanced validation) |
| "409 Conflict: Project exists" | Duplicate project name | Use different `--domain` name or delete existing project |
| "Authentication required" | Not logged in | Run `taptap --login` (streamlined flow) |
| "Deployment failed" | Network/server error | Check connection, retry deployment (improved error messages) |
| "Session expired" | Token timeout | Re-authenticate with `taptap --login` |
| "Quota exceeded" | Too many deployments | Delete unused projects with `taptap --delete` |
| "Upload failed" | File/network issue | Enhanced error details provided for debugging |
| "AI Agent timeout" | Complex prompt processing | Simplify prompt or check network connection |
| "Prompt requires --prompt flag" | Missing required parameter | Use: `taptap --agent --prompt "Your description"` |
### Enhanced Debug Commands
```bash
# Check authentication status (shows internal user ID status)
taptap --whoami
# View detailed logs (improved error reporting)
taptap --logs
# Test project locally (enhanced validation)
taptap --preview
# Verify CLI version (check for latest enhancements)
taptap --version
```
## ๐ง Roadmap & Future Features
### Recently Added โ
- **๐ค AI Agent Integration** - Generate complete projects from text prompts with real-time feedback
- **๐ฏ Custom Domain Naming** - `--domain` flag for custom project names
- **โ ๏ธ Smart Conflict Handling** - Clear 409 error messages with guidance
- **๐ Streamlined Authentication** - Internal user ID management
- **๐๏ธ Enhanced Deletion System** - Per-deployment isolation and interactive selection
- **๐ Quota Management** - Server-side enforcement of deployment limits
- **๐ก๏ธ Structured Headers** - Enhanced security with `x-user-uuid`, `x-user-email`, `x-endpoint`
### Coming Soon
- **๐ง Advanced AI Models** - Support for specialized AI models for different project types
- **๐จ True Custom Domains** - Connect your own domain names (beyond project naming)
- **๐ CI/CD Integration** - GitHub Actions and GitLab CI support
- **๐ Analytics Dashboard** - Basic site performance metrics
- **๐ฅ Team Collaboration** - Share projects with team members
- **๐ฏ A/B Testing** - Deploy multiple versions for testing
- **๐ CDN Integration** - Global content distribution
- **๐ง Build Pipeline** - Support for modern frameworks (React, Vue, Angular)
- **๐ค AI Templates** - Pre-built AI prompts for common project types
- **๐ฑ Mobile App Companion** - Manage deployments from your phone
## ๐ Latest Enhancements Summary
We have significantly enhanced the Taptap CLI with the following revolutionary improvements:
### ๐ค AI-Powered Development
- **Intelligent Project Generation**: Create complete web applications from simple text descriptions
- **Real-Time Feedback**: Interactive terminal updates show AI progress with 3-second polling
- **Interactive Clarification**: AI can pause to ask for additional details when prompts are ambiguous
- **Automatic File Handling**: Server-side zip creation with local extraction and cleanup
- **Comprehensive Output**: Generate HTML, CSS, JavaScript, and assets in one command
### ๐ Streamlined Security
- **Internal User ID Management**: The `--deploy` command no longer requires registration numbers, using authenticated user IDs internally for improved security and usability
- **Structured Authentication Headers**: All requests now include `x-user-uuid`, `x-user-email`, and `x-endpoint` headers for robust validation
- **Enhanced Middleware**: Server-side authentication checks have been upgraded with better error handling
### ๐ฏ Custom Project Control
- **Domain Flag**: New `--domain <name>` flag allows custom project naming for better URL control
- **Smart Conflict Handling**: Clear `409 Conflict` responses when project names exist, with helpful guidance on resolution
- **Enhanced Validation**: Improved `index.html` validation and project structure checking
### ๐๏ธ Improved Deployment Management
- **Per-Deployment Isolation**: Enhanced deletion logic ensures only selected projects are removed
- **Interactive Selection**: Users can choose from their deployment list for precise deletion
- **Quota Management**: Server-side limits prevent abuse while maintaining user flexibility
- **Better Error Handling**: Detailed error messages for upload failures and file issues
### ๐ง Technical Improvements
- **Enhanced Zipping Process**: Improved project packaging and compression
- **Robust Cleanup Logic**: Better temporary file management and cleanup procedures
- **Detailed Error Reporting**: More informative error messages throughout the deployment process
- **Production-Safe Operations**: Enhanced reliability and user-friendly experience
## ๐จโ๐ป About the Author
**Anurag Anand**
Computer Science Student at LPU Punjab
Passionate about simplifying deployment workflows and democratizing web development with AI.
*"Making deployment and development accessible to everyone, from students to professionals, with enhanced security, intelligent automation, and user control."*
## ๐ License Notice
As of version 2.4.0, Taptap CLI is now licensed under the [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).
All users must accept the CC-BY-NC-ND-4.0 license terms before using the CLI. A prompt will appear on first use to record consent.
By using this software, you agree to:
- Provide appropriate attribution to the original author
- Not use the software for commercial purposes
- Not create derivative works or modifications
- Comply with all terms of the Creative Commons license
For the full license text, see the [LICENSE](./LICENSE) file.
## ๐ค Support & Community
### Get Help
- **๐ง Support Email**: Contact our support team for extended hosting tokens and AI feature questions
- **๐ Bug Reports**: Submit issues via our support channels
- **๐ก Feature Requests**: We love hearing your ideas for new AI capabilities!
- **๐ Documentation**: Comprehensive guides, tutorials, and AI prompt examples
### Stay Updated
- **๐ CLI Updates**: Use `taptap --update` to check for new versions
- **๐ฐ Release Notes**: Stay informed about new features and AI improvements
- **๐ Beta Testing**: Join our beta program for early access to advanced AI features
---
**๐ Happy Developing and Deploying with AI-Enhanced Control!**
*Transform your ideas into live web experiences with a single command, powered by intelligent AI generation, custom naming, enhanced security, and improved user experience.*
Made with โค๏ธ by Anurag Anand