@xano/developer-mcp 1.0.29 → 1.0.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/dist/cli_docs/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { formatDocumentation } from "./format.js";
|
|
|
9
9
|
import { startDoc } from "./topics/start.js";
|
|
10
10
|
import { profileDoc } from "./topics/profile.js";
|
|
11
11
|
import { workspaceDoc } from "./topics/workspace.js";
|
|
12
|
+
import { branchDoc } from "./topics/branch.js";
|
|
12
13
|
import { functionDoc } from "./topics/function.js";
|
|
13
14
|
import { runDoc } from "./topics/run.js";
|
|
14
15
|
import { staticHostDoc } from "./topics/static_host.js";
|
|
@@ -20,6 +21,7 @@ export const topics = {
|
|
|
20
21
|
start: startDoc,
|
|
21
22
|
profile: profileDoc,
|
|
22
23
|
workspace: workspaceDoc,
|
|
24
|
+
branch: branchDoc,
|
|
23
25
|
function: functionDoc,
|
|
24
26
|
run: runDoc,
|
|
25
27
|
static_host: staticHostDoc,
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export const branchDoc = {
|
|
2
|
+
topic: "branch",
|
|
3
|
+
title: "Xano CLI - Branch Management",
|
|
4
|
+
description: `Branch commands let you manage Xano workspace branches from the CLI. Branches allow you to work on different versions of your workspace (development, staging, production, etc.) without affecting the live version.
|
|
5
|
+
|
|
6
|
+
## Key Concepts
|
|
7
|
+
|
|
8
|
+
- **v1 branch**: The default branch that always exists. Cannot be deleted or renamed.
|
|
9
|
+
- **Live branch**: The branch serving production API requests. Can be changed with \`branch:set-live\`.
|
|
10
|
+
- **Backup branches**: Created by automated backup features, marked as backup in listings.
|
|
11
|
+
|
|
12
|
+
## Branch Identification
|
|
13
|
+
|
|
14
|
+
Branches are identified by their **label** (e.g., "v1", "dev", "staging"), not numeric IDs.`,
|
|
15
|
+
ai_hints: `**Key concepts:**
|
|
16
|
+
- Branches are identified by label (string), not ID
|
|
17
|
+
- "v1" is the default branch and cannot be deleted
|
|
18
|
+
- Live branch handles all production API traffic
|
|
19
|
+
- Use \`branch:list\` to see all branches in a workspace
|
|
20
|
+
- Use \`branch:set-live\` carefully - it affects production traffic
|
|
21
|
+
|
|
22
|
+
**Typical workflow:**
|
|
23
|
+
1. \`xano branch:list\` - see available branches
|
|
24
|
+
2. \`xano branch:create --label dev\` - create new branch from v1
|
|
25
|
+
3. Work on dev branch (pull/push with -b flag)
|
|
26
|
+
4. \`xano branch:set-live dev\` - promote to production
|
|
27
|
+
|
|
28
|
+
**Workspace ID:**
|
|
29
|
+
- Most commands need a workspace ID
|
|
30
|
+
- Pass via \`--workspace\` flag or configure in profile
|
|
31
|
+
- Use \`xano workspace:list\` to find workspace IDs`,
|
|
32
|
+
related_topics: ["workspace", "profile", "integration"],
|
|
33
|
+
commands: [
|
|
34
|
+
{
|
|
35
|
+
name: "branch:list",
|
|
36
|
+
description: "List all branches in a workspace",
|
|
37
|
+
usage: "xano branch:list [workspace_id] [options]",
|
|
38
|
+
args: [
|
|
39
|
+
{ name: "workspace_id", required: false, description: "Workspace ID (uses profile workspace if not provided)" }
|
|
40
|
+
],
|
|
41
|
+
flags: [
|
|
42
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
43
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
44
|
+
],
|
|
45
|
+
examples: [
|
|
46
|
+
"xano branch:list",
|
|
47
|
+
"xano branch:list 123",
|
|
48
|
+
"xano branch:list --output json"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "branch:get",
|
|
53
|
+
description: "Get details for a specific branch",
|
|
54
|
+
usage: "xano branch:get <branch_label> [options]",
|
|
55
|
+
args: [
|
|
56
|
+
{ name: "branch_label", required: true, description: 'Branch label (e.g., "v1", "dev")' }
|
|
57
|
+
],
|
|
58
|
+
flags: [
|
|
59
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
|
|
60
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
61
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
62
|
+
],
|
|
63
|
+
examples: [
|
|
64
|
+
"xano branch:get v1",
|
|
65
|
+
"xano branch:get dev -w 123",
|
|
66
|
+
"xano branch:get staging --output json"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "branch:create",
|
|
71
|
+
description: "Create a new branch by cloning from an existing branch",
|
|
72
|
+
usage: "xano branch:create --label <label> [options]",
|
|
73
|
+
flags: [
|
|
74
|
+
{ name: "label", short: "l", type: "string", required: true, description: "Label for the new branch" },
|
|
75
|
+
{ name: "source", short: "s", type: "string", required: false, default: "v1", description: 'Source branch to clone from (defaults to "v1")' },
|
|
76
|
+
{ name: "description", short: "d", type: "string", required: false, description: "Description for the new branch" },
|
|
77
|
+
{ name: "color", short: "c", type: "string", required: false, description: 'Color hex code for the branch (e.g., "#ebc346")' },
|
|
78
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
|
|
79
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
80
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
81
|
+
],
|
|
82
|
+
examples: [
|
|
83
|
+
"xano branch:create --label dev",
|
|
84
|
+
'xano branch:create -l feature-auth -s dev -d "Authentication feature"',
|
|
85
|
+
'xano branch:create --label staging --color "#ebc346" --output json'
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "branch:edit",
|
|
90
|
+
description: 'Update an existing branch (cannot update "v1" label)',
|
|
91
|
+
usage: "xano branch:edit <branch_label> [options]",
|
|
92
|
+
args: [
|
|
93
|
+
{ name: "branch_label", required: true, description: 'Branch label to edit (cannot edit "v1" label)' }
|
|
94
|
+
],
|
|
95
|
+
flags: [
|
|
96
|
+
{ name: "label", short: "l", type: "string", required: false, description: "New label for the branch" },
|
|
97
|
+
{ name: "description", short: "d", type: "string", required: false, description: "New description for the branch" },
|
|
98
|
+
{ name: "color", short: "c", type: "string", required: false, description: 'New color hex code for the branch (e.g., "#ff5733")' },
|
|
99
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
|
|
100
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
101
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
102
|
+
],
|
|
103
|
+
examples: [
|
|
104
|
+
"xano branch:edit dev --label development",
|
|
105
|
+
'xano branch:edit feature-auth -l feature-authentication --color "#ff5733"',
|
|
106
|
+
'xano branch:edit staging --description "Staging environment" -o json'
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "branch:delete",
|
|
111
|
+
description: 'Delete a branch (cannot delete "v1" or the live branch)',
|
|
112
|
+
usage: "xano branch:delete <branch_label> [options]",
|
|
113
|
+
args: [
|
|
114
|
+
{ name: "branch_label", required: true, description: 'Branch label to delete (cannot delete "v1" or the live branch)' }
|
|
115
|
+
],
|
|
116
|
+
flags: [
|
|
117
|
+
{ name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
|
|
118
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
|
|
119
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
120
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
121
|
+
],
|
|
122
|
+
examples: [
|
|
123
|
+
"xano branch:delete feature-old",
|
|
124
|
+
"xano branch:delete dev --force",
|
|
125
|
+
"xano branch:delete staging -f -o json"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "branch:set-live",
|
|
130
|
+
description: "Set a branch as the live (active) branch for API requests",
|
|
131
|
+
usage: "xano branch:set-live <branch_label> [options]",
|
|
132
|
+
args: [
|
|
133
|
+
{ name: "branch_label", required: true, description: 'Branch label to set as live (use "v1" for default branch)' }
|
|
134
|
+
],
|
|
135
|
+
flags: [
|
|
136
|
+
{ name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
|
|
137
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
|
|
138
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
139
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
140
|
+
],
|
|
141
|
+
examples: [
|
|
142
|
+
"xano branch:set-live staging",
|
|
143
|
+
"xano branch:set-live v1 --force",
|
|
144
|
+
"xano branch:set-live production -f -o json"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
workflows: [
|
|
149
|
+
{
|
|
150
|
+
name: "Development Branch Setup",
|
|
151
|
+
description: "Create a development branch for safe experimentation",
|
|
152
|
+
steps: [
|
|
153
|
+
"List existing branches: `xano branch:list`",
|
|
154
|
+
"Create dev branch from v1: `xano branch:create --label dev`",
|
|
155
|
+
"Pull dev branch code: `xano workspace:pull ./dev-code -b dev`",
|
|
156
|
+
"Make changes and push: `xano workspace:push ./dev-code -b dev`",
|
|
157
|
+
"Test changes in dev environment"
|
|
158
|
+
],
|
|
159
|
+
example: `xano branch:list
|
|
160
|
+
xano branch:create --label dev
|
|
161
|
+
xano workspace:pull ./dev -b dev
|
|
162
|
+
# Make changes...
|
|
163
|
+
xano workspace:push ./dev -b dev`
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "Feature Branch Workflow",
|
|
167
|
+
description: "Work on a feature in isolation before merging",
|
|
168
|
+
steps: [
|
|
169
|
+
"Create feature branch from dev: `xano branch:create -l feature-auth -s dev`",
|
|
170
|
+
"Pull and work on feature branch",
|
|
171
|
+
"Test feature thoroughly",
|
|
172
|
+
"Delete feature branch when done: `xano branch:delete feature-auth`"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "Promote to Production",
|
|
177
|
+
description: "Deploy tested changes to production",
|
|
178
|
+
steps: [
|
|
179
|
+
"Verify staging branch is ready",
|
|
180
|
+
"Check current live branch: `xano branch:list`",
|
|
181
|
+
"Set staging as live: `xano branch:set-live staging`",
|
|
182
|
+
"Monitor for issues",
|
|
183
|
+
"Rollback if needed: `xano branch:set-live v1 --force`"
|
|
184
|
+
],
|
|
185
|
+
example: `# Check branches
|
|
186
|
+
xano branch:list
|
|
187
|
+
|
|
188
|
+
# Promote staging to live
|
|
189
|
+
xano branch:set-live staging
|
|
190
|
+
|
|
191
|
+
# If issues occur, rollback
|
|
192
|
+
xano branch:set-live v1 --force`
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
};
|
|
@@ -71,7 +71,7 @@ The CLI uses both APIs internally.`,
|
|
|
71
71
|
**If CLI not installed:**
|
|
72
72
|
- Recommend installation: \`npm install -g @xano/cli\`
|
|
73
73
|
- Or use Meta API endpoints directly for equivalent functionality
|
|
74
|
-
- The multidoc endpoint (\`/api:meta/
|
|
74
|
+
- The multidoc endpoint (\`/api:meta/workspace/{id}/multidoc\`) provides pull/push functionality
|
|
75
75
|
|
|
76
76
|
**Token reuse (if CLI is installed):**
|
|
77
77
|
The same access token works for both:
|
|
@@ -44,6 +44,79 @@ When you pull, the CLI splits these into individual \`.xs\` files organized by t
|
|
|
44
44
|
usage: "xano workspace:list [-p <profile>]",
|
|
45
45
|
examples: ["xano workspace:list", "xano workspace:list -p production"]
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
name: "workspace:get",
|
|
49
|
+
description: "Get details of a specific workspace",
|
|
50
|
+
usage: "xano workspace:get [workspace_id] [options]",
|
|
51
|
+
args: [
|
|
52
|
+
{ name: "workspace_id", required: false, description: "Workspace ID (uses profile workspace if not provided)" }
|
|
53
|
+
],
|
|
54
|
+
flags: [
|
|
55
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
56
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
57
|
+
],
|
|
58
|
+
examples: [
|
|
59
|
+
"xano workspace:get 123",
|
|
60
|
+
"xano workspace:get --output json",
|
|
61
|
+
"xano workspace:get 456 -p production -o json"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "workspace:create",
|
|
66
|
+
description: "Create a new workspace via the Xano Metadata API",
|
|
67
|
+
usage: "xano workspace:create --name <name> [options]",
|
|
68
|
+
flags: [
|
|
69
|
+
{ name: "name", short: "n", type: "string", required: true, description: "Name of the workspace" },
|
|
70
|
+
{ name: "description", short: "d", type: "string", required: false, description: "Description for the workspace" },
|
|
71
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
72
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
73
|
+
],
|
|
74
|
+
examples: [
|
|
75
|
+
'xano workspace:create --name "my-workspace"',
|
|
76
|
+
'xano workspace:create --name "my-app" --description "My application workspace"',
|
|
77
|
+
'xano workspace:create -n "new-project" -d "New project workspace" -o json'
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "workspace:edit",
|
|
82
|
+
description: "Edit an existing workspace via the Xano Metadata API",
|
|
83
|
+
usage: "xano workspace:edit [workspace_id] [options]",
|
|
84
|
+
args: [
|
|
85
|
+
{ name: "workspace_id", required: false, description: "Workspace ID to edit (uses profile workspace if not provided)" }
|
|
86
|
+
],
|
|
87
|
+
flags: [
|
|
88
|
+
{ name: "name", short: "n", type: "string", required: false, description: "New name for the workspace" },
|
|
89
|
+
{ name: "description", short: "d", type: "string", required: false, description: "New description for the workspace" },
|
|
90
|
+
{ name: "swagger", type: "boolean", required: false, description: "Enable or disable swagger documentation (--swagger or --no-swagger)" },
|
|
91
|
+
{ name: "require-token", type: "boolean", required: false, description: "Require token for documentation access (--require-token or --no-require-token)" },
|
|
92
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
93
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
94
|
+
],
|
|
95
|
+
examples: [
|
|
96
|
+
'xano workspace:edit 123 --name "new-name"',
|
|
97
|
+
'xano workspace:edit --name "updated-workspace" --description "Updated description"',
|
|
98
|
+
"xano workspace:edit 123 --swagger --require-token",
|
|
99
|
+
"xano workspace:edit 123 --no-swagger -o json"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "workspace:delete",
|
|
104
|
+
description: "Delete a workspace via the Xano Metadata API. Cannot delete workspaces with active tenants.",
|
|
105
|
+
usage: "xano workspace:delete <workspace_id> [options]",
|
|
106
|
+
args: [
|
|
107
|
+
{ name: "workspace_id", required: true, description: "Workspace ID to delete" }
|
|
108
|
+
],
|
|
109
|
+
flags: [
|
|
110
|
+
{ name: "force", short: "f", type: "boolean", required: false, default: "false", description: "Skip confirmation prompt" },
|
|
111
|
+
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
|
|
112
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
|
|
113
|
+
],
|
|
114
|
+
examples: [
|
|
115
|
+
"xano workspace:delete 123",
|
|
116
|
+
"xano workspace:delete 123 --force",
|
|
117
|
+
"xano workspace:delete 123 -f -o json"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
47
120
|
{
|
|
48
121
|
name: "workspace:pull",
|
|
49
122
|
description: "Download workspace code to local directory",
|