-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,72 @@ | ||
# cli-plugin | ||
CLI plugin for webapps | ||
# CLI Plugin | ||
CLI plugin is a simple and easy to use CLI for web applications. | ||
|
||
This is project originated from my fascination with minimalistic user interfaces. | ||
While rich in functionality - a good CLI is never distracting. | ||
|
||
Features: | ||
- keeps history of used commands | ||
- configurable colorschemes | ||
|
||
## Demo | ||
Click <a href="https://rawgit.com/g1eb/cli-plugin/master/" target="_blank">here</a> for a live demo. | ||
|
||
## Install | ||
|
||
- Install 'cli-plugin' with bower | ||
|
||
``` | ||
bower install cli-plugin | ||
``` | ||
|
||
- Install 'cli-plugin' with npm | ||
|
||
``` | ||
npm install cli-plugin | ||
``` | ||
|
||
- Or include files directly in your html: | ||
|
||
``` | ||
<link rel="stylesheet" type="text/css" href="dist/cli-plugin.min.css"> | ||
<script src="dist/cli-plugin.min.js"></script> | ||
``` | ||
|
||
### Setup | ||
|
||
Initialize cliPlugin using a custom colorscheme/config file. | ||
|
||
``` | ||
cliPlugin.init(config); | ||
``` | ||
|
||
Config accepts following properties: | ||
|
||
|Property | Usage | Default | Required | | ||
|:------------- |:-------------|:-----:|:-----:| | ||
| textColor | text color | #111111 | no | | ||
| cursorColor | cursor color | #111111 | no | | ||
| backgroundColor | background color | whitesmoke | no | | ||
|
||
Feel free to use hex, rgb(a) or html5 color names :) | ||
|
||
### Register commands | ||
|
||
Register your own commands: | ||
|
||
``` | ||
cliPlugin.bind('list', function () { | ||
cliPlugin.print('<p>items on the shopping list:</p>'); | ||
cliPlugin.print('<ul><li>milk</li><li>bacon</li><li>eggs</li></ul>'); | ||
}); | ||
``` | ||
|
||
### Useful functions | ||
|
||
Use ```cliPlugin.print(text)``` command to print text on the screen, accepts html. | ||
|
||
Use ```cliPlugin.clear()``` command to clear the screen. | ||
|
||
### Example | ||
|
||
See [index.html](https://github.com/g1eb/cli-plugin/blob/master/index.html) for an example implementation. |