Web-based Command Line Interface Console
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
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
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.jsonfile and create a new file named
- 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.
Enable Google Authentication
- Browse to Google Developer Console.
Use Google APIs, click
Enable and Manage APIslink.
Google+ APIand click
- Open the
Credentialstab. Click the
Create Credentialsselect box and select
OAuth client ID.
Web Applicationoption from the menu and fill in the following details:
- In the
http://localhost:3000in this case.
- In the
Authorized redirect URIs, add the callback Url:
http://localhost:3000/.auth/login/google/callbackin this case.
- Click the
- You'll get a
client Idand a
client 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.