CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-netlify-cli

Netlify command line tool for deploying and managing modern web applications on the Netlify platform

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

site-management.mddocs/

Site Management

Core project and site management functionality for creating, linking, configuring, and managing Netlify projects and their associated resources.

Capabilities

Site Creation

Create new Netlify sites with various configuration options and team assignments.

/**
 * Create empty Netlify site
 * Command: netlify sites:create [options]
 */
interface SiteCreateOptions {
  /** Site name (max 63 characters, will be part of site URL) */
  name?: string;
  /** Account/team slug for site ownership */
  accountSlug?: string;
  /** Initialize continuous integration hooks */
  withCi?: boolean;
  /** Force manual CI setup instead of automatic */
  manual?: boolean;
  /** Create site without linking to local project */
  disableLinking?: boolean;
}

/**
 * Create site from starter template
 * Command: netlify sites:create-template [repository] [options]
 */
interface SiteCreateTemplateOptions {
  /** Site name (max 63 characters) */
  name?: string;
  /** Template repository URL */
  url?: string;
  /** Account/team slug for site ownership */
  accountSlug?: string;
  /** Initialize continuous integration hooks */
  withCi?: boolean;
}

Usage Examples:

# Create site with interactive prompts
netlify sites:create

# Create named site
netlify sites:create --name my-awesome-project

# Create site for specific team
netlify sites:create --name team-project --account-slug my-team

# Create site with CI enabled
netlify sites:create --name ci-project --with-ci

# Create without linking to current directory
netlify sites:create --name standalone-site --disable-linking

# Create from template repository
netlify sites:create-template

# Create from specific template
netlify sites:create-template https://github.com/netlify/gatsby-starter

# Create template site with custom name
netlify sites:create-template --name my-gatsby-site --url https://github.com/netlify/gatsby-starter

Site Linking

Link local projects to existing Netlify sites for deployment and management.

/**
 * Link local project to existing Netlify site
 * Command: netlify link [projectIdOrName] [options]
 */
interface LinkOptions {
  /** Project ID to link to */
  id?: string;
  /** Project name to link to */
  name?: string;
  /** Git remote name for linking */
  gitRemoteName?: string;
}

/**
 * Unlink local project from Netlify site
 * Command: netlify unlink
 */
interface UnlinkOptions {
  /** No additional options for unlink */
}

Usage Examples:

# Interactive site selection
netlify link

# Link by site ID
netlify link --id abc123def456

# Link by site name
netlify link --name my-production-site

# Link with custom git remote
netlify link --git-remote-name origin

# Link directly with site ID argument
netlify link abc123def456

# Unlink current project
netlify unlink

Site Listing and Information

List and retrieve information about accessible Netlify sites.

/**
 * List all accessible sites
 * Command: netlify sites:list [options]
 */
interface SiteListOptions {
  /** Output as JSON */
  json?: boolean;
}

/**
 * Site information structure
 */
interface SiteInfo {
  /** Site ID */
  id: string;
  /** Site name */
  name: string;
  /** Primary site URL */
  url: string;
  /** Admin URL */
  adminUrl: string;
  /** Site state */
  state: 'created' | 'building' | 'deployed' | 'error';
  /** Account information */
  account: {
    name: string;
    slug: string;
  };
  /** Git repository information */
  repo?: {
    provider: 'github' | 'gitlab' | 'bitbucket';
    owner: string;
    name: string;
    fullName: string;
    url: string;
    branch: string;
  };
  /** Build settings */
  buildSettings: {
    command?: string;
    publishDir?: string;
    functionsDir?: string;
  };
  /** Creation and update timestamps */
  createdAt: Date;
  updatedAt: Date;
  /** Deployment count */
  deployCount: number;
  /** Custom domain information */
  customDomain?: string;
  /** SSL status */
  ssl: boolean;
}

Usage Examples:

# List all sites
netlify sites:list

# List sites with JSON output
netlify sites:list --json

Site Deletion

Permanently delete Netlify sites with confirmation prompts.

/**
 * Delete a site permanently
 * Command: netlify sites:delete <id> [options]
 */
interface SiteDeleteOptions {
  /** Force deletion without confirmation prompt (useful for CI) */
  force?: boolean;
}

Usage Examples:

# Delete site with confirmation prompt
netlify sites:delete abc123def456

# Force delete without prompt (for CI/scripts)
netlify sites:delete abc123def456 --force

Project Initialization

Initialize continuous deployment for new or existing projects.

/**
 * Configure continuous deployment for project
 * Command: netlify init [options]
 */
interface InitOptions {
  /** Manual git remote configuration */
  manual?: boolean;
  /** Custom git remote name */
  gitRemoteName?: string;
}

/**
 * Project initialization configuration
 */
interface ProjectInitConfig {
  /** Git repository detection */
  gitRepo: {
    detected: boolean;
    provider?: 'github' | 'gitlab' | 'bitbucket';
    owner?: string;
    name?: string;
    branch: string;
    remoteUrl: string;
  };
  
  /** Build configuration detection */
  buildConfig: {
    /** Detected framework */
    framework?: 'gatsby' | 'next' | 'react' | 'vue' | 'angular' | 'hugo' | 'jekyll';
    /** Detected build command */
    buildCommand?: string;
    /** Detected publish directory */
    publishDir?: string;
    /** Detected functions directory */
    functionsDir?: string;
  };
  
