# Woodford CLI

The official CLI of Woodford.

### About

Woodford CLI is command line tool which allows to manipulate with projects on remote RescoCloud or Dynamics Server.
It provides a flexible set of commands for developers to increase speed when deploying Woodford projects.

### How to install

Install CLI globally, run the following command.

```
npm install -g @resconet/woodford-cli
```

You can now run CLI by typing wf-cli at the command line!

```
wf-cli
```

To uninstall CLI, run the following command.

```
npm uninstall -g @resconet/woodford-cli
```

### Available Commands

```
  --help             Show help                                          [boolean]
  --version          Show version number                                [boolean]
  -u, --url          Organization url                                   [string]
  -l, --login        Login                                              [string]
  -p, --password     Password                                           [string]
  -c, --command      Command:
                      [login | logout | list | export | import |
                      create | publish | delete | roles] project        [string] [required]
  -n, --name         Project name                                       [string]
  -f, --file         Path to file                                       [string]
  -v, --validate     Validate published project                         [boolean]
  -r, --properties   Command properties
                     - Create: 'priority;role1,role2,..;appid;version'  [string]
  -d, --dynamicscrm  Dynamics CRM backend                               [boolean]
  -a, --clientid      Client ID                                         [string]
  -s, --clientsecret  Client Secret                                     [string]
```

### Usage

Login:

```
Device code flow:
wf-cli -c login -u https://<server>.crm.dynamics.com -l user@example.com

Client credentials:
wf-cli -c login -u https://<server>.crm.dynamics.com -a <client_id> -s <client_secret>
```

Logout:

```
wf-cli -c logout
```

List projects:

```
wf-cli -c list
```

Create project:

```
wf-cli -c create -n <project_name> -r "priority;role1,role2,...;appid;version"

wf-cli -c create -n "Default Project" -r "10;System Administrator,Service Technician,Salesperson;Default;Ver 1.0"

wf-cli -c create -n "My First Project" -r "1;System Administrator,Sales Person;My First App;v1.0"
```

Import project:

```
wf-cli -c import -n <project_name> -f project.woodford
```

Export project:

```
wf-cli -c export -n <project_name> -f project.woodford
```

Publish project:

```
wf-cli -c publish -n <project_name> [-v]
```
