2.3 KiB
netlify (Netlify CLI)
What it is
Netlify's CLI: deploy static sites and serverless functions, run the local dev
server (netlify dev) that emulates Netlify's edge/functions environment, and
manage sites/env from the terminal.
Install
Via npm (current stable; Node LTS required):
npm install -g netlify-cli
Authenticate
netlify login # browser OAuth
netlify status # shows account + site link
Token stored under ~/.config/netlify/. For CI use a personal access token
from the dashboard, kept in Vaultwarden (https://vault.portugalfuturista.org),
exported as NETLIFY_AUTH_TOKEN (plus NETLIFY_SITE_ID).
Configure for this environment
cd <site>
netlify init # or: netlify link
netlify dev # local server w/ functions emulation
netlify deploy # draft deploy, prints a preview URL
netlify deploy --prod # production
netlify env:list
Self-hosted equivalent
None deployed. Closest self-hosted path for static + functions today:
Caddy serving a build output directory on a Proxmox CT, exposed through
the pf-tunnel-v2 Cloudflare tunnel (route added via cloudflared — see
cloudflared-wrangler.md). Netlify-style edge
functions have no drop-in self-hosted runtime; Cloudflare Workers + wrangler dev is the nearest alternative.
Aurélio integration
The cli-edge skill can drive netlify for legacy site deploys. No
dedicated connector-registry entry — treated as an external SaaS; closest
listed edge connector is vercel.
Verify
netlify --version
# netlify-cli/1x.y.z linux-x64 node-v2x.y.z
netlify status
# ──────────────────────┐
# Current Netlify User │
# ... │
netlify sites:list | head
Troubleshooting
netlify loginhangs — no browser on a headless shell; useNETLIFY_AUTH_TOKENfrom Vaultwarden instead.- Functions work locally, 404 in prod — check
netlify.toml[functions] directoryand that the deploy actually bundled them (netlify deploy --prod --buildlogs show "Functions bundling"). - Redirects not applied —
_redirectsmust end up in the publish dir; verify withnetlify deploy --prodoutput listing published files. - Wrong site linked —
netlify unlinkthennetlify linkagain.