|
1 | 1 | Adapt Command Line Interface |
2 | 2 | ============================ |
3 | 3 |
|
4 | | -[](https://travis-ci.org/adaptlearning/adapt-cli) |
| 4 | +[](https://travis-ci.org/adaptlearning/adapt-cli) [](https://gitter.im/adaptlearning/adapt-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
5 | 5 |
|
6 | 6 | Installation |
7 | 7 | ------------ |
8 | 8 |
|
9 | 9 | To install the Adapt CLI, first be sure to install [NodeJS](http://nodejs.org) and [git](http://git-scm.com/downloads), then from the command line run:- |
10 | | - |
11 | | - |
12 | | - npm install -g adapt-cli |
13 | | - |
| 10 | +``` |
| 11 | +npm install -g adapt-cli |
| 12 | +``` |
14 | 13 |
|
15 | 14 | Usage |
16 | 15 | ----- |
17 | 16 |
|
18 | 17 | ##### Creating an Adapt course |
19 | | - |
20 | | - adapt create {type} {path} [{branch}] |
21 | | - |
22 | | -type - What to create. Only the value "course" is currently supported. |
23 | | -path - The directory of the new course. |
24 | | -branch - Optional - The branch of the framework to be downlaoded. |
| 18 | +``` |
| 19 | +adapt create {type} {path} [{branch}] |
| 20 | +``` |
| 21 | +`type` What to create. The only types currently supported are `course` and `component`. If you want to create a new Adapt course, use `course`. If you want to develop a new Adapt component, use `component` to download a component template. |
| 22 | +`path` The name of the directory you'd like the course to be downloaded to (relative to the current directory) |
| 23 | +`branch` (optional) The branch of the framework you'd like to use as the basis for your course. If your needs to support Internet Explorer v8, 9 or 10 then set this to `legacy`. If not, leave blank or set to `master`. |
25 | 24 |
|
26 | 25 | For example... |
27 | | - |
28 | | - adapt create course "My Course" |
29 | | - |
| 26 | +``` |
| 27 | +adapt create course "My Course" |
| 28 | +``` |
30 | 29 | This will download the Adapt framework and create an new course in the directory "My Course", in your current directory. |
31 | 30 |
|
32 | 31 | ##### Searching for an Adapt plugin. |
33 | | - |
34 | | - adapt search {name or partial name of plugin to search for} |
35 | | - |
| 32 | +``` |
| 33 | +adapt search {name or partial name of plugin to search for} |
| 34 | +``` |
36 | 35 |
|
37 | 36 | ##### Installing a plugin into your current directory |
38 | | - |
39 | | - adapt install {name of plugin} |
40 | | - |
| 37 | +``` |
| 38 | +adapt install {name of plugin} |
| 39 | +``` |
41 | 40 | Additionally you can install a specific version of a plugin. |
42 | | - |
43 | | - adapt install {name of plugin}#{version} |
44 | | - |
| 41 | +``` |
| 42 | +adapt install {name of plugin}#{version} |
| 43 | +``` |
45 | 44 | Anywhere that you are required to provide a name of a plugin it can be either fully qualified with 'adapt-' or optionally you can omit the prefix an just use the plugin name. |
46 | 45 |
|
47 | 46 | Therefore these commands are equivalent: |
48 | | - |
49 | | - adapt install adapt-my-plugin |
50 | | - adapt install my-plugin |
51 | | - |
52 | | -Installed plugins are saved to `adapt.json`. |
| 47 | +``` |
| 48 | +adapt install adapt-my-plugin |
| 49 | +adapt install my-plugin |
| 50 | +``` |
| 51 | +Installed plugins are saved to `adapt.json`. |
53 | 52 |
|
54 | 53 | ##### Installing plugins previously saved in adapt.json |
55 | | - |
56 | | - adapt install |
57 | | - |
| 54 | +``` |
| 55 | +adapt install |
| 56 | +``` |
58 | 57 |
|
59 | 58 | ##### Uninstalling a plugin from your current directory |
60 | | - |
61 | | - adapt uninstall {name of plugin} |
62 | | - |
| 59 | +``` |
| 60 | +adapt uninstall {name of plugin} |
| 61 | +``` |
63 | 62 |
|
64 | 63 | The Plugin Registry |
65 | 64 | ------------------- |
66 | 65 |
|
67 | 66 | The plugin system is powered by [Bower](http://bower.io/). Each plugin should be a valid bower package and they should be registered with the Adapt registry. |
68 | | - |
69 | | - http://adapt-bower-repository.herokuapp.com/packages/ |
70 | | - |
| 67 | +``` |
| 68 | +http://adapt-bower-repository.herokuapp.com/packages/ |
| 69 | +``` |
71 | 70 | See [Developing plugins](https://github.com/adaptlearning/adapt_framework/wiki/Developing-plugins) for more information on defining your plugins package. |
72 | 71 |
|
73 | 72 | ##### Registering a plugin |
74 | 73 |
|
75 | 74 | From within a plugin directory |
76 | | - |
77 | | - adapt register |
78 | | - |
| 75 | +``` |
| 76 | +adapt register |
| 77 | +``` |
79 | 78 | `name` and `repository` will be read from `bower.json` in the current directory. |
80 | 79 |
|
81 | 80 | The package will be registered with the registry on a first come first serve basis. |
82 | 81 |
|
| 82 | +##### Unregister a plugin |
| 83 | + |
| 84 | +From within a plugin directory |
| 85 | +``` |
| 86 | +adapt unregister |
| 87 | +``` |
| 88 | +`name` will be read from `bower.json` in the current directory |
| 89 | + |
| 90 | +Alternatively, from any directory |
| 91 | +``` |
| 92 | +adapt unregister <plugin name> |
| 93 | +``` |
| 94 | +You will be prompted to authenticate with GitHub. |
| 95 | + |
| 96 | +The package will be unregistered with the registry if the authenticated user is a collaborator on the given endpoint or a collaborator on the Adapt framework. |
| 97 | + |
| 98 | +##### Rename a plugin |
| 99 | + |
| 100 | +From any directory |
| 101 | +``` |
| 102 | +adapt rename <plugin name> <new plugin name> |
| 103 | +``` |
| 104 | +You will be prompted to authenticate with GitHub. |
| 105 | + |
| 106 | +The package will be renamed if the authenticated user is a collaborator on the endpoint registered with the plugin or a collaborator on the Adapt framework. |
| 107 | + |
83 | 108 | Release History |
84 | 109 | =============== |
| 110 | +- 2.1.1 - Integrated PR 48 and fixed issue with adapt create command |
| 111 | +- 2.1.0 - Fully updated update and install commands |
| 112 | +- 2.0.7 - Added update command, rewritten install command and updated dependencies; targetting Node v8+ |
| 113 | +- 2.0.6 - Dependencies updated, registry now targeted consistently, fixed issue #49, CI target set to all Node LTS versions |
| 114 | +- 2.0.5 - Added rename and unregister commands and corrected some typos |
| 115 | +- 2.0.4 - Corrected version numbers |
| 116 | +- 2.0.3 - Fixed issue#53 - npm dependency is git url |
85 | 117 | - 2.0.2 - Fixed issue#32 - Error: Cannot find module 'Q' on case sensitive file systems |
86 | 118 | - 2.0.1 - Fixed an issue with installing dependencies (https://github.com/adaptlearning/adapt-cli/tree/hotfix/has-no-method-install) |
87 | 119 | - 2.0.0 - version bump to 2.0.0 |
|
0 commit comments