Coder Social home page Coder Social logo

plugin-serverless's Introduction

@twilio-labs/plugin-serverless

Plugin for the Twilio CLI to locally develop, debug and deploy to Twilio Serverless. Part of the Serverless Toolkit

npm (scoped) npm GitHub All Contributors Code of Conduct PRs Welcome


This plugin adds functionality to the Twilio CLI to locally develop, debug and deploy to Twilio Serverless. It's a part of the Serverless Toolkit and wraps twilio-run and create-twilio-function.

Requirements

Install the Twilio CLI

Via npm or yarn:

$ npm install -g twilio-cli
$ yarn global add twilio-cli

Via homebrew:

$ brew tap twilio/brew && brew install twilio

Usage

$ twilio plugins:install @twilio-labs/plugin-serverless
$ twilio --help serverless
USAGE
  $ twilio serverless
...

Commands

twilio serverless:activate

Promotes an existing deployment to a new environment

USAGE
  $ twilio serverless:activate

OPTIONS
  -c, --config=config                      [default: .twilio-functions] Location of the config file. Absolute path or
                                           relative to current working directory (cwd)

  -l, --logLevel=logLevel                  [default: info] Level of logging messages.

  -p, --profile=profile                    Shorthand identifier for your profile.

  -u, --account-sid=account-sid            A specific account SID to be used for deployment. Uses fields in .env
                                           otherwise

  --auth-token=auth-token                  Use a specific auth token for deployment. Uses fields from .env otherwise

  --build-sid=build-sid                    An existing Build SID to deploy to the new environment

  --create-environment                     Creates environment if it couldn't find it.

  --cwd=cwd                                Sets the directory of your existing Serverless project. Defaults to current
                                           directory

  --env=env                                Path to .env file for environment variables that should be installed

  --environment=environment                (required) The environment suffix or SID to deploy to.

  --force                                  Will run deployment in force mode. Can be dangerous.

  --production                             Promote build to the production environment (no domain suffix). Overrides
                                           environment flag

  --service-sid=service-sid                SID of the Twilio Serverless Service to deploy to

  --source-environment=source-environment  SID or suffix of an existing environment you want to deploy from.

See code: src/commands/serverless/activate.js

twilio serverless:deploy

Deploys existing functions and assets to Twilio

USAGE
  $ twilio serverless:deploy

OPTIONS
  -c, --config=config                  [default: .twilio-functions] Location of the config file. Absolute path or
                                       relative to current working directory (cwd)

  -l, --logLevel=logLevel              [default: info] Level of logging messages.

  -n, --service-name=service-name      Overrides the name of the Serverless project. Default: the name field in your
                                       package.json

  -p, --profile=profile                Shorthand identifier for your profile.

  -u, --account-sid=account-sid        A specific account SID to be used for deployment. Uses fields in .env otherwise

  --[no-]assets                        Upload assets. Can be turned off with --no-assets

  --assets-folder=assets-folder        Specific folder name to be used for static assets

  --auth-token=auth-token              Use a specific auth token for deployment. Uses fields from .env otherwise

  --cwd=cwd                            Sets the directory from which to deploy

  --env=env                            Path to .env file. If none, the local .env in the current working directory is
                                       used.

  --environment=environment            [default: dev] The environment name (domain suffix) you want to use for your
                                       deployment

  --force                              Will run deployment in force mode. Can be dangerous.

  --[no-]functions                     Upload functions. Can be turned off with --no-functions

  --functions-folder=functions-folder  Specific folder name to be used for static functions

  --override-existing-project          Deploys Serverless project to existing service if a naming conflict has been
                                       found.

  --production                         Please prefer the "activate" command! Deploys to the production environment (no
                                       domain suffix). Overrides the value passed via the environment flag.

See code: src/commands/serverless/deploy.js

twilio serverless:init NAME

Creates a new Twilio Function project

USAGE
  $ twilio serverless:init NAME

ARGUMENTS
  NAME  Name of Serverless project and directory that will be created

