Skip to content
Chuck Lorenz edited this page Dec 21, 2015 · 50 revisions

Adapt Command Line Interface

Build Status Join the chat at https://gitter.im/adaptlearning/adapt-cli

The Adapt CLI is a command line interface required to run the Adapt Framework and the Adapt Authoring Tool.

Installation

Before installing the Adapt CLI, you must install NodeJS and git.
To install the Adapt CLI globally, run the following command:

npm install -g adapt-cli

Some systems may require elevated permissions in order to install a script globally.

Commands

adapt create

#####Model:
adapt create {type} {path} [{branch}]

type: What to create. Acceptable values are course and component.
path: The directory of the new course. Enclose in quotes if the path/name includes spaces.
branch: The branch of the framework to be downloaded. This is optional. If not specified, the master branch will be used.

#####Examples:

  1. To create an Adapt course (do not use in conjunction with the Adapt authoring tool):
    adapt create course "My Course"
    This will create a new directory named "My Course" in your current working directory. It will download the Adapt framework from its master branch, including the default course, into the new directory. Before using the course, run:
    grunt build

  2. To create an Adapt course from a specific branch:
    adapt create course "My Course" develop
    This is the same as example 1 except that the framework will be downloaded from its develop branch. This can be useful for development. It is not recommended for use in production.

  3. To create an empty component:
    adapt create component "test-component"
    This command is useful for developing new components. It will create a new directory named "test-component" in the current working directory. It will populate the directory with files required for an Adapt component and insert "test-component" into the code where required.

adapt search

#####Model:
adapt search {plug-in}

plug-in: The name of the plug-in that you want to search for. Any part of the name may be used; multiple results may be returned if the part is not unique. The search will return the plug-in's complete name and its source repository if the plug-in is located within the registry. Search is conducted within the registry only.

#####Examples:

  1. To view the name and repository of all registered plug-ins:
    adapt search
  2. To locate the repository of a known plug-in that is registered:
    adapt search adapt-contrib-pageLevelProgress OR
    adapt search contrib-pageLevelProgress OR
    adapt search pageLevel

adapt install

#####Model:
adapt install {plug-in}[#{version}]

plug-in: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.
version: A specific version number of the plug-in. This is optional.

#####Examples:

  1. To install a registered plug-in:
    adapt install adapt-contrib-pageLevelProgress OR
    adapt install contrib-pageLevelProgress

  2. To install a specific version of a registered plug-in:
    adapt install adapt-contrib-pageLevelProgress#1.1.0 OR
    adapt install contrib-pageLevelProgress#1.1.0

  3. To install a plug-in that is not registered:

    1. Copy the uncompressed folder to the proper location for the type of plug-in. Components: src/components. Extensions: src/extensions. Menu: src/menu. Theme: src/theme. Note: The Adapt framework allows only one theme and one menu at a time. Uninstall the current before replacing it with an alternative.
    2. Open adapt.json in an editor and add the full name of the new component to the list.
    3. Run the following command from the course root:
      adapt install
  4. To update plug-ins to their most recent public release:
    adapt install
    Since no plug-in name is specified in this command, all plug-ins listed in adapt.json are reinstalled. If the list includes a plug-in that is not registered, it will not be reinstalled.

adapt ls

#####Command:
adapt ls

This command shows the name and required version of all Adapt plug-ins installed in the current directory.

adapt uninstall

#####Model:
adapt uninstall {plug-in}

plug-in: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.

#####Examples:

  1. To install a plug-in:
    adapt uninstall adapt-contrib-pageLevelProgress OR
    adapt uninstall contrib-pageLevelProgress
    Because the registry is not referenced during the uninstall process, this command will work whether or not the plug-in is registered.

adapt register

#####Command:
adapt register

The preceding command must be run from within the root directory of the plug-in you want to register. "name" and "repository" will be read from bower.json in the current directory. Plug-in names will be accepted by the registry on a "first come, first served" basis.

The Plug-in Registry

The plug-in system is powered by Bower. Each plug-in should be a valid bower package and registered with the Adapt registry.

http://adapt-bower-repository.herokuapp.com/packages/

See Developing plug-ins for more information on defining your plug-in's package.

Release History

  • 2.0.2 - Fixed issue#32 - Error: Cannot find module 'Q' on case sensitive file systems
  • 2.0.1 - Fixed an issue with installing dependencies (https://github.com/adaptlearning/adapt-cli/tree/hotfix/has-no-method-install)
  • 2.0.0 - version bump to 2.0.0
  • 0.0.24 - Pre v2.0.0 release update
  • 0.0.23 - Updated NPM Module's version.
  • 0.0.22 - Added the 'ls' command.
  • 0.0.21 - Fixed an issue where the new slug library does not maintain case.
  • 0.0.19 - Removed slug library due to annoying python dependency, added 'create component' command.
  • 0.0.18 - Fixed Issue #23
  • 0.0.17 - Added extra check current working directory for installing. See Issue #23
  • 0.0.16 - Improved download progress bar; fixed dependency of the download package to a fork to avoid version conflict with decompress package. This should be temporary until the conflict is resolved.
  • 0.0.15 - fixed Issue #22
  • 0.0.14 - fixed Issue #15
  • 0.0.13 - Added support for versions of plugins (#14) and --version command
  • 0.0.12 - fixed Issue #13
  • 0.0.11 - fixed Issue #12 <a href="https://community.adaptlearning.org/ target="_blank">adapt learning logo
  • 0.0.10 - fixed Issue #2 & #8
  • 0.0.9 - fixed Issue #7
  • 0.0.8 - Added 'create' command, fixed Issue #6
  • 0.0.7 - fixed Issue #3
  • 0.0.6 - Added 'register' command
  • 0.0.5 - Added adapt.json (dependency list)
  • 0.0.3 - Added uninstall command ...

Clone this wiki locally