@canva/cli 0.0.1-beta.3 → 0.0.1-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +218 -104
- package/cli.js +661 -394
- package/lib/cjs/index.cjs +5 -0
- package/lib/esm/index.mjs +5 -0
- package/package.json +19 -4
- package/templates/base/eslint.config.mjs +2 -27
- package/templates/base/package.json +31 -25
- package/templates/base/scripts/copy_env.ts +10 -0
- package/templates/base/scripts/start/app_runner.ts +39 -2
- package/templates/base/scripts/start/context.ts +12 -6
- package/templates/base/scripts/start/start.ts +11 -0
- package/templates/base/scripts/start/tests/start.tests.ts +61 -0
- package/templates/base/{webpack.config.cjs → webpack.config.ts} +46 -46
- package/templates/common/.cursor/mcp.json +8 -0
- package/templates/common/.gitignore.template +5 -6
- package/templates/common/.nvmrc +1 -0
- package/templates/common/.prettierrc +21 -0
- package/templates/common/.vscode/extensions.json +6 -0
- package/templates/common/.vscode/mcp.json +9 -0
- package/templates/common/README.md +4 -7
- package/templates/common/jest.config.mjs +29 -2
- package/templates/common/jest.setup.ts +20 -0
- package/templates/common/utils/backend/base_backend/create.ts +104 -0
- package/templates/common/utils/backend/jwt_middleware/index.ts +1 -0
- package/templates/common/utils/backend/jwt_middleware/jwt_middleware.ts +229 -0
- package/templates/common/utils/backend/jwt_middleware/tests/jwt_middleware.tests.ts +630 -0
- package/templates/common/utils/table_wrapper.ts +477 -0
- package/templates/common/utils/tests/table_wrapper.tests.ts +252 -0
- package/templates/common/utils/use_add_element.ts +48 -0
- package/templates/common/utils/use_feature_support.ts +28 -0
- package/templates/common/utils/use_overlay_hook.ts +74 -0
- package/templates/common/utils/use_selection_hook.ts +37 -0
- package/templates/dam/backend/routers/dam.ts +23 -19
- package/templates/dam/eslint.config.mjs +2 -28
- package/templates/dam/package.json +43 -39
- package/templates/dam/scripts/copy_env.ts +10 -0
- package/templates/dam/scripts/start/app_runner.ts +39 -2
- package/templates/dam/scripts/start/context.ts +12 -6
- package/templates/dam/scripts/start/start.ts +11 -0
- package/templates/dam/scripts/start/tests/start.tests.ts +61 -0
- package/templates/dam/src/app.tsx +24 -3
- package/templates/dam/src/config.ts +212 -87
- package/templates/{hello_world/webpack.config.cjs → dam/webpack.config.ts} +46 -46
- package/templates/data_connector/README.md +84 -0
- package/templates/data_connector/declarations/declarations.d.ts +29 -0
- package/templates/data_connector/eslint.config.mjs +14 -0
- package/templates/data_connector/package.json +91 -0
- package/templates/data_connector/scripts/copy_env.ts +10 -0
- package/templates/data_connector/scripts/ssl/ssl.ts +131 -0
- package/templates/data_connector/scripts/start/app_runner.ts +201 -0
- package/templates/data_connector/scripts/start/context.ts +171 -0
- package/templates/data_connector/scripts/start/start.ts +46 -0
- package/templates/data_connector/scripts/start/tests/start.tests.ts +61 -0
- package/templates/data_connector/src/api/connect_client.ts +6 -0
- package/templates/data_connector/src/api/data_source.ts +96 -0
- package/templates/data_connector/src/api/data_sources/designs.tsx +296 -0
- package/templates/data_connector/src/api/data_sources/index.ts +4 -0
- package/templates/data_connector/src/api/data_sources/templates.tsx +329 -0
- package/templates/data_connector/src/api/fetch_data_table.ts +55 -0
- package/templates/data_connector/src/api/index.ts +4 -0
- package/templates/data_connector/src/api/oauth.ts +8 -0
- package/templates/data_connector/src/api/tests/data_source.test.tsx +99 -0
- package/templates/data_connector/src/app.tsx +20 -0
- package/templates/data_connector/src/components/app_error.tsx +15 -0
- package/templates/data_connector/src/components/footer.tsx +26 -0
- package/templates/data_connector/src/components/header.tsx +40 -0
- package/templates/data_connector/src/components/index.ts +3 -0
- package/templates/data_connector/src/components/inputs/messages.tsx +99 -0
- package/templates/data_connector/src/components/inputs/search_filter.tsx +108 -0
- package/templates/data_connector/src/components/inputs/select_field.tsx +26 -0
- package/templates/data_connector/src/context/app_context.tsx +124 -0
- package/templates/data_connector/src/context/index.ts +2 -0
- package/templates/data_connector/src/context/use_app_context.ts +17 -0
- package/templates/data_connector/src/entrypoint.tsx +70 -0
- package/templates/data_connector/src/home.tsx +21 -0
- package/templates/data_connector/src/index.tsx +69 -0
- package/templates/data_connector/src/pages/data_source_config.tsx +9 -0
- package/templates/data_connector/src/pages/error.tsx +37 -0
- package/templates/data_connector/src/pages/index.ts +4 -0
- package/templates/data_connector/src/pages/login.tsx +145 -0
- package/templates/data_connector/src/pages/select_source.tsx +24 -0
- package/templates/data_connector/src/routes/index.ts +2 -0
- package/templates/data_connector/src/routes/protected_route.tsx +25 -0
- package/templates/data_connector/src/routes/routes.tsx +46 -0
- package/templates/data_connector/src/utils/data_params.ts +17 -0
- package/templates/data_connector/src/utils/data_table.ts +115 -0
- package/templates/data_connector/src/utils/fetch_result.ts +36 -0
- package/templates/data_connector/src/utils/index.ts +2 -0
- package/templates/data_connector/src/utils/tests/data_table.test.ts +133 -0
- package/templates/data_connector/styles/components.css +38 -0
- package/templates/data_connector/tsconfig.json +54 -0
- package/templates/{gen_ai/webpack.config.cjs → data_connector/webpack.config.ts} +46 -46
- package/templates/gen_ai/README.md +1 -40
- package/templates/gen_ai/backend/routers/image.ts +11 -11
- package/templates/gen_ai/backend/server.ts +0 -7
- package/templates/gen_ai/eslint.config.mjs +2 -27
- package/templates/gen_ai/package.json +48 -42
- package/templates/gen_ai/scripts/copy_env.ts +10 -0
- package/templates/gen_ai/scripts/start/app_runner.ts +39 -2
- package/templates/gen_ai/scripts/start/context.ts +12 -6
- package/templates/gen_ai/scripts/start/start.ts +11 -0
- package/templates/gen_ai/scripts/start/tests/start.tests.ts +61 -0
- package/templates/gen_ai/src/api/api.ts +24 -79
- package/templates/gen_ai/src/app.tsx +16 -10
- package/templates/gen_ai/src/components/footer.messages.ts +0 -5
- package/templates/gen_ai/src/components/footer.tsx +7 -25
- package/templates/gen_ai/src/components/index.ts +0 -1
- package/templates/gen_ai/src/components/loading_results.tsx +4 -8
- package/templates/gen_ai/src/components/tests/remaining_credit.tests.tsx +43 -0
- package/templates/gen_ai/src/context/app_context.tsx +5 -33
- package/templates/gen_ai/src/context/context.messages.ts +1 -12
- package/templates/gen_ai/src/home.tsx +13 -0
- package/templates/gen_ai/src/index.tsx +2 -18
- package/templates/gen_ai/src/routes/routes.tsx +2 -2
- package/templates/{dam/webpack.config.cjs → gen_ai/webpack.config.ts} +46 -46
- package/templates/hello_world/eslint.config.mjs +2 -27
- package/templates/hello_world/package.json +47 -34
- package/templates/hello_world/scripts/copy_env.ts +10 -0
- package/templates/hello_world/scripts/start/app_runner.ts +39 -2
- package/templates/hello_world/scripts/start/context.ts +12 -6
- package/templates/hello_world/scripts/start/start.ts +11 -0
- package/templates/hello_world/scripts/start/tests/start.tests.ts +61 -0
- package/templates/hello_world/src/app.tsx +20 -0
- package/templates/hello_world/src/tests/__snapshots__/app.tests.tsx.snap +45 -0
- package/templates/hello_world/src/tests/app.tests.tsx +86 -0
- package/templates/hello_world/webpack.config.ts +270 -0
- package/templates/common/conf/eslint-general.mjs +0 -277
- package/templates/common/conf/eslint-i18n.mjs +0 -23
- package/templates/gen_ai/backend/routers/oauth.ts +0 -393
- package/templates/gen_ai/src/components/logged_in_status.tsx +0 -44
- package/templates/gen_ai/src/services/auth.tsx +0 -26
- package/templates/gen_ai/src/services/index.ts +0 -1
package/README.md
CHANGED
|
@@ -7,200 +7,314 @@ CLI for creating and managing Canva Apps.
|
|
|
7
7
|
## Table of contents
|
|
8
8
|
|
|
9
9
|
- [Introduction](#introduction)
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
10
|
+
- [Requirements](#requirements)
|
|
11
|
+
- [Quickstart](#quickstart)
|
|
12
|
+
- [Use the Canva CLI](#use-the-canva-cli)
|
|
13
|
+
- [Step 1: Install and log in](#step-1-install-and-log-in)
|
|
14
|
+
- [Step 2: Create your app](#step-2-create-your-app)
|
|
15
|
+
- [Step 3: Preview your app](#step-3-preview-your-app)
|
|
16
|
+
- [Log out, auth token storage, and removal](#token-storage-and-removal)
|
|
12
17
|
- [CLI reference](#cli-reference)
|
|
13
18
|
- [Flags](#flags)
|
|
14
19
|
- [Commands](#commands)
|
|
15
20
|
- [Next steps](#next-steps)
|
|
16
21
|
- [Limitations](#limitations)
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
22
|
+
- [Updates](#updating)
|
|
23
|
+
- [Contributions](#contributing)
|
|
19
24
|
- [License](#license)
|
|
20
25
|
|
|
21
26
|
## Introduction
|
|
22
27
|
|
|
23
|
-
`@canva/cli` is a command line tool designed for creating and managing Canva Apps.
|
|
28
|
+
`@canva/cli` is a command line tool designed for creating and managing Canva Apps. Use `@canva/cli` to get started creating and testing your app. The Canva CLI allows you to create apps from the command line, and to use Canva's recommended development tools and templates.
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
To learn more about app development, visit [the official documentation](https://www.canva.dev/docs/apps).
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
- Create and manage apps directly from the command line.
|
|
29
|
-
- Utilize Canva's recommended development tools and templates.
|
|
32
|
+
## Requirements
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Before using the CLI, make sure that you have the following:
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
- Node.js `v18.20.4` or `v20.17.0`.
|
|
37
|
+
- npm `v9` or `v10`.
|
|
38
|
+
- A [Canva account](https://www.canva.com/developers).
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
- npm `v9` or `v10`
|
|
40
|
+
**Note**: If you are using a version manager such as nvm, run the `nvm install 20.17.0` command to make sure you have the correct Node.js version.
|
|
37
41
|
|
|
38
|
-
##
|
|
42
|
+
## Quickstart
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
The following commands create a new Canva app using the Canva CLI.
|
|
41
45
|
|
|
42
|
-
```
|
|
43
|
-
npm install -g @canva/cli
|
|
46
|
+
```shell
|
|
47
|
+
npm install -g @canva/cli@latest
|
|
48
|
+
canva login
|
|
49
|
+
canva apps create "My New App" --template="hello_world" --distribution="public" --git --installDependencies
|
|
50
|
+
cd my-new-app
|
|
51
|
+
npm start
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
## Use the Canva CLI
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
### Step 1: Install and log in
|
|
57
|
+
|
|
58
|
+
Installing the Canva CLI allows you to create new apps from the command line.
|
|
59
|
+
|
|
60
|
+
To get started:
|
|
61
|
+
|
|
62
|
+
1. Install the Canva CLI globally.
|
|
63
|
+
|
|
64
|
+
```shell
|
|
65
|
+
npm install -g @canva/cli@latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. Log in to the Canva CLI. The Canva CLI then opens an access request page in your browser.
|
|
69
|
+
|
|
70
|
+
```shell
|
|
71
|
+
canva login
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. In your browser, click **Allow** to grant the Canva CLI access to create and edit apps on your behalf. When you grant access, the Canva CLI generates an auth token and stores it locally. For more information on the auth token, read the following section on [auth token storage and removal](#log-out-auth-token-storage-and-removal).
|
|
75
|
+
4. Copy the confirmation code shown in your browser, and paste it into the Canva CLI input.
|
|
76
|
+
|
|
77
|
+
### Step 2: Create your app
|
|
78
|
+
|
|
79
|
+
After you log in to the Canva CLI and authorize it, you can create your app.
|
|
80
|
+
|
|
81
|
+
To create a new app:
|
|
82
|
+
|
|
83
|
+
1. Run the `canva apps create` command. The flags in the following code snippet are optional, and you can instead configure these settings during the apps creation process. See the [CLI Reference](#cli-reference) for more information on each flag.
|
|
84
|
+
|
|
85
|
+
```shell
|
|
86
|
+
canva apps create "My New App" --template="hello_world" --distribution="public" --git --installDependencies
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Note**: You can't change the distribution type after creating an app.
|
|
90
|
+
|
|
91
|
+
### Step 3: Preview your app
|
|
92
|
+
|
|
93
|
+
When your new app is ready, the Canva CLI automatically opens the [Developer Portal](https://www.canva.com/developers/apps) to your new app's Configuration page in your browser. You can then continue to preview and manage your new app.
|
|
94
|
+
|
|
95
|
+
To preview your app:
|
|
96
|
+
|
|
97
|
+
1. Change into your new app's folder.
|
|
98
|
+
|
|
99
|
+
```shell
|
|
100
|
+
cd my-new-app
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
2. Run the following command to start your app.
|
|
104
|
+
|
|
105
|
+
```shell
|
|
106
|
+
npm start
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. The preview URL will be generated and opened automatically in your browser.
|
|
110
|
+
4. If this the first time previewing your app, click **Open** to preview your new app.
|
|
111
|
+
|
|
112
|
+
### Step 4: Run a health check on your app
|
|
113
|
+
|
|
114
|
+
After creating your app, you can diagnose potential issues using:
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
canva apps doctor
|
|
50
118
|
```
|
|
51
119
|
|
|
120
|
+
This checks for missing dependencies, outdated packages, and other issues.
|
|
121
|
+
|
|
122
|
+
## Log out, auth token storage, and removal
|
|
123
|
+
|
|
124
|
+
When you log in to the Canva CLI using the `canva login` command, and then grant the Canva CLI access to manage apps in your Canva account, an auth token is encrypted and stored locally on your machine. The token provides authentication for future requests so you don't need to grant the Canva CLI access each time it sends a request.
|
|
125
|
+
|
|
126
|
+
When you log out of the Canva CLI with the `canva logout` command, the auth token is revoked, and deleted.
|
|
127
|
+
|
|
128
|
+
### Token Location
|
|
129
|
+
|
|
130
|
+
The auth token is located in your home directory under the `.canva-cli` folder.
|
|
131
|
+
|
|
132
|
+
### Removing the Token
|
|
133
|
+
|
|
134
|
+
To delete the token, there are two options. However only the `canva logout` command revokes and deletes the token. If there's a copy of the token, it's possible to reconnect the Canva CLI to your account's apps using the token.
|
|
135
|
+
|
|
136
|
+
#### Log out
|
|
137
|
+
|
|
138
|
+
1. Use the `canva logout` command to revoke access and delete the stored token.
|
|
139
|
+
|
|
140
|
+
```shell
|
|
141
|
+
canva logout
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Delete the file manually
|
|
145
|
+
|
|
146
|
+
1. Locate the `credentials` file, which is stored in the following locations:
|
|
147
|
+
|
|
148
|
+
- **macOS and Linux**: The token is stored in `~/.canva-cli/credentials`.
|
|
149
|
+
- **Windows**: The token is stored in `%USERPROFILE%\.canva-cli\credentials`.
|
|
150
|
+
|
|
151
|
+
2. Delete the file.
|
|
152
|
+
|
|
52
153
|
## CLI Reference
|
|
53
154
|
|
|
155
|
+
After installation, you can use the Canva CLI by running:
|
|
156
|
+
|
|
157
|
+
```shell
|
|
158
|
+
canva <command-name>
|
|
159
|
+
```
|
|
160
|
+
|
|
54
161
|
### Flags
|
|
55
162
|
|
|
56
|
-
Top-level flags applicable
|
|
163
|
+
Top-level flags applicable to commands:
|
|
57
164
|
|
|
58
|
-
- `--help`:
|
|
165
|
+
- `--help`: Show help information about commands and flags.
|
|
59
166
|
- `--lite`: Enable a simplified CLI interface for enhanced accessibility.
|
|
60
|
-
- `--version`: Show the version number
|
|
167
|
+
- `--version`: Show the CLI version number.
|
|
61
168
|
|
|
62
169
|
### Commands
|
|
63
170
|
|
|
64
171
|
#### welcome
|
|
65
172
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- **Usage**:
|
|
173
|
+
Show the welcome page and general information.
|
|
69
174
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
175
|
+
```shell
|
|
176
|
+
canva welcome
|
|
177
|
+
```
|
|
73
178
|
|
|
74
179
|
#### tip
|
|
75
180
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- **Usage**:
|
|
181
|
+
Print a random development tip for working with the Apps SDK.
|
|
79
182
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
183
|
+
```shell
|
|
184
|
+
canva tip
|
|
185
|
+
```
|
|
83
186
|
|
|
84
|
-
- **Aliases**:
|
|
187
|
+
- **Aliases**:
|
|
188
|
+
- `tips`: Also prints a random development tip.
|
|
85
189
|
|
|
86
190
|
#### login
|
|
87
191
|
|
|
88
192
|
Log in to the Canva CLI.
|
|
89
193
|
|
|
90
|
-
|
|
194
|
+
```shell
|
|
195
|
+
canva login
|
|
196
|
+
```
|
|
91
197
|
|
|
92
|
-
|
|
93
|
-
canva login
|
|
94
|
-
```
|
|
198
|
+
#### logout
|
|
95
199
|
|
|
96
|
-
|
|
200
|
+
Log out of the Canva CLI, and delete the saved auth token:
|
|
97
201
|
|
|
98
|
-
|
|
202
|
+
```shell
|
|
203
|
+
canva logout
|
|
204
|
+
```
|
|
99
205
|
|
|
100
|
-
|
|
206
|
+
#### mcp
|
|
101
207
|
|
|
102
|
-
|
|
103
|
-
canva apps
|
|
104
|
-
```
|
|
208
|
+
Start the canva [MCP](https://modelcontextprotocol.io) server. This is usually called by your MCP client, such as Claude Desktop, Cursor, or other compatible tools. For more information on how to configure your MCP client to use the Canva MCP server, please see [MCP Server](https://www.canva.dev/docs/apps/mcp-server) in the developer documentation.
|
|
105
209
|
|
|
106
|
-
|
|
210
|
+
#### apps
|
|
107
211
|
|
|
108
|
-
|
|
212
|
+
Manage your Canva apps.
|
|
109
213
|
|
|
110
|
-
|
|
214
|
+
```shell
|
|
215
|
+
canva apps
|
|
216
|
+
```
|
|
111
217
|
|
|
112
|
-
|
|
113
|
-
canva apps create "My New App" --template="hello_world" --distribution="public" --git --installDependencies
|
|
114
|
-
```
|
|
218
|
+
##### create
|
|
115
219
|
|
|
116
|
-
|
|
117
|
-
- `[name]`: Sets the app's name. Provide the desired name of the app when using this command.
|
|
118
|
-
- **Flags**:
|
|
220
|
+
Create a new Canva app.
|
|
119
221
|
|
|
120
|
-
|
|
222
|
+
```shell
|
|
223
|
+
canva apps create "My New App" --template="hello_world" --distribution="public" --git --installDependencies
|
|
224
|
+
```
|
|
121
225
|
|
|
122
|
-
|
|
226
|
+
- **Arguments**:
|
|
227
|
+
- `--name`: Sets the app's name. Provide the name you want for the app.
|
|
228
|
+
- **Flags**:
|
|
123
229
|
|
|
124
|
-
|
|
125
|
-
- `"dam"`: Digital asset management integration.
|
|
126
|
-
- `"gen_ai"`: Generative AI app creation.
|
|
230
|
+
- `--template`: Specifies the starting template for the app.
|
|
127
231
|
|
|
128
|
-
|
|
232
|
+
Available templates:
|
|
129
233
|
|
|
130
|
-
|
|
234
|
+
- `"hello_world"`: Basic starting point.
|
|
235
|
+
- `"dam"`: Digital asset management integration.
|
|
236
|
+
- `"gen_ai"`: Generative AI app creation.
|
|
131
237
|
|
|
132
|
-
|
|
133
|
-
- `"private"`: Only available to your team, requires team admin approval.
|
|
238
|
+
- `--distribution`: Sets the app's distribution type.
|
|
134
239
|
|
|
135
|
-
|
|
136
|
-
> This setting cannot be changed after the app is created.
|
|
240
|
+
Available types:
|
|
137
241
|
|
|
138
|
-
|
|
242
|
+
- `"public"`: Available to all Canva users, subject to Canva review.
|
|
243
|
+
- `"private"`: Only available to your team, and requires team admin approval.
|
|
139
244
|
|
|
140
|
-
|
|
245
|
+
**Note**: You can't change the distribution setting after creating a new app with the `canva apps create` command.
|
|
141
246
|
|
|
142
|
-
-
|
|
247
|
+
- `--git`: Initializes a Git repository in the project directory.
|
|
143
248
|
|
|
144
|
-
|
|
249
|
+
- `--installDependencies`: Automatically installs necessary npm dependencies during the app creation process.
|
|
145
250
|
|
|
146
|
-
|
|
147
|
-
canva apps list
|
|
148
|
-
```
|
|
251
|
+
- `--offline`: Scaffold the app locally without also creating an app in the Developer Portal.
|
|
149
252
|
|
|
150
|
-
|
|
253
|
+
##### list
|
|
151
254
|
|
|
152
|
-
|
|
255
|
+
List all Canva apps.
|
|
153
256
|
|
|
154
|
-
|
|
257
|
+
```shell
|
|
258
|
+
canva apps list
|
|
259
|
+
```
|
|
155
260
|
|
|
156
|
-
|
|
157
|
-
canva logout
|
|
158
|
-
```
|
|
261
|
+
- **Flags**:
|
|
159
262
|
|
|
160
|
-
|
|
263
|
+
- `--appId`: Specifies an App ID to select.
|
|
264
|
+
- `--all`, `-a`: Lists all apps at once without pagination.
|
|
265
|
+
- `--print`, `-p`: Prints the list of apps to the console without interactivity.
|
|
161
266
|
|
|
162
|
-
|
|
163
|
-
- [Integrate your app with Canva using the Apps SDK](https://www.canva.dev/docs/apps/integrating-canva/)
|
|
267
|
+
##### preview
|
|
164
268
|
|
|
165
|
-
|
|
269
|
+
Preview your app.
|
|
166
270
|
|
|
167
|
-
|
|
271
|
+
```shell
|
|
272
|
+
canva apps preview
|
|
273
|
+
```
|
|
168
274
|
|
|
169
|
-
|
|
275
|
+
##### doctor
|
|
170
276
|
|
|
171
|
-
|
|
277
|
+
Run diagnostics on your Canva App to identify and fix issues.
|
|
172
278
|
|
|
173
|
-
```
|
|
174
|
-
|
|
279
|
+
```shell
|
|
280
|
+
canva apps doctor
|
|
175
281
|
```
|
|
176
282
|
|
|
177
|
-
|
|
283
|
+
- **Flags**:
|
|
178
284
|
|
|
179
|
-
|
|
285
|
+
- `--fix`: Automatically apply fixes for issues where possible.
|
|
286
|
+
- `--report`: Output check results without prompting for fixes.
|
|
287
|
+
- `--verbose`: Show detailed diagnostic output optimized for AI agent assistance.
|
|
180
288
|
|
|
181
|
-
|
|
289
|
+
#### logout
|
|
182
290
|
|
|
183
|
-
|
|
291
|
+
Log out and revoke Canva CLI access.
|
|
184
292
|
|
|
185
|
-
|
|
293
|
+
```shell
|
|
294
|
+
canva logout
|
|
295
|
+
```
|
|
186
296
|
|
|
187
|
-
|
|
297
|
+
## Next Steps
|
|
188
298
|
|
|
189
|
-
|
|
299
|
+
- [Preview your app in the Canva editor](https://www.canva.dev/docs/apps/previewing-apps/)
|
|
300
|
+
- [Integrate your app with Canva using the Apps SDK](https://www.canva.dev/docs/apps/integrating-canva/)
|
|
190
301
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
302
|
+
## Limitations
|
|
303
|
+
|
|
304
|
+
You must manage your new app created through the Canva CLI through the [Developer Portal](https://www.canva.com/developers/apps). You can't manage apps completely through the Canva CLI.
|
|
194
305
|
|
|
195
|
-
|
|
306
|
+
## Updates
|
|
196
307
|
|
|
197
|
-
|
|
198
|
-
|
|
308
|
+
To update the CLI to the latest version, run:
|
|
309
|
+
|
|
310
|
+
```shell
|
|
311
|
+
npm update -g @canva/cli@latest
|
|
312
|
+
```
|
|
199
313
|
|
|
200
|
-
##
|
|
314
|
+
## Contributions
|
|
201
315
|
|
|
202
|
-
|
|
316
|
+
Currently the Canva CLI doesn't accept third-party contributions. Please submit any feature requests through the [Canva Developers Community](https://community.canva.dev/).
|
|
203
317
|
|
|
204
318
|
## License
|
|
205
319
|
|
|
206
|
-
Refer to the `LICENSE.md` file for
|
|
320
|
+
Refer to the `LICENSE.md` file for more information.
|