Linux command
surge 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Deploy current directory
surge
Deploy specific directory
surge [./dist]
Deploy to custom domain
surge [./dist] [mysite.surge.sh]
Deploy with explicit flags
surge --project [./dist] --domain [mysite.surge.sh]
List deployed projects
surge list
Remove deployment
surge teardown [mysite.surge.sh]
Login
surge login
Logout
surge logout
Show current user
surge whoami
说明
surge is a static website publishing platform that deploys web projects with a single command. Point it at a directory containing HTML, CSS, JavaScript, and other static assets, and it instantly publishes to a *.surge.sh subdomain or a custom domain. All deployments include free SSL certificates for HTTPS. Custom domains are supported at no additional cost, requiring only a DNS CNAME record. The platform is designed for front-end developers who need fast, simple hosting without server configuration. Authentication tokens enable automated deployments in CI/CD pipelines. The list command shows all deployed projects, and teardown removes a deployment. Surge is particularly popular for publishing documentation sites, single-page applications, and project demos.
参数
- list
- Show projects.
- teardown _DOMAIN_
- Remove project.
- login
- Authenticate.
- logout
- Log out.
- whoami
- Show user.
- token
- Get auth token for CI/CD use.
- --project _path_
- Specify project directory.
- --domain _domain_
- Specify target domain.
- --token _token_
- Provide auth token (for CI/CD).
FAQ
What is the surge command used for?
surge is a static website publishing platform that deploys web projects with a single command. Point it at a directory containing HTML, CSS, JavaScript, and other static assets, and it instantly publishes to a *.surge.sh subdomain or a custom domain. All deployments include free SSL certificates for HTTPS. Custom domains are supported at no additional cost, requiring only a DNS CNAME record. The platform is designed for front-end developers who need fast, simple hosting without server configuration. Authentication tokens enable automated deployments in CI/CD pipelines. The list command shows all deployed projects, and teardown removes a deployment. Surge is particularly popular for publishing documentation sites, single-page applications, and project demos.
How do I run a basic surge example?
Run `surge` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does list do in surge?
Show projects.