This is a sample application for using the web-cli html Polymer control.
The application is a holistic solution for a web based CLI, with the following features implemented:
- Authentication- using Google authentication
- Authorization- Maintaining a list of authorized users
- Logging- query application logs (the console application logs or any other application using the same azure-logging node module.
The features are automatically enabled based on the provided configuration, so you can start by running the app as is before onboarding with Google for the authentication, or subscribing with Azure to provide an Azure Storage Account settings for the users and logs features.
The application implements a few plugins to extend the console with more commands. The plugins can be found in the api folder. The app reads this folder and adds the plugins dynamically, so basically, adding a plugin can be done by just adding a file to this folder.
Detailed description of how to extent the console can be found here.
The documentation can also be accessed using the man
command from within the console. The man
command itself is implemented as a plugin.
git clone https://github.com/amiturgman/web-cli-sample-app.git
cd web-cli-sample-app
npm install
cd public
bower install
npm start
Browse to http://localhost:3000
I also created a cool stickey-notes-like sample in which you can create as many consoles as you want.
To try it, browse to http://localhost:3000/stickey-notes
To enable the features described above, refer to the config/index.js file, and provide the relevant settings based on the features you'de like to enable. You can either define these setting as environment variables, or define them in a local file (for development).
- Copy the
config/dev.sample.json
file and create a new file namedconfig/dev.private.json
. - Fill in the details for the features you'de like to support.
- You don't have to fill in all settings, but leave those you're not using blank.
- Browse to Google Developer Console.
- Under
Use Google APIs
, clickEnable and Manage APIs
link. - Select
Google+ API
and clickEnable
. - Open the
Credentials
tab. Click theCreate Credentials
select box and selectOAuth client ID
. - Select
Web Application
option from the menu and fill in the following details:
- In the
Authorized JavaScript origins
, add the Url for your website:http://localhost:3000
in this case. - In the
Authorized redirect URIs
, add the callback Url:http://localhost:3000/.auth/login/google/callback
in this case. - Click the
Create
button.
- You'll get a
client Id
and aclient secret
. Copy these strings to a temporary file. We'll use it in a bit.
** you can also use your web application url instead of localhost
if you deploy it on the cloud.