# {{ spec.title }} {{sdk.name}} SDK

![License](https://img.shields.io/github/license/{{ sdk.gitUserName|url_encode }}/{{ sdk.gitRepoName|url_encode }}.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-{{ spec.version|url_encode }}-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/{{ sdk.gitUserName|url_encode }}/sdk-generator?style=flat-square)](https://travis-ci.com/{{ sdk.gitUserName|url_encode }}/sdk-generator)
{% if sdk.twitterHandle %}
[![Twitter Account](https://img.shields.io/twitter/follow/{{ sdk.twitterHandle }}?color=00acee&label=twitter&style=flat-square)](https://twitter.com/{{ sdk.twitterHandle }})
{% endif %}
{% if sdk.discordChannel %}
[![Discord](https://img.shields.io/discord/{{ sdk.discordChannel }}?label=discord&style=flat-square)]({{ sdk.discordUrl }})
{% endif %}
{% if sdk.warning %}

{{ sdk.warning }}
{% endif %}

{{ sdk.description }}

{% if sdk.logo %}
![{{ spec.title }}]({{ sdk.logo }})
{% endif %}

## Installation

The {{ spec.title }} CLI is a Node based command line tool to help you interact with the {{ spec.title }} API. The CLI is distributed both as an [`npm package`](https://www.npmjs.com/package/{{ spec.title|caseLower }}-cli) as well as [pre built binaries](https://github.com/{{ sdk.gitUserName|url_encode }}/{{ sdk.gitRepoName|url_encode }}/releases/latest) for specific operating systems and architectures.

### Install using NPM
---

If you have `npm` installed, it's as easy as running

```sh
$ npm install -g {{ language.params.npmPackage }}
```

Once the installation is complete, you can verify the install using

```sh
$ {{ language.params.executableName|caseLower }} -v
{{ sdk.version }}
```

### Install using prebuilt binaries
---

If you do not have `npm` installed, you can always install the prebuilt binaries for your architecture and OS using our convenient installation scripts.

### Linux / MacOS Terminal
```bash
$ wget -q {{ sdk.url }}/cli/install.sh  -O - | /bin/bash
```

### MacOS via [Homebrew](https://brew.sh)
```bash
$ brew install {{ language.params.executableName }} 
```

### Windows
Via Powershell
```powershell
$ iwr -useb {{ sdk.url }}/cli/install.ps1 | iex
```
Via [Scoop](https://scoop.sh)
```powershell
$ scoop install https://raw.githubusercontent.com/{{ sdk.gitUserName }}/{{ sdk.gitRepoName | caseDash }}/master/scoop/appwrite.json
```

Once the installation completes, you can verify your install using
```
$ {{ language.params.executableName|caseLower }} -v
{{ sdk.version }}
```

{% if sdk.gettingStarted %}
{{ sdk.gettingStarted|raw }}
{% endif %}

## Contribution

This library is auto-generated by {{ spec.title | caseUcfirst }} custom [SDK Generator](https://github.com/{{ spec.title | lower }}/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/{{ spec.title | lower }}/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.

To build and test the CLI for development, follow these steps 

1. Clone the SDK Generator repository and cd into the directory
```sh
$ git clone https://github.com/{{ spec.title | lower }}/sdk-generator
$ cd sdk-generator
```

2. Ensure Docker is running locally and then install the composer dependencies using
```sh 
$ docker run --rm --interactive --tty --volume "$(pwd)":/app composer install --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist

# Generate the SDKs
$ docker run --rm -v $(pwd):/app -w /app php:8.1-cli php example.php
```

3. Head over to the generated SDK and install the dependencies.
```sh
$ cd examples/cli
$ npm install 
```

4. Install the CLI using 
```sh
$ npm install -g .
```

5. You can now use the CLI 
```sh
$ {{ language.params.executableName|caseLower }} -v
```
## License

Please see the [{{spec.licenseName}} license]({{spec.licenseURL}}) file for more information.
