Installation
One-line install (recommended):
curl -fsSL https://hostwares.com/install.sh | bash
Or via npm (requires Node.js 18+):
npm install -g hostwares-cli
Or from source:
git clone https://github.com/iammaksudul/hostwares-cli cd hostwares-cli && npm install && npm run build npm install -g .
After install, the hw command is available globally.
Uninstall
curl -fsSL https://hostwares.com/uninstall.sh | bash
Or manually:
npm uninstall -g hostwares-cli rm -rf ~/.hostwares # removes config + token
Authentication
Browser-based (recommended): Opens your browser for secure login. No tokens to copy.
$ hw login Authenticating with Hostwares... Open this URL in your browser: https://hostwares.com/cli/authorize?code=A3F2B1 Confirmation code: A3F2B1 Waiting for authorization... ✓ Logged in successfully!
Token-based (for CI/CD or headless):
hw login --token YOUR_API_KEY
Get API keys at: Dashboard → API Keys
Check status: Run hw with no args — shows ✓ Authenticated or → Run hw login.
All Commands
Authentication
hw login Open browser to authenticate
hw login --token KEY Authenticate with API key
Deploy
hw deploy Deploy current directory
hw deploy --repo URL Deploy from GitHub
hw deploy --name NAME Custom site name
Sites
hw list List all sites
hw status NAME Check site status
hw logs NAME View deployment logs
hw restart NAME Restart a site
hw stop NAME Stop a site
hw start NAME Start a stopped site
Configuration
hw env NAME List env variables
hw env NAME set KEY=VAL Set env variable
hw domain NAME DOMAIN Set custom domain
Databases
hw db list List all databases
hw db create NAME Create PostgreSQL database
hw db create NAME -t TYPE Create specific type
AI Assistant
hw ask "..." Ask AI a question
hw chat Interactive AI chat session
Billing
hw credits Check credit balance
Zero-Config Deploy
Navigate to your project and run hw deploy. Auto-detects framework and configures everything.
$ cd my-nextjs-app $ hw deploy ✓ Detected Next.js ✓ Deployed to my-nextjs-app.hostwares.app ✓ SSL provisioned 🟢 https://my-nextjs-app.hostwares.app
Supported frameworks:
Next.js, Nuxt, Vite, Astro, SvelteKit, Angular, Remix, Express, Fastify, NestJS, FastAPI, Django, Flask, Go, Rust, Laravel, Rails, Docker, static HTML.
AI Chat
The same AI DevOps assistant from the dashboard, in your terminal.
$ hw ask "why did my deploy fail?"
Looking at logs... Cannot find module 'prisma'.
Fix: npm install prisma --save, then hw restart my-app.
$ hw chat
Hostwares AI (type 'exit' to quit)
you> set DATABASE_URL=postgres://... on my-app
hw> ✓ Environment variable set. Restarting to apply...
✓ my-app restarted. Change is live.
you> exitAI credits are deducted per message. Check balance: hw credits
CI/CD Integration
Use in GitHub Actions for auto-deploy on push:
name: Deploy to Hostwares
on: { push: { branches: [main] } }
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://hostwares.com/install.sh | bash
- run: hw login --token ${{ secrets.HW_TOKEN }}
- run: hw deploy --name my-appAdd HW_TOKEN to GitHub repo → Settings → Secrets → Actions.
Configuration
Config is stored at ~/.hostwares/config.json:
{
"apiKey": "your-token-here",
"baseUrl": "https://hostwares.com"
}Created automatically on hw login. Delete to logout: rm ~/.hostwares/config.json
Troubleshooting
hw: command not found
Ensure /usr/local/bin is in your PATH. Or run: export PATH=$PATH:/usr/local/bin
Permission denied
Run: chmod +x $(which hw)
Not logged in error
Run: hw login
Deploy fails
Check: hw ask "why did my deploy fail?" — AI will diagnose.
Reset everything
curl -fsSL https://hostwares.com/uninstall.sh | bash then reinstall.
Agent Mode (Local DevOps AI)
When you type hw and start chatting, the AI has full access to your local machine — with your permission.
Capabilities
📁 Filesystem
Read, write, edit, search, delete files. Smart str_replace editing (like Kiro).
⚡ Shell
Run any command, install packages (brew/apt), check processes.
🔀 Git
Status, add, commit, push, pull, branch, log, diff. Check GitHub auth.
🔐 SSH
Connect to remote servers, run commands, upload/download files.
🐳 Docker
List containers, view logs, exec into containers.
🌐 Network
Check ports, make HTTP requests, test connectivity.
Permission Model
$ hw
you> push this project to github and deploy it
hw> I need to: Run: git add -A
[t] Trust all [y] Yes [n] No: t
✓ Trusted for this session
⟳ Running... ✓ Done
hw> I need to: Commit: "deploy to hostwares"
⟳ Running... ✓ Done
hw> I need to: Push to origin/main
⟳ Running... ✓ Done
hw> ✓ Pushed. Now deploying on Hostwares...
🟢 Live at https://my-app.hostwares.appt = trust all actions this session • y = yes to this one • n = skip
Destructive actions (delete, force push, SSH commands) always show a warning first.