# marjory-cli

> marjory CLI

Latest version **4.0.13** (published 2024-10-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install marjory-cli
pnpm add marjory-cli
yarn add marjory-cli
bun add marjory-cli
```

Provides the command `marjory`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.13 |
| Published | 2024-10-01 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 36 |
| Unpacked size | 377 KB |
| Known vulnerabilities | 0 (+10 in 3 direct dependencies) |
| Install scripts | no |
| Maintainers | partners-marjory |

## Links

- npm: https://www.npmjs.com/package/marjory-cli
- npm.io page: https://npm.io/package/marjory-cli

## Dependencies (36)

- [ajv](https://npm.io/package/ajv.md) ^8.12.0
- [eta](https://npm.io/package/eta.md) ^3.4.0
- [ora](https://npm.io/package/ora.md) ^7.0.1
- [open](https://npm.io/package/open.md) ^9.1.0
- [yaml](https://npm.io/package/yaml.md) 1.10.2
- [axios](https://npm.io/package/axios.md) ^1.4.0
- [chalk](https://npm.io/package/chalk.md) ^5.3.0
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.9
- [execa](https://npm.io/package/execa.md) ^7.2.0
- [grant](https://npm.io/package/grant.md) ^5.4.21
- [yargs](https://npm.io/package/yargs.md) 16.2.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [semver](https://npm.io/package/semver.md) ^7.5.4
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.5.5
- [express](https://npm.io/package/express.md) ^4.17.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [marjory](https://npm.io/package/marjory.md) 3.0.10
- [mongodb](https://npm.io/package/mongodb.md) ^6.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [inquirer](https://npm.io/package/inquirer.md) ^9.2.10
- [json2yaml](https://npm.io/package/json2yaml.md) ^1.1.0
- [md-2-json](https://npm.io/package/md-2-json.md) ^2.0.0
- [node-watch](https://npm.io/package/node-watch.md) ^0.7.4
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.15.0
- [async-retry](https://npm.io/package/async-retry.md) ^1.3.3
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) 7.14.0
- [express-session](https://npm.io/package/express-session.md) ^1.17.3
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.15.0
- [inquirer-fuzzy-path](https://npm.io/package/inquirer-fuzzy-path.md) ^2.3.0
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.15.8
- [@apidevtools/swagger-parser](https://npm.io/package/@apidevtools/swagger-parser.md) ^10.1.0
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.15.0
- [inquirer-autocomplete-standalone](https://npm.io/package/inquirer-autocomplete-standalone.md) ^0.8.1
- [inquirer-file-tree-selection-prompt](https://npm.io/package/inquirer-file-tree-selection-prompt.md) ^2.0.5

## Recent versions

- 4.0.13 (latest) — 2024-10-01
- 4.2.2-beta.32 (beta) — 2024-10-30
- 4.2.1-beta.32 — 2024-10-17
- 4.2.0-beta.32 — 2024-10-07
- 4.0.12 — 2024-10-01
- 4.1.0-beta.32 — 2024-09-11
- 4.0.13-beta.32 — 2024-08-27
- 4.0.12-beta.32 — 2024-07-17
- 4.0.11-beta.32 — 2024-06-28
- 4.0.11 — 2024-06-21
- 4.0.10 — 2024-06-21
- 4.0.9 — 2024-06-21
- 4.0.8 — 2024-06-21
- 4.0.7 — 2024-06-21
- 4.0.6 — 2024-06-21
- … 70 more at https://npm.io/package/marjory-cli/versions

## README

# Marjory CLI

This package is a CLI tool to help you to manage your Marjory applications.

## Create a new application - Instructions for end users

Here is the typical process an end user will follow to create a new application with the CLI :

1. Install the CLI tool globally: `npm i -g marjory-cli`
2. Create the app from marjory (https://app.marjory.io) in the section `Custom Extensions` -> `+ Add New` button
3. Login to marjory through the CLI with `marjory login`
4. Initialize a new Marjory application: `marjory init`
   * Select the tenant you have used to create the appliacation
   * From there you can select you application
5. Edit the `deployment.yml` file to configure this application
6. Configure the installation variables using the `marjory configure`
    * Any variables configured is locally stored : `~/.marjory/<YOUR_APP_NAME>.json`
7. Run the application locally using the `marjory local` command
8.  Implement you application and test it locally
9.  Deploy the application using the `marjory deploy` command
10. Test the application inside the Marjory environment
11. Promote the application to the `latest` version using the `marjory promote`


## Update an existing application - Instructions for end users

Here is the typical process an end user will follow to update or deploy an existing application :

1. Install the CLI tool globally: `npm i -g marjory-cli@beta`
2. Retrieve the source code of your application (git clone from gitlab for example)
3. Update the application as needed
4. Make sure that the application slug in the package.json match with the application you want to update or deploy
4. Deploy the application using the `marjory deploy` command
5. Test the application inside the Marjory environment
6. Promote the application to the `latest` version using the `marjory promote`

## List of commands

- [marjory init](#marjory-init): Initialize a new Marjory application
- [marjory configure](#marjory-configure): Configure a Marjory application when runned locally
- [marjory local](#marjory-local): Run a Marjory application locally
- [marjory login](#marjory-login): Login to a Marjory application
- [marjory deploy](#marjory-deploy): Deploy a Marjory application
- [marjory promote](#marjory-promote): Promote a Marjory application
- [marjory logout](#marjory-logout): Logout from a Marjory application
- [marjory oauth](#marjory-oauth): Init a new OAuth process to retrieve an access token

### `marjory init`

This command will initialize a new Marjory application based on the template stored in the `src/new_app_template` folder.

If we want to update the template, all changes must be done in this folder.

If we want to update the dependencies' versions, we must update the `package.json` file inside the `src/new_app_template` folder.

### `marjory configure`

This command will configure the installation variables for a Marjory application. An interactive prompt will ask you to enter the values for each variable, based on the `deployment.yml` file.

If you have configured an OAuth 2 variable, this command will automatically open a browser window to start the OAuth process.

All settings will be saved locally in the `$HOMEDIR/.marjory` folder.

### `marjory local`

This command will run a Marjory application locally. All functions and webhooks will be detected and displayed in the console. If you don't see a freshly created function or webhook, you can check your `deployment.yml` file to make sure it's correctly configured.

You can keep this command running while you're developing your application. If you make any change to your code, the application will be automatically reloaded.

### `marjory login`

This command will login to a Marjory application. It'll ask you to enter your email and password. Then, it'll retrieve an access token and save it locally.

All credentials are saved locally in the `$HOMEDIR/.marjory` folder.

### `marjory logout`

This command will logout from a Marjory application. It'll delete all credentials saved locally.

### `marjory deploy`

This command will deploy a Marjory application. It'll check the current version of the app and the one from your local `deployment.yml`. If a current `latest` version exist it will offer you to upgrade your version following the semver standart. This version will be available for testing only and will need to be promoted to be accessible by your users.

### `marjory promote`

This command will promote a Marjory application. It will make your current selected version as the `latest`. This version will be available for your users.

### `marjory oauth`

It's better to use the `marjory configure` command to configure an OAuth 2 variable. This command is only useful if you want to test an OAuth configuration locally.

To test an OAuth configuration locally, configure the OAuth app inside your `deployment.yml` file and then run the following command:

```
marjory oauth --name [OAuth config name]
```

This command line will verify your OAuth configuration and init a new OAuth authorization process in order to retrieve the `access_token`.

All tokens will be saved locally and the command can be run again: it'll return you the `access_token` or will renew it for you. If the token has expired and can't be renewed, the old token will be deleted and the OAuth process will start again.

You can delete manually the cache by cleaning the `$HOMEDIR/.marjory/oauth` folder or using the following command:

```
marjory oauth --name [OAuth config name] --clean
```

## Local development

install the CLI globally
type `node index.js`, the list of commands available
Ideally, put the project in a cli-workspace directory, open it from vscode and enter `node factory-cli/index.js` in the terminal

### NPM Link

To use this package in dev, we must use `npm link`

Inside this application, run the following command:

```
npm link
```

Then, inside the app you want to use this package, make sure to change de devDependencies from `marjory-cli` to `@marjory/factory-cli` and then run the following command:

```
npm link @marjory/factory-cli
```

---
_Source: https://npm.io/package/marjory-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
