@xano/developer-mcp 1.0.60 → 1.0.61
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 +8 -1
- package/dist/cli_docs/index.js +16 -1
- package/dist/cli_docs/topics/auth.d.ts +2 -0
- package/dist/cli_docs/topics/auth.js +62 -0
- package/dist/cli_docs/topics/branch.js +1 -1
- package/dist/cli_docs/topics/function.js +9 -3
- package/dist/cli_docs/topics/integration.js +6 -1
- package/dist/cli_docs/topics/platform.d.ts +2 -0
- package/dist/cli_docs/topics/platform.js +41 -0
- package/dist/cli_docs/topics/profile.js +66 -31
- package/dist/cli_docs/topics/release.d.ts +2 -0
- package/dist/cli_docs/topics/release.js +215 -0
- package/dist/cli_docs/topics/run.js +1 -1
- package/dist/cli_docs/topics/start.js +20 -13
- package/dist/cli_docs/topics/static_host.js +1 -1
- package/dist/cli_docs/topics/tenant.d.ts +2 -0
- package/dist/cli_docs/topics/tenant.js +472 -0
- package/dist/cli_docs/topics/unit_test.d.ts +2 -0
- package/dist/cli_docs/topics/unit_test.js +88 -0
- package/dist/cli_docs/topics/update.d.ts +2 -0
- package/dist/cli_docs/topics/update.js +29 -0
- package/dist/cli_docs/topics/workflow_test.d.ts +2 -0
- package/dist/cli_docs/topics/workflow_test.js +119 -0
- package/dist/cli_docs/topics/workspace.js +56 -9
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ This is different from your instance URL used by the Meta API.`,
|
|
|
24
24
|
**Environment variables:**
|
|
25
25
|
- Stored per-project in Run API
|
|
26
26
|
- Override at runtime with \`--env KEY=value\``,
|
|
27
|
-
related_topics: ["profile", "integration"],
|
|
27
|
+
related_topics: ["function", "profile", "integration"],
|
|
28
28
|
commands: [
|
|
29
29
|
{
|
|
30
30
|
name: "run:exec",
|
|
@@ -26,18 +26,17 @@ npm link
|
|
|
26
26
|
|
|
27
27
|
## Quick Setup
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
**Option 1: Browser login (recommended)**
|
|
30
|
+
\`\`\`bash
|
|
31
|
+
xano auth
|
|
32
|
+
\`\`\`
|
|
33
|
+
Opens your browser to log in. Automatically creates a profile.
|
|
30
34
|
|
|
35
|
+
**Option 2: Interactive wizard**
|
|
31
36
|
\`\`\`bash
|
|
32
37
|
xano profile:wizard
|
|
33
38
|
\`\`\`
|
|
34
|
-
|
|
35
|
-
This will prompt you for:
|
|
36
|
-
1. Your Xano access token (from Settings > Access Tokens in dashboard)
|
|
37
|
-
2. Select your instance
|
|
38
|
-
3. Select a workspace
|
|
39
|
-
4. Select a branch
|
|
40
|
-
5. Select a Run project (optional)
|
|
39
|
+
Prompts you for your access token, instance, workspace, and branch.
|
|
41
40
|
|
|
42
41
|
## Credential Storage
|
|
43
42
|
|
|
@@ -69,11 +68,19 @@ All commands support:
|
|
|
69
68
|
|
|
70
69
|
| Category | Description |
|
|
71
70
|
|----------|-------------|
|
|
71
|
+
| \`auth\` | Browser-based OAuth login |
|
|
72
72
|
| \`profile:*\` | Manage authentication profiles |
|
|
73
|
-
| \`workspace:*\` | Sync workspaces (pull/push) |
|
|
74
|
-
| \`
|
|
73
|
+
| \`workspace:*\` | Sync workspaces (pull/push), git integration |
|
|
74
|
+
| \`branch:*\` | Manage workspace branches |
|
|
75
|
+
| \`function:*\` | Manage individual functions |
|
|
76
|
+
| \`release:*\` | Create and manage named releases |
|
|
77
|
+
| \`tenant:*\` | Manage tenants, deployments, backups, env vars |
|
|
78
|
+
| \`unit_test:*\` | Run unit tests |
|
|
79
|
+
| \`workflow_test:*\` | Run workflow tests |
|
|
75
80
|
| \`run:*\` | Execute code and manage Run projects |
|
|
76
|
-
| \`
|
|
81
|
+
| \`platform:*\` | View available platform versions |
|
|
82
|
+
| \`static_host:*\` | Deploy static sites |
|
|
83
|
+
| \`update\` | Update CLI to latest version |`,
|
|
77
84
|
ai_hints: `**Important:** The CLI is optional - not all users will have it installed. Before suggesting CLI commands, check if the user has it available or ask if they'd like to install it. The Meta API can accomplish the same tasks programmatically.
|
|
78
85
|
|
|
79
86
|
**When to use CLI vs Meta API:**
|
|
@@ -82,7 +89,7 @@ All commands support:
|
|
|
82
89
|
- If CLI not installed: Use Meta API endpoints directly
|
|
83
90
|
|
|
84
91
|
**Getting started workflow (if CLI is installed):**
|
|
85
|
-
1. Run \`xano profile:wizard\` to set up authentication
|
|
92
|
+
1. Run \`xano auth\` (browser login) or \`xano profile:wizard\` (token-based) to set up authentication
|
|
86
93
|
2. Use \`xano workspace:pull ./code\` to download workspace code
|
|
87
94
|
3. Edit .xs files locally
|
|
88
95
|
4. Use \`xano workspace:push ./code\` to deploy changes
|
|
@@ -91,7 +98,7 @@ All commands support:
|
|
|
91
98
|
1. \`-p\` flag on command
|
|
92
99
|
2. \`XANO_PROFILE\` environment variable
|
|
93
100
|
3. Default profile in credentials.yaml`,
|
|
94
|
-
related_topics: ["profile", "workspace", "integration"],
|
|
101
|
+
related_topics: ["auth", "profile", "workspace", "integration"],
|
|
95
102
|
workflows: [
|
|
96
103
|
{
|
|
97
104
|
name: "Initial Setup",
|
|
@@ -11,7 +11,7 @@ export const staticHostDoc = {
|
|
|
11
11
|
- Deploy SPAs built with modern frameworks
|
|
12
12
|
- Host static documentation sites
|
|
13
13
|
- Serve frontend that calls your Xano APIs`,
|
|
14
|
-
related_topics: ["workspace"],
|
|
14
|
+
related_topics: ["workspace", "tenant"],
|
|
15
15
|
commands: [
|
|
16
16
|
{
|
|
17
17
|
name: "static_host:list",
|
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
export const tenantDoc = {
|
|
2
|
+
topic: "tenant",
|
|
3
|
+
title: "Xano CLI - Tenant Management",
|
|
4
|
+
description: `Tenant commands let you manage tenants in a Xano workspace. Tenants are isolated deployment targets for multi-tenant and white-label applications. Each tenant has its own database, environment variables, and configuration.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
|
|
8
|
+
- **Tenant**: An isolated deployment instance within a workspace, identified by name.
|
|
9
|
+
- **Cluster**: Infrastructure where tenants run (Kubernetes or Xano-managed).
|
|
10
|
+
- **Deployments**: Tenants receive updates via named releases or platform versions.
|
|
11
|
+
- **Environment variables**: Managed per-tenant for configuration isolation.
|
|
12
|
+
- **Backups**: Per-tenant backup and restore for disaster recovery.
|
|
13
|
+
- **Pull/Push**: Similar to \`workspace:pull/push\` but scoped to a specific tenant.
|
|
14
|
+
|
|
15
|
+
## Tenant Identification
|
|
16
|
+
|
|
17
|
+
Tenants are identified by their **name** (not numeric IDs).`,
|
|
18
|
+
ai_hints: `**Key concepts:**
|
|
19
|
+
- Tenants are deployment targets for multi-tenant/white-label applications
|
|
20
|
+
- Each tenant is isolated with its own database, env vars, and configuration
|
|
21
|
+
- \`tenant:pull\` and \`tenant:push\` work like \`workspace:pull/push\` but scoped to a tenant
|
|
22
|
+
- Deployments use named releases (\`tenant:deploy_release\`) or platform versions (\`tenant:deploy_platform\`)
|
|
23
|
+
- Environment variables are managed per-tenant for configuration isolation
|
|
24
|
+
- Backups provide disaster recovery per-tenant
|
|
25
|
+
- Clusters manage the infrastructure where tenants run
|
|
26
|
+
|
|
27
|
+
**Typical workflow:**
|
|
28
|
+
1. Create a tenant: \`xano tenant:create "My Tenant"\`
|
|
29
|
+
2. Set environment variables: \`xano tenant:env:set my-tenant -n API_KEY -v secret\`
|
|
30
|
+
3. Deploy a release: \`xano tenant:deploy_release my-tenant -r v1.0.0\`
|
|
31
|
+
|
|
32
|
+
**Tenant operations overview:**
|
|
33
|
+
- CRUD: create, get, list, edit, delete
|
|
34
|
+
- Code sync: pull, push
|
|
35
|
+
- Deployment: deploy_release, deploy_platform
|
|
36
|
+
- Configuration: env:get, env:set, env:delete, env:list, env:get_all, env:set_all
|
|
37
|
+
- Backups: backup:create, backup:list, backup:export, backup:import, backup:restore, backup:delete
|
|
38
|
+
- Infrastructure: cluster:create, cluster:list, cluster:get, cluster:edit, cluster:delete
|
|
39
|
+
- License: license:get, license:set
|
|
40
|
+
- Access: impersonate (open tenant in browser)`,
|
|
41
|
+
related_topics: ["workspace", "release", "branch"],
|
|
42
|
+
commands: [
|
|
43
|
+
// Core CRUD
|
|
44
|
+
{
|
|
45
|
+
name: "tenant:list",
|
|
46
|
+
description: "List all tenants in a workspace",
|
|
47
|
+
usage: "xano tenant:list [options]",
|
|
48
|
+
flags: [
|
|
49
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
50
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
51
|
+
],
|
|
52
|
+
examples: ["xano tenant:list", "xano tenant:list -o json"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "tenant:get",
|
|
56
|
+
description: "Get details for a specific tenant",
|
|
57
|
+
usage: "xano tenant:get <tenant_name> [options]",
|
|
58
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
59
|
+
flags: [
|
|
60
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
61
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
62
|
+
],
|
|
63
|
+
examples: ["xano tenant:get my-tenant", "xano tenant:get my-tenant -o json"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "tenant:create",
|
|
67
|
+
description: "Create a new tenant",
|
|
68
|
+
usage: "xano tenant:create <display_name> [options]",
|
|
69
|
+
args: [{ name: "display_name", required: true, description: "Display name for the tenant" }],
|
|
70
|
+
flags: [
|
|
71
|
+
{ name: "description", short: "d", type: "string", required: false, description: "Tenant description" },
|
|
72
|
+
{ name: "cluster_id", type: "string", required: false, description: "Cluster ID to deploy to" },
|
|
73
|
+
{ name: "platform_id", type: "string", required: false, description: "Platform version ID" },
|
|
74
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
75
|
+
],
|
|
76
|
+
examples: [
|
|
77
|
+
'xano tenant:create "My Tenant"',
|
|
78
|
+
'xano tenant:create "Production" -d "Production tenant" --cluster_id 1'
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "tenant:edit",
|
|
83
|
+
description: "Edit an existing tenant",
|
|
84
|
+
usage: "xano tenant:edit <tenant_name> [options]",
|
|
85
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
86
|
+
flags: [
|
|
87
|
+
{ name: "display", type: "string", required: false, description: "New display name" },
|
|
88
|
+
{ name: "description", short: "d", type: "string", required: false, description: "New description" },
|
|
89
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
90
|
+
],
|
|
91
|
+
examples: ['xano tenant:edit my-tenant --display "New Name"']
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "tenant:delete",
|
|
95
|
+
description: "Delete a tenant",
|
|
96
|
+
usage: "xano tenant:delete <tenant_name> [options]",
|
|
97
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
98
|
+
flags: [
|
|
99
|
+
{ name: "force", type: "boolean", required: false, description: "Skip confirmation prompt" },
|
|
100
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
101
|
+
],
|
|
102
|
+
examples: ["xano tenant:delete old-tenant", "xano tenant:delete old-tenant --force"]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "tenant:impersonate",
|
|
106
|
+
description: "Open tenant dashboard in browser",
|
|
107
|
+
usage: "xano tenant:impersonate <tenant_name> [options]",
|
|
108
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
109
|
+
flags: [
|
|
110
|
+
{ name: "url-only", type: "boolean", required: false, description: "Print URL without opening browser" },
|
|
111
|
+
{ name: "output", short: "o", type: "string", required: false, description: "Output format: json" },
|
|
112
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
113
|
+
],
|
|
114
|
+
examples: ["xano tenant:impersonate my-tenant", "xano tenant:impersonate my-tenant --url-only"]
|
|
115
|
+
},
|
|
116
|
+
// Pull/Push
|
|
117
|
+
{
|
|
118
|
+
name: "tenant:pull",
|
|
119
|
+
description: "Pull tenant contents to local files (same multidoc format as workspace:pull)",
|
|
120
|
+
usage: "xano tenant:pull <directory> --tenant <name> [options]",
|
|
121
|
+
args: [{ name: "directory", required: true, description: "Local directory to save files" }],
|
|
122
|
+
flags: [
|
|
123
|
+
{ name: "tenant", short: "t", type: "string", required: true, description: "Tenant name" },
|
|
124
|
+
{ name: "env", type: "boolean", required: false, description: "Include environment variables" },
|
|
125
|
+
{ name: "records", type: "boolean", required: false, description: "Include table records" },
|
|
126
|
+
{ name: "draft", type: "boolean", required: false, description: "Include draft versions" },
|
|
127
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
128
|
+
],
|
|
129
|
+
examples: [
|
|
130
|
+
"xano tenant:pull ./tenant-code -t my-tenant",
|
|
131
|
+
"xano tenant:pull ./backup -t my-tenant --env --records"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "tenant:push",
|
|
136
|
+
description: "Push local files to a tenant",
|
|
137
|
+
usage: "xano tenant:push <directory> --tenant <name> [options]",
|
|
138
|
+
args: [{ name: "directory", required: true, description: "Local directory containing files" }],
|
|
139
|
+
flags: [
|
|
140
|
+
{ name: "tenant", short: "t", type: "string", required: true, description: "Tenant name" },
|
|
141
|
+
{ name: "records", type: "boolean", required: false, description: "Include table records" },
|
|
142
|
+
{ name: "env", type: "boolean", required: false, description: "Include environment variables" },
|
|
143
|
+
{ name: "truncate", type: "boolean", required: false, description: "Truncate tables before importing records" },
|
|
144
|
+
{ name: "transaction", type: "boolean", required: false, default: "true", description: "Wrap push in database transaction (--no-transaction to disable)" },
|
|
145
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
146
|
+
],
|
|
147
|
+
examples: [
|
|
148
|
+
"xano tenant:push ./tenant-code -t my-tenant",
|
|
149
|
+
"xano tenant:push ./data -t my-tenant --records --truncate"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
// Deployments
|
|
153
|
+
{
|
|
154
|
+
name: "tenant:deploy_release",
|
|
155
|
+
description: "Deploy a named release to a tenant",
|
|
156
|
+
usage: "xano tenant:deploy_release <tenant_name> --release <name> [options]",
|
|
157
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
158
|
+
flags: [
|
|
159
|
+
{ name: "release", short: "r", type: "string", required: true, description: "Release name to deploy" },
|
|
160
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
161
|
+
],
|
|
162
|
+
examples: [
|
|
163
|
+
"xano tenant:deploy_release my-tenant -r v1.0.0",
|
|
164
|
+
"xano tenant:deploy_release production --release v2.0.0"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "tenant:deploy_platform",
|
|
169
|
+
description: "Deploy a platform version to a tenant",
|
|
170
|
+
usage: "xano tenant:deploy_platform <tenant_name> --platform_id <id> [options]",
|
|
171
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
172
|
+
flags: [
|
|
173
|
+
{ name: "platform_id", type: "string", required: true, description: "Platform version ID to deploy" },
|
|
174
|
+
{ name: "license", type: "string", required: false, description: "Path to license file" },
|
|
175
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
176
|
+
],
|
|
177
|
+
examples: ["xano tenant:deploy_platform my-tenant --platform_id 5"]
|
|
178
|
+
},
|
|
179
|
+
// Environment Variables
|
|
180
|
+
{
|
|
181
|
+
name: "tenant:env:list",
|
|
182
|
+
description: "List environment variable keys for a tenant",
|
|
183
|
+
usage: "xano tenant:env:list <tenant_name> [options]",
|
|
184
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
185
|
+
flags: [
|
|
186
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
187
|
+
],
|
|
188
|
+
examples: ["xano tenant:env:list my-tenant"]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "tenant:env:get",
|
|
192
|
+
description: "Get a single environment variable",
|
|
193
|
+
usage: "xano tenant:env:get <tenant_name> --name <key> [options]",
|
|
194
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
195
|
+
flags: [
|
|
196
|
+
{ name: "name", short: "n", type: "string", required: true, description: "Variable name" },
|
|
197
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
198
|
+
],
|
|
199
|
+
examples: ["xano tenant:env:get my-tenant -n API_KEY"]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "tenant:env:set",
|
|
203
|
+
description: "Set an environment variable",
|
|
204
|
+
usage: "xano tenant:env:set <tenant_name> --name <key> --value <val> [options]",
|
|
205
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
206
|
+
flags: [
|
|
207
|
+
{ name: "name", short: "n", type: "string", required: true, description: "Variable name" },
|
|
208
|
+
{ name: "value", type: "string", required: true, description: "Variable value" },
|
|
209
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
210
|
+
],
|
|
211
|
+
examples: ["xano tenant:env:set my-tenant -n API_KEY --value sk-123"]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: "tenant:env:delete",
|
|
215
|
+
description: "Delete an environment variable",
|
|
216
|
+
usage: "xano tenant:env:delete <tenant_name> --name <key> [options]",
|
|
217
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
218
|
+
flags: [
|
|
219
|
+
{ name: "name", short: "n", type: "string", required: true, description: "Variable name" },
|
|
220
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
221
|
+
],
|
|
222
|
+
examples: ["xano tenant:env:delete my-tenant -n OLD_KEY"]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "tenant:env:get_all",
|
|
226
|
+
description: "Export all environment variables (optionally to YAML file)",
|
|
227
|
+
usage: "xano tenant:env:get_all <tenant_name> [options]",
|
|
228
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
229
|
+
flags: [
|
|
230
|
+
{ name: "file", type: "string", required: false, description: "Output file path (YAML format)" },
|
|
231
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
232
|
+
],
|
|
233
|
+
examples: [
|
|
234
|
+
"xano tenant:env:get_all my-tenant",
|
|
235
|
+
"xano tenant:env:get_all my-tenant --file ./env.yaml"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "tenant:env:set_all",
|
|
240
|
+
description: "Import all environment variables from YAML (replaces all existing)",
|
|
241
|
+
usage: "xano tenant:env:set_all <tenant_name> [options]",
|
|
242
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
243
|
+
flags: [
|
|
244
|
+
{ name: "file", type: "string", required: false, description: "Input YAML file with env vars" },
|
|
245
|
+
{ name: "clean", type: "boolean", required: false, description: "Remove all existing env vars first" },
|
|
246
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
247
|
+
],
|
|
248
|
+
examples: [
|
|
249
|
+
"xano tenant:env:set_all my-tenant --file ./env.yaml",
|
|
250
|
+
"xano tenant:env:set_all my-tenant --file ./env.yaml --clean"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
// Backups
|
|
254
|
+
{
|
|
255
|
+
name: "tenant:backup:list",
|
|
256
|
+
description: "List backups for a tenant",
|
|
257
|
+
usage: "xano tenant:backup:list <tenant_name> [options]",
|
|
258
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
259
|
+
flags: [
|
|
260
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
261
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
262
|
+
],
|
|
263
|
+
examples: ["xano tenant:backup:list my-tenant"]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "tenant:backup:create",
|
|
267
|
+
description: "Create a backup of a tenant",
|
|
268
|
+
usage: "xano tenant:backup:create <tenant_name> [options]",
|
|
269
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
270
|
+
flags: [
|
|
271
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
272
|
+
],
|
|
273
|
+
examples: ["xano tenant:backup:create my-tenant"]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: "tenant:backup:export",
|
|
277
|
+
description: "Download a backup file",
|
|
278
|
+
usage: "xano tenant:backup:export <tenant_name> --backup_id <id> [options]",
|
|
279
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
280
|
+
flags: [
|
|
281
|
+
{ name: "backup_id", type: "string", required: true, description: "Backup ID to export" },
|
|
282
|
+
{ name: "output", type: "string", required: false, description: "File path for the downloaded backup" },
|
|
283
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
284
|
+
],
|
|
285
|
+
examples: ["xano tenant:backup:export my-tenant --backup_id 123 --output ./backup.tar.gz"]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "tenant:backup:import",
|
|
289
|
+
description: "Import a backup file into a tenant",
|
|
290
|
+
usage: "xano tenant:backup:import <tenant_name> --file <path> [options]",
|
|
291
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
292
|
+
flags: [
|
|
293
|
+
{ name: "file", type: "string", required: true, description: "Path to backup file" },
|
|
294
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
295
|
+
],
|
|
296
|
+
examples: ["xano tenant:backup:import my-tenant --file ./backup.tar.gz"]
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "tenant:backup:restore",
|
|
300
|
+
description: "Restore a tenant from a backup",
|
|
301
|
+
usage: "xano tenant:backup:restore <tenant_name> --backup_id <id> [options]",
|
|
302
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
303
|
+
flags: [
|
|
304
|
+
{ name: "backup_id", type: "string", required: true, description: "Backup ID to restore from" },
|
|
305
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
306
|
+
],
|
|
307
|
+
examples: ["xano tenant:backup:restore my-tenant --backup_id 123"]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "tenant:backup:delete",
|
|
311
|
+
description: "Delete a backup",
|
|
312
|
+
usage: "xano tenant:backup:delete <tenant_name> --backup_id <id> [options]",
|
|
313
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
314
|
+
flags: [
|
|
315
|
+
{ name: "backup_id", type: "string", required: true, description: "Backup ID to delete" },
|
|
316
|
+
{ name: "force", type: "boolean", required: false, description: "Skip confirmation prompt" },
|
|
317
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
318
|
+
],
|
|
319
|
+
examples: ["xano tenant:backup:delete my-tenant --backup_id 123 --force"]
|
|
320
|
+
},
|
|
321
|
+
// License
|
|
322
|
+
{
|
|
323
|
+
name: "tenant:license:get",
|
|
324
|
+
description: "Get tenant license tier",
|
|
325
|
+
usage: "xano tenant:license:get <tenant_name> [options]",
|
|
326
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
327
|
+
flags: [
|
|
328
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
329
|
+
],
|
|
330
|
+
examples: ["xano tenant:license:get my-tenant"]
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "tenant:license:set",
|
|
334
|
+
description: "Set tenant license tier",
|
|
335
|
+
usage: "xano tenant:license:set <tenant_name> --license <tier> [options]",
|
|
336
|
+
args: [{ name: "tenant_name", required: true, description: "Tenant name" }],
|
|
337
|
+
flags: [
|
|
338
|
+
{ name: "license", type: "string", required: true, description: "License tier to set" },
|
|
339
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
340
|
+
],
|
|
341
|
+
examples: ["xano tenant:license:set my-tenant --license tier2"]
|
|
342
|
+
},
|
|
343
|
+
// Clusters
|
|
344
|
+
{
|
|
345
|
+
name: "tenant:cluster:list",
|
|
346
|
+
description: "List all clusters",
|
|
347
|
+
usage: "xano tenant:cluster:list [options]",
|
|
348
|
+
flags: [
|
|
349
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
350
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
351
|
+
],
|
|
352
|
+
examples: ["xano tenant:cluster:list", "xano tenant:cluster:list -o json"]
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "tenant:cluster:get",
|
|
356
|
+
description: "Get cluster details",
|
|
357
|
+
usage: "xano tenant:cluster:get <cluster_id> [options]",
|
|
358
|
+
args: [{ name: "cluster_id", required: true, description: "Cluster ID" }],
|
|
359
|
+
flags: [
|
|
360
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
361
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
362
|
+
],
|
|
363
|
+
examples: ["xano tenant:cluster:get 1"]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "tenant:cluster:create",
|
|
367
|
+
description: "Create a new cluster",
|
|
368
|
+
usage: "xano tenant:cluster:create --name <name> [options]",
|
|
369
|
+
flags: [
|
|
370
|
+
{ name: "name", short: "n", type: "string", required: true, description: "Cluster name" },
|
|
371
|
+
{ name: "type", type: "string", required: false, description: "Cluster type: run or k8s" },
|
|
372
|
+
{ name: "description", short: "d", type: "string", required: false, description: "Cluster description" },
|
|
373
|
+
{ name: "credentials_file", type: "string", required: false, description: "Path to kubeconfig.yaml (for k8s type)" },
|
|
374
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
375
|
+
],
|
|
376
|
+
examples: [
|
|
377
|
+
'xano tenant:cluster:create -n "Production Cluster"',
|
|
378
|
+
'xano tenant:cluster:create -n "K8s Cluster" --type k8s --credentials_file ./kubeconfig.yaml'
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: "tenant:cluster:edit",
|
|
383
|
+
description: "Edit a cluster",
|
|
384
|
+
usage: "xano tenant:cluster:edit <cluster_id> [options]",
|
|
385
|
+
args: [{ name: "cluster_id", required: true, description: "Cluster ID" }],
|
|
386
|
+
flags: [
|
|
387
|
+
{ name: "name", short: "n", type: "string", required: false, description: "New cluster name" },
|
|
388
|
+
{ name: "description", short: "d", type: "string", required: false, description: "New description" },
|
|
389
|
+
{ name: "domain", type: "string", required: false, description: "New domain" },
|
|
390
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
391
|
+
],
|
|
392
|
+
examples: ['xano tenant:cluster:edit 1 -n "Updated Cluster"']
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: "tenant:cluster:delete",
|
|
396
|
+
description: "Delete a cluster",
|
|
397
|
+
usage: "xano tenant:cluster:delete <cluster_id> [options]",
|
|
398
|
+
args: [{ name: "cluster_id", required: true, description: "Cluster ID" }],
|
|
399
|
+
flags: [
|
|
400
|
+
{ name: "force", type: "boolean", required: false, description: "Skip confirmation prompt" },
|
|
401
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
402
|
+
],
|
|
403
|
+
examples: ["xano tenant:cluster:delete 1 --force"]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "tenant:cluster:license:get",
|
|
407
|
+
description: "Get cluster kubeconfig",
|
|
408
|
+
usage: "xano tenant:cluster:license:get <cluster_id> [options]",
|
|
409
|
+
args: [{ name: "cluster_id", required: true, description: "Cluster ID" }],
|
|
410
|
+
flags: [
|
|
411
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
412
|
+
],
|
|
413
|
+
examples: ["xano tenant:cluster:license:get 1"]
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: "tenant:cluster:license:set",
|
|
417
|
+
description: "Set cluster kubeconfig",
|
|
418
|
+
usage: "xano tenant:cluster:license:set <cluster_id> [options]",
|
|
419
|
+
args: [{ name: "cluster_id", required: true, description: "Cluster ID" }],
|
|
420
|
+
flags: [
|
|
421
|
+
{ name: "file", type: "string", required: false, description: "Path to kubeconfig.yaml" },
|
|
422
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" }
|
|
423
|
+
],
|
|
424
|
+
examples: ["xano tenant:cluster:license:set 1 --file ./kubeconfig.yaml"]
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
workflows: [
|
|
428
|
+
{
|
|
429
|
+
name: "Deploy Release to Tenant",
|
|
430
|
+
description: "Create a release and deploy it to a tenant",
|
|
431
|
+
steps: [
|
|
432
|
+
"Create a release from a branch: `xano release:create -n v1.0.0 -b dev`",
|
|
433
|
+
"Deploy to tenant: `xano tenant:deploy_release my-tenant -r v1.0.0`",
|
|
434
|
+
"Verify tenant: `xano tenant:get my-tenant`"
|
|
435
|
+
],
|
|
436
|
+
example: `xano release:create -n v1.0.0 -b dev
|
|
437
|
+
xano tenant:deploy_release my-tenant -r v1.0.0
|
|
438
|
+
xano tenant:get my-tenant`
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "Tenant Environment Setup",
|
|
442
|
+
description: "Create a tenant and configure its environment",
|
|
443
|
+
steps: [
|
|
444
|
+
'Create tenant: `xano tenant:create "My Tenant"`',
|
|
445
|
+
"Set environment variables: `xano tenant:env:set my-tenant -n DB_HOST --value db.example.com`",
|
|
446
|
+
"Set more vars: `xano tenant:env:set my-tenant -n API_KEY --value sk-123`",
|
|
447
|
+
"Deploy a release: `xano tenant:deploy_release my-tenant -r v1.0.0`",
|
|
448
|
+
"Verify env: `xano tenant:env:list my-tenant`"
|
|
449
|
+
],
|
|
450
|
+
example: `xano tenant:create "My Tenant"
|
|
451
|
+
xano tenant:env:set my-tenant -n DB_HOST --value db.example.com
|
|
452
|
+
xano tenant:env:set my-tenant -n API_KEY --value sk-123
|
|
453
|
+
xano tenant:deploy_release my-tenant -r v1.0.0`
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: "Backup and Restore",
|
|
457
|
+
description: "Create, export, and restore tenant backups",
|
|
458
|
+
steps: [
|
|
459
|
+
"Create a backup: `xano tenant:backup:create my-tenant`",
|
|
460
|
+
"List backups: `xano tenant:backup:list my-tenant`",
|
|
461
|
+
"Export backup: `xano tenant:backup:export my-tenant --backup_id 123 --output ./backup.tar.gz`",
|
|
462
|
+
"Restore if needed: `xano tenant:backup:restore my-tenant --backup_id 123`"
|
|
463
|
+
],
|
|
464
|
+
example: `xano tenant:backup:create my-tenant
|
|
465
|
+
xano tenant:backup:list my-tenant
|
|
466
|
+
xano tenant:backup:export my-tenant --backup_id 123 --output ./backup.tar.gz
|
|
467
|
+
|
|
468
|
+
# To restore:
|
|
469
|
+
xano tenant:backup:restore my-tenant --backup_id 123`
|
|
470
|
+
}
|
|
471
|
+
]
|
|
472
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const unitTestDoc = {
|
|
2
|
+
topic: "unit_test",
|
|
3
|
+
title: "Xano CLI - Unit Test Management",
|
|
4
|
+
description: `Unit test commands let you run automated tests on individual Xano functions and endpoints. Tests validate that your functions produce expected outputs for given inputs.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
|
|
8
|
+
- **Unit tests** are created and configured in the Xano dashboard, not via the CLI.
|
|
9
|
+
- The CLI is used to **list and run** tests, making it ideal for CI/CD pipelines.
|
|
10
|
+
- Test output shows PASS/FAIL status with error details for failed tests.
|
|
11
|
+
- Use \`--obj-type\` to filter tests by object type (e.g., function, API endpoint).
|
|
12
|
+
- Use \`--branch\` to run tests against a specific branch.`,
|
|
13
|
+
ai_hints: `**Key concepts:**
|
|
14
|
+
- Unit tests are created in the Xano dashboard; the CLI is for running them
|
|
15
|
+
- Use \`unit_test:run_all\` in CI/CD pipelines for automated testing
|
|
16
|
+
- Output shows PASS/FAIL with error details for each test
|
|
17
|
+
- \`--obj-type\` filters tests by object type (e.g., function, API endpoint)
|
|
18
|
+
- \`--branch\` specifies which branch to test against
|
|
19
|
+
|
|
20
|
+
**CI/CD integration:**
|
|
21
|
+
- Use \`unit_test:run_all -o json\` for machine-readable output
|
|
22
|
+
- Combine with \`workflow_test:run_all\` for full test coverage
|
|
23
|
+
- Filter by branch with \`--branch\` to test specific branches`,
|
|
24
|
+
related_topics: ["workflow_test", "workspace", "function"],
|
|
25
|
+
commands: [
|
|
26
|
+
{
|
|
27
|
+
name: "unit_test:list",
|
|
28
|
+
description: "List unit tests in the workspace",
|
|
29
|
+
usage: "xano unit_test:list [options]",
|
|
30
|
+
flags: [
|
|
31
|
+
{ name: "branch", short: "b", type: "string", required: false, description: "Branch to list tests from" },
|
|
32
|
+
{ name: "obj-type", type: "string", required: false, description: "Filter by object type" },
|
|
33
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
34
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
35
|
+
],
|
|
36
|
+
examples: [
|
|
37
|
+
"xano unit_test:list",
|
|
38
|
+
"xano unit_test:list --branch dev",
|
|
39
|
+
"xano unit_test:list --obj-type function -o json"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "unit_test:run",
|
|
44
|
+
description: "Run a single unit test by ID",
|
|
45
|
+
usage: "xano unit_test:run <unit_test_id> [options]",
|
|
46
|
+
args: [
|
|
47
|
+
{ name: "unit_test_id", required: true, description: "ID of the unit test to run" }
|
|
48
|
+
],
|
|
49
|
+
flags: [
|
|
50
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
51
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
52
|
+
],
|
|
53
|
+
examples: [
|
|
54
|
+
"xano unit_test:run 123",
|
|
55
|
+
"xano unit_test:run 123 -o json"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "unit_test:run_all",
|
|
60
|
+
description: "Run all unit tests in the workspace",
|
|
61
|
+
usage: "xano unit_test:run_all [options]",
|
|
62
|
+
flags: [
|
|
63
|
+
{ name: "branch", short: "b", type: "string", required: false, description: "Branch to run tests against" },
|
|
64
|
+
{ name: "obj-type", type: "string", required: false, description: "Filter by object type" },
|
|
65
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
66
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
67
|
+
],
|
|
68
|
+
examples: [
|
|
69
|
+
"xano unit_test:run_all",
|
|
70
|
+
"xano unit_test:run_all --branch dev -o json",
|
|
71
|
+
"xano unit_test:run_all --obj-type function"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
workflows: [
|
|
76
|
+
{
|
|
77
|
+
name: "Run Tests in CI/CD",
|
|
78
|
+
description: "Run all unit tests as part of a CI/CD pipeline",
|
|
79
|
+
steps: [
|
|
80
|
+
"List available tests: `xano unit_test:list`",
|
|
81
|
+
"Run all tests: `xano unit_test:run_all`",
|
|
82
|
+
"Check output for PASS/FAIL results"
|
|
83
|
+
],
|
|
84
|
+
example: `xano unit_test:list
|
|
85
|
+
xano unit_test:run_all -o json`
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
};
|