id = "netlify" name = "Netlify CLI" homepage = "https://cli.netlify.com" description = "Interact with Netlify from the comfort of your CLI." icon = "SimpleIcons:netlify" executables = ["netlify", "ntl"] [dotfiles] # https://docs.netlify.com/api-and-cli-guides/cli-guides/get-started-with-cli/ # — "Netlify CLI stores your access token in a config.json global # configuration file", located at Library/Preferences/netlify/config.json on # macOS, .config/netlify/config.json on Linux and # AppData\Roaming\netlify\Config\config.json on Windows. That is env-paths's # layout: src/lib/settings.ts does `envPaths('netlify', { suffix: '' })` and # reads config.json from its .config directory. paths = [ "~/Library/Preferences/netlify/config.json", "~/.config/netlify/config.json", "%APPDATA%/netlify/Config/config.json", ] exclude = [] # config.json is not a whole-file secret: the account list, the telemetry # choice and the user's name and email are ordinary settings. Only the tokens # are lifted out. secret = [] # Every spelling, or the token is lifted out on one platform and syncs in the # clear from the others. The shape is the one storeToken() writes in # src/commands/base-command.ts: # globalConfig.set(`users.${userId}`, { id, name, email, # auth: { token, github: { user, token } } }) # — the Netlify access token and, once a site is linked through `netlify init`, # the GitHub token beside it. [[dotfiles.secret_paths]] file = [ "~/Library/Preferences/netlify/config.json", "~/.config/netlify/config.json", "%APPDATA%/netlify/Config/config.json", ] match = { key_path = ["users.*.auth.token", "users.*.auth.github.token"] } # cliId is the anonymous install identifier the CLI generates once and reports # as telemetry's anonymousId (src/utils/telemetry/telemetry.ts), so carrying it # to a second machine would make the two report as one install. [[dotfiles.machine_lines]] file = [ "~/Library/Preferences/netlify/config.json", "~/.config/netlify/config.json", "%APPDATA%/netlify/Config/config.json", ] match = { key_path = ["cliId"] } [commands] format = 1 label = "Netlify CLI" description = "Global options only; use the Deploy and Dev subcommands." quality = "ai-draft" base = "fig:netlify" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/netlify.ts" license = "MIT" [[commands.subcommand]] path = ["deploy"] label = "Deploy site" description = "Create a deploy from a folder. Auth tokens and proxy settings are left out." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/netlify.ts" license = "MIT" [[commands.subcommand.field]] id = "dir" label = "Folder to deploy" type = "path" option = ["--dir", "-d"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "functions" label = "Functions folder" type = "path" option = ["--functions", "-f"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "message" label = "Deploy message" type = "string" option = ["--message", "-m"] sources = ["fig"] [[commands.subcommand.field]] id = "prod" label = "Deploy to production" type = "boolean" option = ["--prod", "-p"] effect = "overwrite" sources = ["fig"] [[commands.subcommand.field]] id = "build" label = "Run build first" type = "boolean" option = ["--build"] sources = ["fig"] [[commands.subcommand.field]] id = "site" label = "Site ID" type = "string" option = ["--site", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "alias" label = "Deploy alias" type = "string" option = ["--alias"] sources = ["fig"] [[commands.subcommand.field]] id = "open" label = "Open site after deploy" type = "boolean" option = ["--open", "-o"] sources = ["fig"] [[commands.subcommand.field]] id = "json" label = "JSON output" type = "boolean" option = ["--json"] sources = ["fig"] [[commands.subcommand.field]] id = "prod_if_unlocked" label = "Production if unlocked" type = "boolean" option = ["--prodIfUnlocked"] sources = ["fig"] [[commands.subcommand.task]] id = "draft" label = "Draft deploy" fields = ["dir", "message", "build", "alias"] required = [] [[commands.subcommand.task]] id = "prod" label = "Production deploy" fields = ["dir", "message", "build"] required = [] set = { prod = [true] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["dir", "message", "prod", "build"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["functions", "site", "alias", "open", "json", "prod_if_unlocked"] [[commands.subcommand]] path = ["dev"] label = "Local dev server" description = "Run the local dev server." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/netlify.ts" license = "MIT" [[commands.subcommand.field]] id = "command" label = "Command to run" type = "string" option = ["--command", "-c"] sources = ["fig"] [[commands.subcommand.field]] id = "port" label = "Port" type = "integer" option = ["--port", "-p"] sources = ["fig"] [[commands.subcommand.field]] id = "target_port" label = "Target app port" type = "integer" option = ["--targetPort"] sources = ["fig"] [[commands.subcommand.field]] id = "dir" label = "Static files dir" type = "path" option = ["--dir", "-d"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "functions" label = "Functions folder" type = "path" option = ["--functions", "-f"] path = { kind = "directory", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "live" label = "Public live session" type = "boolean" option = ["--live", "-l"] sources = ["fig"] [[commands.subcommand.field]] id = "offline" label = "Offline" type = "boolean" option = ["--offline", "-o"] sources = ["fig"] [[commands.subcommand.field]] id = "framework" label = "Framework" type = "string" option = ["--framework"] sources = ["fig"] [[commands.subcommand.task]] id = "dev" label = "Start dev server" fields = ["port", "command", "framework"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["command", "port"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["target_port", "dir", "functions", "live", "offline", "framework"]