Warp Tools
Warp Tools is a command line tool for the Warp Framework. It is designed to work with projects built on-top of the WarpServer.
Installation
To install Warp Tools via npm, simply use the install command to save it globally:
npm install -g warp-tools
Getting Started
Creating a New Project
To create a new Warp project, simply execute the following command:
warp new <name> [destination]
For example:
warp new sample-project[Warp Tools 2016-07-01 08:41:27] Creating `sample-project`...Enter Desired API Key [auto-generated key]: r13f8hn189r93fEnter Desired Master Key [auto-generated key]: 31r80feu1384gh9Enter DB Host [localhost]: localhostEnter DB Port [3306]: 3306Enter DB User [root]: rootEnter DB Password: passwordEnter Default DB: default_db [Warp Tools 2016-07-01 08:45:58] Create : warp-config.json[Warp Tools 2016-07-01 08:45:58] Create : sample-project[Warp Tools 2016-07-01 08:45:58] Create : sample-project/package.json[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app.js[Warp Tools 2016-07-01 08:45:58] Create : sample-project/.gitignore[Warp Tools 2016-07-01 08:45:58] Create : sample-project/public[Warp Tools 2016-07-01 08:45:58] Create : sample-project/bin[Warp Tools 2016-07-01 08:45:58] Create : sample-project/bin/www[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app[Warp Tools 2016-07-01 08:45:58] Create : sample-project/public/javascripts[Warp Tools 2016-07-01 08:45:58] Create : sample-project/public/storage[Warp Tools 2016-07-01 08:45:58] Create : sample-project/public/images[Warp Tools 2016-07-01 08:45:58] Create : sample-project/public/stylesheets[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/api.js[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/client[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/client/main.js[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/models[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/models/user.js[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/models/session.js[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/functions[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/functions/.gitkeep[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/migrations[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/migrations/.gitkeep[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/migrations/201607010845-initial-migration.json[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/queues[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/queues/.gitkeep[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/client/subclasses[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/client/subclasses/.gitkeep[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/views[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/views/index.htm[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/routes[Warp Tools 2016-07-01 08:45:58] Create : sample-project/app/server/routes/index.js
Initializing Warp Tools in an Existing Project
To initialize Warp Tools in an existing Warp project, simply execute the following command:
warp init
Migrations
Creating a new Migration
To create a new Migration, simply execute the following command:
warp migration:new <id> [destination]
For example:
warp migration:new create-alien-table[Warp Tools 2016-07-01 09:00:55] Creating migration `201607010900-create-alien-table`...[Warp Tools 2016-07-01 09:00:55] Create : 201607010900-create-alien-table.json
Saving a Migration
To save a Migration to the backend, simply execute the following command:
warp migration:save <id> [destination]
For example:
warp migration:save create-alien-table[Warp Tools 2016-07-01 09:00:55] Saving migration `201607010900-create-alien-table`...[Warp Tools 2016-07-01 09:00:55] `201607010900-create-alien-table.json` saved!
Updating a Migration
To update a Migration in the backend, simply execute the following command:
warp migration:update <id> [destination]
For example:
warp migration:update create-alien-table[Warp Tools 2016-07-01 09:00:55] Updating migration `201607010900-create-alien-table`...[Warp Tools 2016-07-01 09:00:55] `201607010900-create-alien-table.json` saved!
Commiting Migrations
To commit pending Migrations in the backend, simply execute the following command:
warp migration:commit
For example:
warp migration:commit[Warp Tools 2016-07-01 09:00:55] Committing migrations...[Warp Tools 2016-07-01 09:00:55]
Reverting Latest Migration
To revert the latest Migration in the backend, simply execute the following command:
warp migration:revert
For example:
warp migration:revert[Warp Tools 2016-07-01 09:00:55] Reverting latest migration...[Warp Tools 2016-07-01 09:00:55]
Resetting Migrations
To reset Migrations in the backend, simply execute the following command:
warp migration:reset
For example:
warp migration:reset[Warp Tools 2016-07-01 09:00:55] Resetting migrations...[Warp Tools 2016-07-01 09:00:55]