Netlify CLI
$ netlify Official Med RiskOfficial CLI for developing, linking, and deploying sites, Edge Functions, and environment variables on Netlify. Supports --json on key inspection commands and defaults deploys to preview URLs unless --prod is passed.
npm install -g netlify-cli Use netlify CLI for local dev (netlify dev), build verification, and deploys; pair with Netlify MCP if querying platform docs or account-wide context.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json on inspection commands (sites:list, env:list, deploy --json) and headless NETLIFY_AUTH_TOKEN, though unlinked repos prompt interactively.
- Supports
--jsonacrosssites:list,env:list, anddeploy - Supports
NETLIFY_AUTH_TOKENandNETLIFY_SITE_IDenv vars
Draft preview deploys are safe by default (requiring explicit --prod for live traffic), though env:set and sites:delete mutate live state.
netlify deploydefaults to draft URLs without--prodenv:listexposes values unless scoped carefully
Distributed via npm/npx across macOS, Linux, and Windows; requires Node.js.
- Cross-platform Node.js CLI with
npx netlify-clisupport
Covers local dev emulation, functions, env vars, and preview/prod deployments in one tool.
- Combines local
netlify devand remote deploy workflows
Official Netlify CLI maintained under MIT license.
- First-party
netlify/clirepository
Clear CLI reference docs and built-in --help across subcommands.
- Official docs at docs.netlify.com/cli
Security, Auth & Guardrails
Stores OAuth tokens in ~/.config/netlify/config.json and supports NETLIFY_AUTH_TOKEN plus NETLIFY_SITE_ID for CI/headless shells.
MIT open-source CLI; Netlify hosting bandwidth and build minutes depend on your account plan.
# Netlify CLI (netlify) Agent Rules - Set `NETLIFY_AUTH_TOKEN` and `NETLIFY_SITE_ID` to avoid interactive site-linking prompts. - Default to `netlify deploy` (draft preview); never pass `--prod` without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
netlify sites:list --json
Returns accessible Netlify sites and their IDs/URLs in structured JSON.
netlify env:list --json
Outputs configured environment variable keys and contexts in JSON.
Controlled Writes & Previews
netlify deploy --dir=dist --message="agent preview"
Deploys dist/ to a non-production draft preview URL without altering live production traffic.
Strengths for Agents
- + Draft preview deploys by default prevent accidental production overwrites.
- +
--jsonsupport onsites:list,env:list, anddeploygives structured URLs and IDs. - +
NETLIFY_AUTH_TOKEN+NETLIFY_SITE_IDenable clean headless CI execution.
Caveats & Pitfalls
- ! Running commands without
.netlify/state.jsonorNETLIFY_SITE_IDcan trigger interactive prompts. - ! Large npm dependency tree causes noticeable startup latency compared to Go/Rust CLIs.