myai-cli
v1.0.1
Published
A firewall-safe CLI tool for AI-powered code generation and assistance
Maintainers
Readme
myai - Firewall-Safe AI CLI Tool
A production-ready CLI tool that works on restricted college networks by using HTTPS-only communication (port 443) with a disguised backend API.
Features
✅ Firewall-Safe: Works on heavily restricted Wi-Fi (HTTPS port 443 only)
✅ No Local AI: All processing happens on your secure backend
✅ Smart File Extension Detection: Auto-formats output based on file type
✅ Production-Ready: Built with security and reliability in mind
✅ Easy to Use: Simple command-line interface
Installation
npm install -g myai-cliQuick Start
Basic Usage
# Print to terminal
myai "explain binary search"
# Save to file with automatic formatting
myai "write a DFS algorithm in C++" --out dfs.cpp
myai "explain paging in OS" --out paging.md
myai "create a Python REST API" --out api.pyExamples
Generate C++ Code
myai "implement quicksort with comments" --out quicksort.cppGenerate Python Script
myai "create a web scraper using requests" --out scraper.pyCreate Markdown Notes
myai "explain TCP vs UDP" --out networking.mdGenerate JSON Data
myai "create a sample user schema with 5 users" --out users.jsonGenerate Configuration
myai "create a docker-compose for nginx and postgres" --out docker-compose.ymlSupported File Types
The CLI automatically detects file extensions and formats output appropriately:
Code Files (clean code only, no markdown):
- C++:
.cpp,.c,.h - Python:
.py - JavaScript/TypeScript:
.js,.ts,.jsx,.tsx - Java:
.java - Go:
.go - Rust:
.rs - And many more...
Documentation:
- Markdown:
.md(formatted with headers, code blocks, etc.) - Text:
.txt(plain text)
Data Formats (valid syntax only):
- JSON:
.json - YAML:
.yaml,.yml - XML:
.xml
Configuration
Custom Backend URL
Set a custom backend URL via environment variable:
export MYAI_BACKEND=https://your-backend.vercel.app/api/queryOr on Windows (PowerShell):
$env:MYAI_BACKEND="https://your-backend.vercel.app/api/query"Command-Line Options
Usage: myai "<prompt>" [--out <file>]
Options:
--out, -o Output file path (with extension) [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Examples:
myai "write a DFS algorithm in C++" --out dfs.cpp
myai "explain virtual memory" --out notes.md
myai "create a REST API in Python"Why This Works on College Wi-Fi
- HTTPS Only (Port 443): Uses standard web traffic that firewalls allow
- No WebSockets: Only simple HTTP POST requests
- No Streaming: Single request-response pattern
- Disguised Backend: API looks like a generic query service
- No Local AI: Doesn't download models or run suspicious processes
Troubleshooting
"Cannot connect to backend"
- Check your internet connection
- Verify the backend URL is correct
- Try accessing the backend URL in a browser
- Check if your firewall blocks HTTPS requests
"Backend error (401)"
The backend API key is not configured. Contact the backend administrator.
"Rate limit exceeded"
Too many requests. Wait a minute and try again.
Security
- ✅ All communication over HTTPS (encrypted)
- ✅ No API keys stored in CLI
- ✅ No telemetry or tracking
- ✅ Open source and auditable
License
MIT
Support
For issues or questions, open an issue on GitHub.
