autoflared
v1.0.2
Published
Auto-install and manage Cloudflare Tunnel (cloudflared) binaries — cross-platform CLI
Downloads
367
Maintainers
Readme
autoflared
Auto-install and manage Cloudflare Tunnel (
cloudflared) binaries + lightweight process manager — cross-platform CLI for Linux, macOS, Windows, and Termux.
Features
- Auto-install — Downloads the latest
cloudflaredbinary from Cloudflare's GitHub releases - Named tunnel manager — Save and manage multiple tunnel configs by name
- Daemon mode — Run tunnels in the background with PID tracking and file logging
- Process manager — Start, stop, restart, and monitor any process (like PM2) — works on Termux too
- Cross-platform — Linux (amd64/arm64/arm), macOS (Intel/Apple Silicon), Windows (x64), Termux
Installation
npm install -g autoflaredQuick Start
# 1. Install cloudflared binary
autoflared install
# 2. Start a quick tunnel on port 3000
autoflared start --port 3000
# 3. Or run as background daemon
autoflared daemon --port 3000Commands
TUNNEL
Start a quick tunnel
# By port
autoflared start --port 3000
# By custom URL
autoflared start --url http://localhost:8080
# By saved name
autoflared start myappSave a named tunnel
autoflared add <name> <url> <port>
# Example
autoflared add myapp https://myapp.example.com 3000List saved tunnels
autoflared listRemove a saved tunnel
autoflared remove myappDAEMON
Run tunnel as a background daemon process.
# Start daemon
autoflared daemon --port 3000
autoflared daemon --url http://localhost:8080
# Stop daemon
autoflared daemon stop
# Check status
autoflared daemon status
# View logs
autoflared daemon logs
autoflared daemon logs --lines 100PROCESS MANAGER (-p)
Lightweight process manager — works on Termux, Linux, macOS, Windows. No root required.
# Start a process
autoflared -p start index.js --gn "myapp"
autoflared -p start "node bot.js" --gn "mybot"
autoflared -p start "python3 server.py" --gn "pyserver"
# List all processes
autoflared -p list
# Stop / restart
autoflared -p stop myapp
autoflared -p restart myapp
# View logs
autoflared -p logs myapp
autoflared -p logs myapp --lines 100
# Delete process + logs
autoflared -p delete myappBINARY
# Install latest cloudflared
autoflared install
# Force reinstall
autoflared install --force
# Remove binary
autoflared uninstall
# Show cloudflared version
autoflared versionFile Locations
All files are stored in ~/.autoflared/:
| File | Description |
|---|---|
| cloudflared / cloudflared.exe | The binary |
| config.json | Saved named tunnel configs |
| daemon.pid | PID of the running tunnel daemon |
| daemon.log | Tunnel daemon output log |
| pm/processes.json | Process manager state |
| pm/<name>.pid | PID file per process |
| pm/<name>.log | Log file per process |
Supported Platforms
| OS | Architecture | |---|---| | Linux | amd64, arm64, arm | | macOS | Intel (x64), Apple Silicon (arm64) | | Windows | x64 | | Termux (Android) | arm64, arm |
Termux note: Process manager (
-p) works fully on Termux. For cloudflared tunnel, runautoflared installfirst — it auto-detects ARM architecture.
Publishing to npm
For maintainers — steps to publish a new version.
1. Check if the name is available
npm info autoflared
# If it returns "404 Not Found" → name is available2. Login to npm
npm login
# Enter your npm username, password, and email
# Check your email for OTP if 2FA is enabled3. Publish
npm publish --access public4. Update version (for future updates)
# Patch: 1.0.0 → 1.0.1
npm version patch
# Minor: 1.0.0 → 1.1.0
npm version minor
# Major: 1.0.0 → 2.0.0
npm version major
# Then publish again
npm publish5. Verify
npm info autoflared
# Should show your package detailsRequirements
- Node.js >= 16.0.0
License
MIT © defandryan
