Skip to content

Commit 211b5e9

Browse files
committed
refactor in progress
1 parent ecfc199 commit 211b5e9

File tree

530 files changed

+39518
-31711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+39518
-31711
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
build/
3-
.DS_Store
3+
.DS_Store
4+
dist/

CHANGELOG.md

Lines changed: 102 additions & 102 deletions
Large diffs are not rendered by default.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Redistribution and use in source and binary forms, with or without modification,
99

1010
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

12-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Appwrite is an open-source backend as a service server that abstract and simplif
1717
The Appwrite CLI is a Node based command line tool to help you interact with the Appwrite API. The CLI is distributed both as an [`npm package`](https://www.npmjs.com/package/appwrite-cli) as well as [pre built binaries](https://github.com/appwrite/sdk-for-cli/releases/latest) for specific operating systems and architectures.
1818

1919
### Install using NPM
20+
2021
---
2122

2223
If you have `npm` installed, it's as easy as running
@@ -33,84 +34,95 @@ $ appwrite -v
3334
```
3435

3536
### Install using prebuilt binaries
37+
3638
---
3739

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

4042
### Linux / MacOS Terminal
43+
4144
```bash
4245
$ wget -q https://appwrite.io/cli/install.sh -O - | /bin/bash
4346
```
4447

4548
### MacOS via [Homebrew](https://brew.sh)
49+
4650
```bash
47-
$ brew install appwrite
51+
$ brew install appwrite
4852
```
4953

5054
### Windows
55+
5156
Via Powershell
57+
5258
```powershell
5359
$ iwr -useb https://appwrite.io/cli/install.ps1 | iex
5460
```
61+
5562
Via [Scoop](https://scoop.sh)
63+
5664
```powershell
5765
$ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/scoop/appwrite.config.json
5866
```
5967

6068
Once the installation completes, you can verify your install using
69+
6170
```
6271
$ appwrite -v
6372
13.0.0-rc.2
6473
```
6574

66-
## Getting Started
75+
## Getting Started
6776

68-
Before you can use the CLI, you need to login to your Appwrite account.
77+
Before you can use the CLI, you need to login to your Appwrite account.
6978

7079
```sh
7180
$ appwrite login
7281

7382
? Enter your email [email protected]
7483
? Enter your password ********
75-
✓ Success
84+
✓ Success
7685
```
77-
This will also prompt you to enter your Appwrite endpoint ( default: http://localhost/v1 )
7886

79-
* ### Initialising your project
80-
Once logged in, the CLI needs to be initialised before you can use it with your Appwrite project. You can do this with the `appwrite init project` command.
87+
This will also prompt you to enter your Appwrite endpoint ( default: http://localhost/v1 )
88+
89+
- ### Initialising your project
90+
Once logged in, the CLI needs to be initialised before you can use it with your Appwrite project. You can do this with the `appwrite init project` command.
8191

8292
```sh
8393
$ appwrite init project
8494
```
8595

8696
The following prompt will guide you through the setup process. The `init` command also creates an `appwrite.json` file representing your Appwrite project.
8797

88-
The `appwrite.json` file does a lot of things.
89-
* Provides context to the CLI
90-
* Keeps track of all your cloud functions
91-
* Keeps track of all your project's collections
92-
* Helps you deploy your Appwrite project to production and more..
98+
The `appwrite.json` file does a lot of things.
99+
100+
- Provides context to the CLI
101+
- Keeps track of all your cloud functions
102+
- Keeps track of all your project's collections
103+
- Helps you deploy your Appwrite project to production and more..
93104

94105
You can also fetch all the collections in your current project using
106+
95107
```sh
96108
appwrite init collection
97109
```
98110

99-
* ### Creating and deploying cloud functions
111+
- ### Creating and deploying cloud functions
100112

101113
The CLI makes it extremely easy to create and deploy Appwrite's cloud functions. Initialise your new function using
102114

103115
```
104116
$ appwrite init function
105117
? What would you like to name your function? My Awesome Function
106118
? What runtime would you like to use? Node.js (node-15.5)
107-
✓ Success
119+
✓ Success
108120
```
109121

110122
This will create a new function `My Awesome Function` in your current Appwrite project and also create a template function for you to get started.
111123

112124
```sh
113-
$ tree My\ Awesome\ Function
125+
$ tree My\ Awesome\ Function
114126

115127
My Awesome Function
116128
├── README.md
@@ -121,7 +133,7 @@ My Awesome Function
121133
0 directories, 4 files
122134
```
123135

124-
You can now deploy this function using
136+
You can now deploy this function using
125137

126138
```sh
127139
$ appwrite push function
@@ -133,50 +145,56 @@ $ appwrite push function
133145

134146
Your function has now been deployed on your Appwrite server! As soon as the build process is finished, you can start executing the function.
135147

136-
* ### Deploying Collections
148+
- ### Deploying Collections
137149

138-
Similarly, you can deploy all your collections to your Appwrite server using
150+
Similarly, you can deploy all your collections to your Appwrite server using
139151

140152
```sh
141153
appwrite push collections
142154
```
143155

144156
> ### Note
157+
>
145158
> By default, requests to domains with self signed SSL certificates (or no certificates) are disabled. If you trust the domain, you can bypass the certificate validation using
159+
146160
```sh
147161
$ appwrite client --selfSigned true
148162
```
149163

150-
## Usage
164+
## Usage
151165

152166
The Appwrite CLI follows the following general syntax.
167+
153168
```sh
154169
$ appwrite [COMMAND] --[OPTIONS]
155170
```
156171

157-
A few sample commands to get you started
172+
A few sample commands to get you started
158173

159174
```sh
160175
$ appwrite users create --userId "unique()" --email [email protected] --password very_strong_password
161-
$ appwrite users list
176+
$ appwrite users list
162177
```
163178

164-
To create a document you can use the following command
179+
To create a document you can use the following command
180+
165181
```sh
166182
$ appwrite databases create-document --database-id <DATABASE_ID> --collection-id <COLLECTION_ID> --document-id "unique()" --data '{"name": "Walter O Brein"}' --permissions 'read("any")' 'read("team:abc")'
167183
```
168184

169185
### Some Gotchas
186+
170187
- `data` must be a valid JSON string where each key and value are enclosed in double quotes `"` like the example above.
171188
- Some arguments like the `read` and `write` permissions are expected to be arrays. In the Appwrite CLI, array values are passed in using space as a separator like in the example above.
172189

190+
To get information about the different services available, you can use
173191

174-
To get information about the different services available, you can use
175192
```sh
176193
$ appwrite -h
177194
```
178195

179-
To get information about a particular service and the commands available in a service you can use
196+
To get information about a particular service and the commands available in a service you can use
197+
180198
```sh
181199
$ appwrite users // or
182200
$ appwrite users --help // or
@@ -188,7 +206,7 @@ To get information about a particular command and the parameters it accepts, you
188206

189207
```sh
190208
$ appwrite users list --help
191-
$ appwrite account get --help
209+
$ appwrite account get --help
192210
```
193211

194212
At any point, you can view or reset the CLI configuration using the `client` service.
@@ -201,48 +219,53 @@ $ appwrite client --reset
201219

202220
## CI mode
203221

204-
The Appwrite CLI can also work in a CI environment. The initialisation of the CLI works a bit differently in CI. In CI, you set your `endpoint`, `projectId` and `API Key` using
222+
The Appwrite CLI can also work in a CI environment. The initialisation of the CLI works a bit differently in CI. In CI, you set your `endpoint`, `projectId` and `API Key` using
205223

206224
```sh
207225
appwrite client --endpoint http://localhost/v1 --projectId <PROJECT_ID> --key <API KEY>
208226
```
209227

210-
211228
## Contribution
212229

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

215-
To build and test the CLI for development, follow these steps
232+
To build and test the CLI for development, follow these steps
216233

217234
1. Clone the SDK Generator repository and cd into the directory
235+
218236
```sh
219237
$ git clone https://github.com/appwrite/sdk-generator
220238
$ cd sdk-generator
221239
```
222240

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

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

231250
3. Head over to the generated SDK and install the dependencies.
251+
232252
```sh
233253
$ cd examples/cli
234-
$ npm install
254+
$ npm install
235255
```
236256

237-
4. Install the CLI using
257+
4. Install the CLI using
258+
238259
```sh
239260
$ npm install -g .
240261
```
241262

242-
5. You can now use the CLI
263+
5. You can now use the CLI
264+
243265
```sh
244266
$ appwrite -v
245267
```
268+
246269
## License
247270

248271
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

0 commit comments

Comments
 (0)