Getting Started User Commands Model Commands Tech Stack Commands App Commands Config Files   - App Gen   - Git   - App Options   - Publish

realMethods Command Line Interface (CLI)

The realMethods CLI gives full access to the realMethods platform, to help manage models and technology stacks to generate, commit, and archive fully functional applications.

Model support includes:

Current technology stacks support includes:

Getting Started

Installation

The realMethods CLI is stored as a packaged Node.js application, managed by npm @ npmjs.com. npm is distributed with Node.js - which means that when you download Node.js, you automatically get npm installed on your computer.

With Node.js and npm installed, you are ready to install the realMethods CLI. Issue the following on the command line.

npm install realmethods_cli

Validation

Validate the install by typing realmethods_cli. A list of commands and options should appear.

Authentication

realmethods_cli init <token>

where token is your unique token assigned when you signed up for an account at http://www.realmethods.com. It is available to copy under the API Token tab of the user preferences screen.

If you do not have a token, you will be prompted to provide one.

User Commands

User Information

user_info

Gets information about the signed in user.

Example:

To display the current user information:

realmethods_cli user_info

Model Commands

List of Models

model_list [options] [scope] [filter]

List available models.

scope: public, private, community. Empty returns all. filter: emf, sqlscript, uml, xmi, pojo, json Providing no value returns all.

Example:

To display all public models using pretty print:

realmethods_cli model_list public --output pretty

To display all your public and private models as json [default]:

realmethods_cli model_list

To display all community sql script models as json:

realmethods_cli model_list community -f sqlscript

Validate a Model

model_validate <filepath>

Validate a model for possible usage later on.

Example:

To validate a UML XMI file:

realmethods_cli model_validate ./models/myuml.xmi

Publish a Model

model_publish <yaml_file> [scope]

Publish a model to make it available to others (public) and to make it available during application generation.

Publish a model using a YAML directives. Scope: public or private[default].

Example:

To publish a model as private:

realmethods_cli model_publish ./save-my-model.ecore

To publish a model as public:

realmethods_cli model_publish ./save-my-model.ecore public

Download a Model

model_download <app_id> <output_file_path>

Download a model file. Only owned or public models can be downloaded.

Example:

To download an delete:

realmethods_cli model_download 2 ./tmp/archive/mymodel.xmi'

Promote a Model

Any private model you own can be promoted to public. Making it public allows it to be accessed by the community.

model_promote <id>

Promote an owned model from private scope to public. Promotion cannot be undone. Confirmation is required

Example:

To promote a model from being private to public, referenced by id=1000:

realmethods_cli model_promote 1000

Delete a Model

model_delete <id>

Delete a model. Can only delete an owned private model. Deletion cannot be undone.

Example:

To delete a model referenced by id=12, prompted to confirm:

realmethods_cli model_delete 12

Technology Stack Commands

List of Technology Stacks

stack_list [options] [scope] [filter]

List available tech stacks. Scope: public, private, community Filter: serverless, webapp, restfulapi, mobile Default returns all of yours.

Example:

To display all your public tech stacks using pretty print:

realmethods_cli stack_list private --output pretty

To display all your serverless type tech stacks as json

realmethods_cli stack_list -f serverless

Download a Technology Stack's Options

stack_options <id>

Available stack application options, modifiable to allow customization of a generated application. Download as JSON and provide as JSON during application generation.

Example:

To download the application options for the associated technology stack piped into a file as JSON with output turn to quiet:

realmethods_cli stack_options --quiet true 1 > app.options.json

Validate a Technology Stack

stack_validate <filepath>

Validates the structure and contents of a technology stack as (ZIP file). Download an existing technology stack to view its contents to understand what is required.

Example:

To validate a technology stack ZIP file:

realmethods_cli stack_validate './samples/techstacks/AWS_Lambda_RDS_Modified.zip'

Publish a Technology Stack

stack_publish <yaml_file> [scope]

Publish a technology stack to make it available to others (public) and to make it available during application generation.

Publish a stack using YAML directives. Scope: public or private [default].

A published stack is first validated and if found to be valid it is persisted.

Example:

To publish a technology stack as public:

realmethods_cli stack_publish ./yamls/save-my-techstack.yml public'

Download a Technology Stack

stack_download <stack_id> <output_file_path>

Download a technology stack as a ZIP file. Only owned or public stacks can be downloaded.

If interested in creating and publishing a technology stack, it is best to first try to locate and download an existing technology stack that closest meets your requirements.

Example:

To download a technology stack referenced by id=15:

realmethods_cli stack_download 15 ./tmp/archive/mystack.zip'

stack_delete <id>

Delete a technology stack. Can only delete an owned private technology stack. Confirmation is required.

Example:

To delete a tech stack referenced by id=256:

realmethods_cli stack_delete 256

Promote a Technology Stack

stack_promote <id>

Promote an owned technology stack from private scope to public. Making it public gives it community access.

Promotion cannot be undone. Confirmation is required.

Example:

To promote a tech stack referenced by id=24:

realmethods_cli stack_promote 24

Application Commands

Generate 1 or More Applications

apps_generate <yaml_file>

Generates an application using the directives of a YAML file. This YAML files contains the application directives including a model identifier, technology stack identifier, GitHub options and more.

Example:

To generate an application using the directives of a YAML file:

realmethods_cli app_generate ./samples/yamls/generate-django.yml

To generate an application overriding certain directives of an app generation YAML file: