A firewall-safe CLI tool for AI-powered code generation and assistance
npm install myai-clibash
npm install -g myai-cli
`
Quick Start
$3
`bash
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.py
`
$3
#### Generate C++ Code
`bash
myai "implement quicksort with comments" --out quicksort.cpp
`
#### Generate Python Script
`bash
myai "create a web scraper using requests" --out scraper.py
`
#### Create Markdown Notes
`bash
myai "explain TCP vs UDP" --out networking.md
`
#### Generate JSON Data
`bash
myai "create a sample user schema with 5 users" --out users.json
`
#### Generate Configuration
`bash
myai "create a docker-compose for nginx and postgres" --out docker-compose.yml
`
Supported 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
$3
Set a custom backend URL via environment variable:
`bash
export MYAI_BACKEND=https://your-backend.vercel.app/api/query
`
Or on Windows (PowerShell):
`powershell
$env:MYAI_BACKEND="https://your-backend.vercel.app/api/query"
`
Command-Line Options
`
Usage: myai "" [--out ]
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"
``