Develop with the Edge CLI
The Edge CLI is a command-line tool that allows you to interact with the Edge platform. You can use the Edge CLI to create, manage, and deploy applications on Edge.
With the Edge CLI you can do many of the actions described in Your First App in a simplified way.
Installing the Edge CLI
To install the Edge CLI, you need to have the Enthought Deployment Manager (EDM)
and with that you can install the enthought_edge
client and edge_cli
:
$ edm shell
$ edm install enthought_edge edge_cli
In addition to the above packages, you need the same resource access as described in Your First App.
Then you can test the CLI with:
$ edge
Step 1: Initialize a new application
In a terminal, execute the edge command:
$ edge app init
This will log you into Edge (if necessary) and prompt you for the following:
? Application ID: my-app
? Create application in which organization? Default organization
? Application framework? Generic App
Do you want to create new application "my-app"? [Y/n]:
Answer Y
to create the application. This will create a new directory with the
name of the application ID in the current directory, download the example
application for the chosen framework into that directory, create an EDM
virtual environment, and create an application record in Edge.
Further edge app
commands are performed from within the application
directory:
$ cd my-app
Step 2: Build and test
To have the application's dependencies available for further operations, enter its virtual environment:
$ edge app shell
You can build the application with:
$ edge app build
This prompts you for the version to build as, with version 1.0.0
as the
initial default:
? Build to version: 1.0.0
If you override this default, it will build to the new version number and that becomes the new default working version.
Once built, you can do a basic "smoke test" with:
$ edge app check
This will launch the application, ensure it can be communicated with, then shut it down again.
If you want to interact with the application manually use:
$ edge app run
This launches your application where it can be found in your web browser
at http://127.0.0.1:9000/
. Once you are done, you can shut it down with
Ctrl-C
.
Step 3: Publish the application
To publish the application, you need to build it first, then run:
$ edge app publish
This will push the application to the Enthought quay repository and create an Application Version record in Edge. You can then launch the application from the Edge Workbench like any other native application.
Step 4: Other commands
You can check the full set of published versions using:
$ edge app versions
See the full list of application commands with:
$ edge app --help
Run any given command in verbose mode for debugging:
$ edge app --verbose <command>