Skip to content

Commit 017d38f

Browse files
committed
feat: improve CLI development docs
1 parent c1d5f59 commit 017d38f

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

templates/cli/README.md.twig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,50 @@ $ {{ language.params.executableName }} account get --help
107107

108108
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.
109109

110+
To build and test the CLI for development, follow these steps
111+
112+
1. Clone the [SDK Generator](https://github.com/appwrite/sdk-generator)
113+
```sh
114+
$ git clone https://github.com/appwrite/sdk-generator
115+
```
116+
117+
2. Ensure that docker is running locally and then run
118+
```sh
119+
$ cd sdk-generator
120+
121+
# Install the composer dependencies
122+
$ docker run --rm --interactive --tty --volume "$(pwd)":/app composer install --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist
123+
124+
# Generate the SDKs
125+
$ docker run --rm -v $(pwd):/app -w /app php:7.4-cli php example.php
126+
```
127+
128+
3. Head over to the generated SDK and build the CLI docker image
129+
```sh
130+
$ cd examples/CLI
131+
$ docker build -t appwrite/cli .
132+
```
133+
134+
4. Install the CLI
135+
* MacOS and Linux
136+
Open `install.sh` and change [this line](https://github.com/appwrite/sdk-for-cli/blob/master/install.sh#L33) to `APPWRITE_CLI_IMAGE_VERSION=latest` and
137+
comment [these lines](https://github.com/appwrite/sdk-for-cli/blob/master/install.sh#L119-L123).
138+
139+
You can now install the CLI using
140+
```sh
141+
$ chmod +x install.sh
142+
$ ./install.sh
143+
```
144+
145+
* Windows
146+
Open `install.ps1` and change [this line](https://github.com/appwrite/sdk-for-cli/blob/master/install.ps1#L28) to `APPWRITE_CLI_IMAGE_VERSION=latest` and
147+
comment [these lines](https://github.com/appwrite/sdk-for-cli/blob/master/install.ps1#L85-L89)
148+
149+
You can now install the CLI using
150+
```sh
151+
$ ./install.ps1
152+
```
153+
110154
## License
111155

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

0 commit comments

Comments
 (0)