Skip to content

How to expose the Surge CLI within your own command line tool, built with Commander.

License

Notifications You must be signed in to change notification settings

surge-sh/example-commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commander example

How to expose the Surge CLI within your own command line tool, built with Commander.

Getting started

This example command line tool will show you how to build Surge into your own CLI, using Commander. The code is commented, and shows some basic pre- and post-run hooks you can add between Surge’s steps.

First, clone the repository and install its dependencies:

# Clone the repository
git clone https://github.com/surge-sh/example-commander
cd example-commander

# Install dependencies
npm install

Then, you can run the binary to test this module locally with:

example

Try running example publish to see the hooks in action:

example publish

Hooks

Here are all the pre- and post-run hooks available:

  • hooks.preAuth
  • hooks.postAuth
  • hooks.preProject
  • hooks.postProject
  • hooks.preSize
  • hooks.postSize
  • hooks.preDomain
  • hooks.postDomain
  • hooks.prePublish
  • hooks.postPublish

License

The MIT License (MIT)

Copyright © 2015 Chloi Inc.

About

How to expose the Surge CLI within your own command line tool, built with Commander.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published