OPTIONS
  -a, --account-sid=account-sid  The Account SID for your Twilio account
  -p, --profile=profile          Shorthand identifier for your profile.
  -t, --auth-token=auth-token    Your Twilio account Auth Token

  --import-credentials           Import credentials from the environment variables TWILIO_ACCOUNT_SID and
                                 TWILIO_AUTH_TOKEN

  --skip-credentials             Don't ask for Twilio account credentials or import them from the environment

  --template=template            Initialize your new project with a template from
                                 github.com/twilio-labs/function-templates

See code: src/commands/serverless/init.js

twilio serverless:list [TYPES]

List existing services, environments, variables, deployments for your Twilio Serverless Account

USAGE
  $ twilio serverless:list [TYPES]

ARGUMENTS
  TYPES  [default: services] Comma separated list of things to list (services,environments,functions,assets,variables)

OPTIONS
  -c, --config=config              [default: .twilio-functions] Location of the config file. Absolute path or relative
                                   to current working directory (cwd)

  -l, --logLevel=logLevel          [default: info] Level of logging messages.

  -n, --service-name=service-name  Overrides the name of the Serverless project. Default: the name field in your
                                   package.json

  -p, --profile=profile            Shorthand identifier for your profile.

  -u, --account-sid=account-sid    A specific account SID to be used for deployment. Uses fields in .env otherwise

  --auth-token=auth-token          Use a specific auth token for deployment. Uses fields from .env otherwise

  --env=env                        Path to .env file for environment variables that should be installed

  --environment=environment        [default: dev] The environment to list variables for

  --extended-output                Show an extended set of properties on the output

  --service-sid=service-sid        Specific Serverless Service SID to run list for

See code: src/commands/serverless/list.js

twilio serverless:list-templates

Lists the available Twilio Function templates

USAGE
  $ twilio serverless:list-templates

OPTIONS
  -l, --logLevel=logLevel  [default: info] Level of logging messages.

See code: src/commands/serverless/list-templates.js

twilio serverless:new [NAMESPACE]

Creates a new Twilio Function based on an existing template

USAGE
  $ twilio serverless:new [NAMESPACE]

ARGUMENTS
  NAMESPACE  The namespace your assets/functions should be grouped under

OPTIONS
  -l, --logLevel=logLevel  [default: info] Level of logging messages.
  --template=template

See code: src/commands/serverless/new.js

twilio serverless:start [DIR]

Starts local Twilio Functions development server

USAGE
  $ twilio serverless:start [DIR]

ARGUMENTS
  DIR  Root directory to serve local Functions/Assets from

OPTIONS
  -c, --config=config        [default: .twilio-functions] Location of the config file. Absolute path or relative to
                             current working directory (cwd)

  -e, --env=env              Loads .env file, overrides local env variables

  -f, --load-local-env       Includes the local environment variables

  -l, --logLevel=logLevel    [default: info] Level of logging messages.

  -p, --port=port            (required) [default: 3000] Override default port of 3000

  --cwd=cwd                  Alternative way to define the directory to start the server in. Overrides the [dir]
                             argument passed.

  --detailed-logs            Toggles detailed request logging by showing request body and query params

  --inspect=inspect          Enables Node.js debugging protocol

  --inspect-brk=inspect-brk  Enables Node.js debugging protocol, stops executioin until debugger is attached

  --legacy-mode              Enables legacy mode, it will prefix your asset paths with /assets

  --[no-]live                Always serve from the current functions (no caching)

  --[no-]logs                Toggles request logging

  --ngrok=ngrok              Uses ngrok to create and outfacing url

ALIASES
  $ twilio serverless:dev
  $ twilio serverless:run

See code: src/commands/serverless/start.js

Contributing

This project welcomes contributions from the community. Please see the CONTRIBUTING.md file for more details.

Code of Conduct

Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other โค๏ธ

Contributors

Thanks goes to these wonderful people (emoji key):

Dominik Kundel
Dominik Kundel

๐Ÿ’ป ๐Ÿ“– ๐Ÿค”
childish-sambino
childish-sambino

๐Ÿ’ป ๐Ÿ›
Elmer Thomas
Elmer Thomas

๐Ÿ› ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

plugin-serverless's People

Contributors

dkundel avatar parammittal16 avatar parikshit-hooda avatar philnash avatar thinkingserious avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.