  /** Site connection options */
  siteOptions: {
    /** Create new site */
    createNew: boolean;
    /** Link to existing site */
    linkExisting?: {
      siteId: string;
      siteName: string;
    };
  };
}

Usage Examples:

# Initialize with automatic detection
netlify init

# Initialize with manual git configuration
netlify init --manual

# Initialize with custom git remote name
netlify init --git-remote-name upstream

Site Status and Information

Get detailed status information about linked or specified sites.

/**
 * Print status information
 * Command: netlify status [options]
 */
interface StatusOptions {
  /** Include verbose system information */
  verbose?: boolean;
  /** Output as JSON */
  json?: boolean;
}

/**
 * Site status information
 */
interface SiteStatus {
  /** Current user information */
  user: {
    name: string;
    email: string;
    avatar: string;
    teams: Array<{
      name: string;
      slug: string;
      role: 'owner' | 'collaborator' | 'developer';
    }>;
  };
  
  /** Site information (if linked) */
  site?: {
    id: string;
    name: string;
    url: string;
    adminUrl: string;
    state: string;
    account: {
      name: string;
      slug: string;
    };
    buildSettings: {
      command?: string;
      publishDir?: string;
      functionsDir?: string;
    };
    lastDeploy?: {
      id: string;
      state: string;
      url: string;
      createdAt: Date;
    };
  };
  
  /** Git repository information */
  git?: {
    provider: string;
    owner: string;
    repo: string;
    branch: string;
    commitSha: string;
    remoteUrl: string;
  };
  
  /** Local configuration */
  config: {
    /** Netlify configuration file path */
    configPath?: string;
    /** Functions directory */
    functionsDir?: string;
    /** Publish directory */
    publishDir?: string;
    /** Build command */
    buildCommand?: string;
  };
}

Usage Examples:

# Basic status information
netlify status

# Verbose status with system info
netlify status --verbose

# Status as JSON
netlify status --json

Site Configuration Management

Manage site settings and configuration options.

/**
 * Site configuration settings
 */
interface SiteConfig {
  /** General settings */
  general: {
    name: string;
    customDomain?: string;
    defaultBranch: string;
    httpsRedirect: boolean;
    ssl: {
      enabled: boolean;
      certificateType: 'netlify' | 'custom' | 'lets-encrypt';
    };
  };
  
  /** Build settings */
  build: {
    command?: string;
    publishDirectory?: string;
    functionsDirectory?: string;
    baseDirectory?: string;
    packageDirectory?: string;
    stopBuilds: boolean;
  };
  
  /** Environment settings */
  environment: {
    variables: Record<string, string>;
    secrets: string[];
  };
  
  /** Deploy settings */
  deploy: {
    autoPublish: boolean;
    branchDeploys: boolean;
    deployPreviews: boolean;
    splitTesting: boolean;
  };
  
  /** Security settings */
  security: {
    mixedContent: 'block' | 'upgrade';
    referrerPolicy: string;
    featurePolicy: string;
    permissions: string[];
  };
  
  /** Performance settings */
  performance: {
    assetOptimization: boolean;
    bundleAnalysis: boolean;
    prerendering: boolean;
  };
}

Team and Account Management

Handle multi-team workflows and account switching.

/**
 * Switch between Netlify accounts/teams
 * Command: netlify switch
 */
interface SwitchOptions {
  /** No additional options for switch */
}

/**
 * Team/account information
 */
interface TeamInfo {
  /** Team ID */
  id: string;
  /** Team name */
  name: string;
  /** Team slug */
  slug: string;
  /** User's role in team */
  role: 'owner' | 'collaborator' | 'developer';
  /** Team plan */
  plan: 'starter' | 'pro' | 'business' | 'enterprise';
  /** Team members count */
  memberCount: number;
  /** Sites count */
  siteCount: number;
  /** Team settings */
  settings: {
    billingEmail: string;
    defaultDomain: string;
    customBranding: boolean;
  };
}

Usage Examples:

# Interactive team/account switching
netlify switch

Site Hooks and Integrations

Manage webhooks and integrations for sites.

/**
 * Print hook information for linked site
 * Command: netlify status:hooks
 */
interface HooksInfo {
  /** Deployment hooks */
  deployHooks: Array<{
    id: string;
    title: string;
    url: string;
    branch: string;
    createdAt: Date;
  }>;
  
  /** Outgoing webhooks */
  webhooks: Array<{
    id: string;
    event: 'deploy-building' | 'deploy-succeeded' | 'deploy-failed' | 'deploy-locked' | 'deploy-unlocked';
    url: string;
    enabled: boolean;
  }>;
  
  /** Git provider integration */
  gitIntegration: {
    provider: 'github' | 'gitlab' | 'bitbucket';
    installationId: string;
    connected: boolean;
    permissions: string[];
  };
  
  /** Third-party integrations */
  integrations: Array<{
    name: string;
    type: 'analytics' | 'monitoring' | 'forms' | 'identity';
    enabled: boolean;
    settings: Record<string, any>;
  }>;
}

Usage Examples:

# Show hooks information for current site
netlify status:hooks

docs

authentication-teams.md

blobs-storage.md

build-system.md

deployment.md

environment-variables.md

functions.md

index.md

local-development.md

site-management.md

tile.json