@xano/developer-mcp 1.0.72 → 1.0.74

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 CHANGED
@@ -529,13 +529,13 @@ Use this tool to understand CLI commands for local development, code synchroniza
529
529
  | `auth` | Browser-based OAuth authentication |
530
530
  | `profile` | Profile management - credentials and multi-environment setup |
531
531
  | `workspace` | Workspace operations - pull/push code sync, git integration |
532
+ | `sandbox` | Personal auto-provisioned dev environment (free-tier friendly) |
532
533
  | `branch` | Branch management - list, switch, create, and delete branches |
533
534
  | `function` | Function management - list, get, create, edit |
534
535
  | `release` | Release management - create, export, import, pull, push |
535
536
  | `tenant` | Tenant management - CRUD, deployments, env vars, backups, clusters |
536
537
  | `unit_test` | Unit test management - list and run unit tests |
537
538
  | `workflow_test` | Workflow test management - list, run, and manage workflow tests |
538
- | `run` | Run API commands - execute code, manage projects/sessions |
539
539
  | `platform` | Platform management - list and view platform versions |
540
540
  | `static_host` | Static hosting - deploy frontend builds |
541
541
  | `update` | Update the CLI to the latest version |
@@ -16,7 +16,7 @@ import { releaseDoc } from "./topics/release.js";
16
16
  import { tenantDoc } from "./topics/tenant.js";
17
17
  import { unitTestDoc } from "./topics/unit_test.js";
18
18
  import { workflowTestDoc } from "./topics/workflow_test.js";
19
- import { runDoc } from "./topics/run.js";
19
+ import { sandboxDoc } from "./topics/sandbox.js";
20
20
  import { platformDoc } from "./topics/platform.js";
21
21
  import { staticHostDoc } from "./topics/static_host.js";
22
22
  import { updateDoc } from "./topics/update.js";
@@ -35,7 +35,7 @@ export const topics = {
35
35
  tenant: tenantDoc,
36
36
  unit_test: unitTestDoc,
37
37
  workflow_test: workflowTestDoc,
38
- run: runDoc,
38
+ sandbox: sandboxDoc,
39
39
  platform: platformDoc,
40
40
  static_host: staticHostDoc,
41
41
  update: updateDoc,
@@ -88,7 +88,7 @@ ${getTopicDescriptions()}
88
88
  - Start with "start" topic for installation and setup
89
89
  - Use "auth" or "profile" to understand authentication options
90
90
  - Use "integration" to understand when to use CLI vs Meta API
91
- - Use specific topics for command reference (workspace, branch, release, tenant, function, run, etc.)`,
91
+ - Use specific topics for command reference (workspace, sandbox, branch, release, tenant, function, etc.)`,
92
92
  inputSchema: {
93
93
  type: "object",
94
94
  properties: {
@@ -96,7 +96,7 @@ ${getTopicDescriptions()}
96
96
  type: "string",
97
97
  enum: getTopicNames(),
98
98
  description: "Documentation topic to retrieve. Start with 'start' for installation and setup. " +
99
- "Example: topic='function' for function management commands, topic='run' for running XanoScript locally.",
99
+ "Example: topic='function' for function management commands, topic='sandbox' for the personal dev environment.",
100
100
  },
101
101
  detail_level: {
102
102
  type: "string",
@@ -12,33 +12,37 @@ export const authDoc = {
12
12
  5. Saves the profile to \`~/.xano/credentials.yaml\`
13
13
 
14
14
  The authentication flow has a 5-minute timeout.`,
15
- ai_hints: `**auth vs profile:wizard:**
15
+ ai_hints: `**auth vs profile wizard:**
16
16
  - \`xano auth\` - Browser-based OAuth login (recommended for interactive use)
17
- - \`xano profile:wizard\` - Token-based interactive setup (requires manually copying token)
18
- - \`xano profile:create\` - Non-interactive, requires all flags
17
+ - \`xano profile wizard\` - Token-based interactive setup (requires manually copying token)
18
+ - \`xano profile create\` - Non-interactive, requires all flags
19
19
 
20
20
  **When to suggest auth:**
21
21
  - User is setting up CLI for the first time
22
22
  - User doesn't have an access token handy
23
23
  - User prefers browser-based login
24
24
 
25
- **When to suggest profile:wizard instead:**
25
+ **When to suggest profile wizard instead:**
26
26
  - User already has an access token
27
27
  - User is in a headless/SSH environment without browser access
28
- - User needs non-interactive setup (CI/CD)`,
29
- related_topics: ["profile", "start"],
28
+ - User needs non-interactive setup (CI/CD)
29
+
30
+ **After auth, suggest \`xano sandbox\`:**
31
+ The sandbox is a free-tier personal dev environment (auto-provisioned singleton tenant) ideal for experimenting without touching production.`,
32
+ related_topics: ["profile", "start", "sandbox"],
30
33
  commands: [
31
34
  {
32
35
  name: "auth",
33
36
  description: "Authenticate with Xano via browser login. Opens your browser to log in and automatically creates a CLI profile.",
34
37
  usage: "xano auth [options]",
35
38
  flags: [
36
- { name: "origin", type: "string", required: false, description: "Xano account origin URL (e.g., https://app.xano.com)" },
37
- { name: "insecure", short: "k", type: "boolean", required: false, description: "Skip TLS certificate verification (for self-signed certs)" }
39
+ { name: "origin", short: "o", type: "string", required: false, default: "https://app.xano.com", description: "Xano account origin URL. Use this to point at a custom/self-hosted Xano instance." },
40
+ { name: "insecure", short: "k", type: "boolean", required: false, description: "Skip TLS certificate verification (for self-signed certificates)" },
41
+ { name: "config", short: "c", type: "string", required: false, description: "Path to credentials file (default: ~/.xano/credentials.yaml). Env: XANO_CONFIG" }
38
42
  ],
39
43
  examples: [
40
44
  "xano auth",
41
- "xano auth --origin https://app.xano.com",
45
+ "xano auth --origin https://custom.xano.com",
42
46
  "xano auth -k # for self-signed certificates"
43
47
  ]
44
48
  }
@@ -52,11 +56,12 @@ The authentication flow has a 5-minute timeout.`,
52
56
  "Run: `xano auth`",
53
57
  "Log in via your browser when it opens",
54
58
  "Select your instance, workspace, and branch",
55
- "Verify: `xano profile:me`"
59
+ "Verify: `xano profile me`",
60
+ "(Optional) Spin up a personal dev environment: `xano sandbox`"
56
61
  ],
57
62
  example: `npm install -g @xano/cli
58
63
  xano auth
59
- xano profile:me`
64
+ xano profile me`
60
65
  }
61
66
  ]
62
67
  };
@@ -5,143 +5,152 @@ export const branchDoc = {
5
5
 
6
6
  ## Key Concepts
7
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\`.
8
+ - **v1 branch**: The default branch that always exists. It cannot be created or deleted, and its label cannot be changed.
9
+ - **Live branch**: The branch serving production API requests. Can be changed with \`branch set_live\`.
10
10
  - **Backup branches**: Created by automated backup features, marked as backup in listings.
11
11
 
12
12
  ## Branch Identification
13
13
 
14
- Branches are identified by their **label** (e.g., "v1", "dev", "staging"), not numeric IDs.`,
14
+ Branches are identified by their **label** (e.g., "v1", "dev", "staging"), not numeric IDs.
15
+
16
+ ## Syntax note
17
+
18
+ Xano CLI commands are SPACE-separated (e.g. \`xano branch list\`), not colon-separated.`,
15
19
  ai_hints: `**Key concepts:**
16
20
  - Branches are identified by label (string), not ID
17
- - "v1" is the default branch and cannot be deleted
21
+ - "v1" is the default branch and cannot be created, renamed, or deleted
18
22
  - 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
23
+ - Use \`branch list\` to see all branches in a workspace
24
+ - Use \`branch set_live\` carefully - it affects production traffic
21
25
 
22
26
  **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
+ 1. \`xano branch list\` - see available branches
28
+ 2. \`xano branch create dev\` - create new branch (label is positional; clones from v1 by default)
29
+ 3. Work on dev branch (workspace pull/push with -b flag)
30
+ 4. \`xano branch set_live dev\` - promote to production
31
+
32
+ **Argument style:**
33
+ - \`branch create\`, \`branch edit\`, \`branch get\`, \`branch delete\`, and \`branch set_live\` take the branch label as a POSITIONAL argument, not a flag
34
+ - \`branch create\` accepts \`-s/--source\` for the source branch (default: \`v1\`)
27
35
 
28
36
  **Workspace ID:**
29
37
  - 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", "release", "profile", "integration"],
38
+ - Pass via \`-w/--workspace\` flag or configure in profile
39
+ - \`branch list\` accepts the workspace flag as a string; \`branch get\`/\`create\`/\`edit\`/\`delete\`/\`set_live\` require an integer ID
40
+ - Use \`xano workspace list\` to find workspace IDs`,
41
+ related_topics: ["workspace", "release", "profile", "sandbox", "integration"],
33
42
  commands: [
34
43
  {
35
- name: "branch:list",
44
+ name: "branch list",
36
45
  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
- ],
46
+ usage: "xano branch list [options]",
41
47
  flags: [
48
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
42
49
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
43
50
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
44
51
  ],
45
52
  examples: [
46
- "xano branch:list",
47
- "xano branch:list 123",
48
- "xano branch:list --output json"
53
+ "xano branch list",
54
+ "xano branch list -w 123",
55
+ "xano branch list --output json"
49
56
  ]
50
57
  },
51
58
  {
52
- name: "branch:get",
59
+ name: "branch get",
53
60
  description: "Get details for a specific branch",
54
- usage: "xano branch:get <branch_label> [options]",
61
+ usage: "xano branch get <branch_label> [options]",
55
62
  args: [
56
63
  { name: "branch_label", required: true, description: 'Branch label (e.g., "v1", "dev")' }
57
64
  ],
58
65
  flags: [
59
- { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
66
+ { name: "workspace", short: "w", type: "integer", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
60
67
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
61
68
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
62
69
  ],
63
70
  examples: [
64
- "xano branch:get v1",
65
- "xano branch:get dev -w 123",
66
- "xano branch:get staging --output json"
71
+ "xano branch get v1",
72
+ "xano branch get dev -w 123",
73
+ "xano branch get staging --output json"
67
74
  ]
68
75
  },
69
76
  {
70
- name: "branch:create",
71
- description: "Create a new branch by cloning from an existing branch",
72
- usage: "xano branch:create --label <label> [options]",
77
+ name: "branch create",
78
+ description: 'Create a new branch by cloning from an existing branch. The branch label is a positional argument. Cannot create a branch named "v1".',
79
+ usage: "xano branch create <label> [options]",
80
+ args: [
81
+ { name: "label", required: true, description: 'Label for the new branch (cannot be "v1")' }
82
+ ],
73
83
  flags: [
74
- { name: "label", short: "l", type: "string", required: true, description: "Label for the new branch" },
75
84
  { name: "source", short: "s", type: "string", required: false, default: "v1", description: 'Source branch to clone from (defaults to "v1")' },
76
85
  { 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)" },
86
+ { name: "color", short: "c", type: "string", required: false, description: 'Color hex code for the branch (e.g., "#ebc346"). Note: on `branch create`, `-c` is taken by --color; use --config (no short) for the credentials file path.' },
87
+ { name: "workspace", short: "w", type: "integer", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
79
88
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
80
89
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
81
90
  ],
82
91
  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'
92
+ "xano branch create dev",
93
+ 'xano branch create feature-auth -s dev -d "Authentication feature"',
94
+ 'xano branch create staging --color "#ebc346" --output json'
86
95
  ]
87
96
  },
88
97
  {
89
- name: "branch:edit",
90
- description: 'Update an existing branch (cannot update "v1" label)',
91
- usage: "xano branch:edit <branch_label> [options]",
98
+ name: "branch edit",
99
+ description: 'Update an existing branch (cannot edit the "v1" branch)',
100
+ usage: "xano branch edit <branch_label> [options]",
92
101
  args: [
93
- { name: "branch_label", required: true, description: 'Branch label to edit (cannot edit "v1" label)' }
102
+ { name: "branch_label", required: true, description: 'Branch label to edit (cannot edit "v1")' }
94
103
  ],
95
104
  flags: [
96
105
  { name: "label", short: "l", type: "string", required: false, description: "New label for the branch" },
97
106
  { name: "description", short: "d", type: "string", required: false, description: "New description for the branch" },
98
107
  { 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)" },
108
+ { name: "workspace", short: "w", type: "integer", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
100
109
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
101
110
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
102
111
  ],
103
112
  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'
113
+ "xano branch edit dev --label development",
114
+ 'xano branch edit feature-auth -l feature-authentication --color "#ff5733"',
115
+ 'xano branch edit staging --description "Staging environment" -o json'
107
116
  ]
108
117
  },
109
118
  {
110
- name: "branch:delete",
119
+ name: "branch delete",
111
120
  description: 'Delete a branch (cannot delete "v1" or the live branch)',
112
- usage: "xano branch:delete <branch_label> [options]",
121
+ usage: "xano branch delete <branch_label> [options]",
113
122
  args: [
114
123
  { name: "branch_label", required: true, description: 'Branch label to delete (cannot delete "v1" or the live branch)' }
115
124
  ],
116
125
  flags: [
117
126
  { 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)" },
127
+ { name: "workspace", short: "w", type: "integer", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
119
128
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
120
129
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
121
130
  ],
122
131
  examples: [
123
- "xano branch:delete feature-old",
124
- "xano branch:delete dev --force",
125
- "xano branch:delete staging -f -o json"
132
+ "xano branch delete feature-old",
133
+ "xano branch delete dev --force",
134
+ "xano branch delete staging -f -o json"
126
135
  ]
127
136
  },
128
137
  {
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]",
138
+ name: "branch set_live",
139
+ description: "Set a branch as the live (active) branch for API requests. Affects production traffic immediately.",
140
+ usage: "xano branch set_live <branch_label> [options]",
132
141
  args: [
133
- { name: "branch_label", required: true, description: 'Branch label to set as live (use "v1" for default branch)' }
142
+ { name: "branch_label", required: true, description: 'Branch label to set as live (use "v1" to revert to the default branch)' }
134
143
  ],
135
144
  flags: [
136
145
  { 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)" },
146
+ { name: "workspace", short: "w", type: "integer", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
138
147
  { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" },
139
148
  { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" }
140
149
  ],
141
150
  examples: [
142
- "xano branch:set-live staging",
143
- "xano branch:set-live v1 --force",
144
- "xano branch:set-live production -f -o json"
151
+ "xano branch set_live staging",
152
+ "xano branch set_live v1 --force",
153
+ "xano branch set_live production -f -o json"
145
154
  ]
146
155
  }
147
156
  ],
@@ -150,26 +159,26 @@ Branches are identified by their **label** (e.g., "v1", "dev", "staging"), not n
150
159
  name: "Development Branch Setup",
151
160
  description: "Create a development branch for safe experimentation",
152
161
  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`",
162
+ "List existing branches: `xano branch list`",
163
+ "Create dev branch from v1: `xano branch create dev`",
164
+ "Pull dev branch code: `xano workspace pull -d ./dev-code -b dev`",
165
+ "Make changes and push: `xano workspace push -d ./dev-code -b dev`",
157
166
  "Test changes in dev environment"
158
167
  ],
159
- example: `xano branch:list
160
- xano branch:create --label dev
161
- xano workspace:pull ./dev -b dev
168
+ example: `xano branch list
169
+ xano branch create dev
170
+ xano workspace pull -d ./dev -b dev
162
171
  # Make changes...
163
- xano workspace:push ./dev -b dev`
172
+ xano workspace push -d ./dev -b dev`
164
173
  },
165
174
  {
166
175
  name: "Feature Branch Workflow",
167
176
  description: "Work on a feature in isolation before merging",
168
177
  steps: [
169
- "Create feature branch from dev: `xano branch:create -l feature-auth -s dev`",
178
+ "Create feature branch from dev: `xano branch create feature-auth -s dev`",
170
179
  "Pull and work on feature branch",
171
180
  "Test feature thoroughly",
172
- "Delete feature branch when done: `xano branch:delete feature-auth`"
181
+ "Delete feature branch when done: `xano branch delete feature-auth`"
173
182
  ]
174
183
  },
175
184
  {
@@ -177,19 +186,19 @@ xano workspace:push ./dev -b dev`
177
186
  description: "Deploy tested changes to production",
178
187
  steps: [
179
188
  "Verify staging branch is ready",
180
- "Check current live branch: `xano branch:list`",
181
- "Set staging as live: `xano branch:set-live staging`",
189
+ "Check current live branch: `xano branch list`",
190
+ "Set staging as live: `xano branch set_live staging`",
182
191
  "Monitor for issues",
183
- "Rollback if needed: `xano branch:set-live v1 --force`"
192
+ "Rollback if needed: `xano branch set_live v1 --force`"
184
193
  ],
185
194
  example: `# Check branches
186
- xano branch:list
195
+ xano branch list
187
196
 
188
197
  # Promote staging to live
189
- xano branch:set-live staging
198
+ xano branch set_live staging
190
199
 
191
200
  # If issues occur, rollback
192
- xano branch:set-live v1 --force`
201
+ xano branch set_live v1 --force`
193
202
  }
194
203
  ]
195
204
  };
@@ -1,97 +1,115 @@
1
1
  export const functionDoc = {
2
2
  topic: "function",
3
3
  title: "Xano CLI - Function Management",
4
- description: `Function commands let you list, view, create, and edit individual Xano functions. This is useful for quick edits or when you don't need to sync the entire workspace.`,
4
+ description: `Function commands let you list, view, create, and edit individual Xano functions. This is useful for quick edits or when you don't need to sync the entire workspace.
5
+
6
+ ## Syntax note
7
+
8
+ Xano CLI commands are SPACE-separated (e.g. \`xano function list\`), not colon-separated.`,
5
9
  ai_hints: `**When to use function commands vs workspace commands:**
6
- - Use \`function:*\` for quick single-function edits
7
- - Use \`workspace:pull/push\` for bulk operations or version control
10
+ - Use \`function *\` subcommands for quick single-function edits
11
+ - Use \`workspace pull\`/\`workspace push\` for bulk operations or version control
12
+ - Use \`sandbox\` for isolated iteration without touching the live workspace
8
13
 
9
14
  **Output formats:**
10
15
  - \`summary\` - Human-readable table
11
16
  - \`json\` - Full metadata (good for scripting)
12
- - \`xs\` - Raw XanoScript code only
17
+ - \`xs\` - Raw XanoScript code only (available on \`function get\`)
13
18
 
14
19
  **Editor integration:**
15
- - Commands use \`$EDITOR\` environment variable
16
- - Set to your preferred editor: \`export EDITOR=vim\`
17
- - Use \`--edit\` flag to open in editor before create/update`,
18
- related_topics: ["workspace", "run"],
20
+ - On \`function edit\` with no flags (besides the function_id): CLI fetches the current code from the API and opens it directly in \`$EDITOR\`. No temp file or \`--file\` required. This is the easiest interactive workflow.
21
+ - \`--edit\` flag opens the file in \`$EDITOR\` before create/update
22
+ - On \`function create\` and \`function edit\`, \`--edit\` requires \`--file\`
23
+ - Set your editor: \`export EDITOR=vim\`
24
+
25
+ **Draft / publish:**
26
+ - \`function edit\` publishes by default; use \`--no-publish\` to save as draft only
27
+ - Use \`--include_draft\` on \`function get\` / \`function list\` to see draft versions`,
28
+ related_topics: ["workspace", "sandbox", "branch"],
19
29
  commands: [
20
30
  {
21
- name: "function:list",
31
+ name: "function list",
22
32
  description: "List all functions in the workspace",
23
- usage: "xano function:list [options]",
33
+ usage: "xano function list [options]",
24
34
  flags: [
25
- { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
26
- { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary, json" },
27
- { name: "page", type: "number", required: false, default: "1", description: "Page number" },
28
- { name: "per_page", type: "number", required: false, default: "50", description: "Items per page" },
29
- { name: "search", type: "string", required: false, description: "Search by name" },
30
- { name: "sort", type: "string", required: false, description: "Sort field" },
31
- { name: "order", type: "string", required: false, description: "Sort order: asc, desc" },
32
- { name: "include_draft", type: "boolean", required: false, description: "Include draft versions" },
33
- { name: "include_xanoscript", type: "boolean", required: false, description: "Include XanoScript source in output" }
35
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
36
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" },
37
+ { name: "page", type: "number", required: false, default: "1", description: "Page number for pagination" },
38
+ { name: "per_page", type: "number", required: false, default: "50", description: "Number of results per page" },
39
+ { name: "sort", type: "string", required: false, default: "created_at", description: "Sort field" },
40
+ { name: "order", type: "string", required: false, default: "desc", description: "Sort order: asc or desc" },
41
+ { name: "include_draft", type: "boolean", required: false, default: "false", description: "Include draft versions in the list" },
42
+ { name: "include_xanoscript", type: "boolean", required: false, default: "false", description: "Include XanoScript source in JSON output" },
43
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
34
44
  ],
35
45
  examples: [
36
- "xano function:list",
37
- "xano function:list --search auth",
38
- "xano function:list -o json --include_draft"
46
+ "xano function list",
47
+ "xano function list -w 40",
48
+ "xano function list -o json --include_draft",
49
+ "xano function list --sort name --order asc --per_page 100"
39
50
  ]
40
51
  },
41
52
  {
42
- name: "function:get",
43
- description: "Get a specific function by ID",
44
- usage: "xano function:get [function_id] [options]",
53
+ name: "function get",
54
+ description: "Get a specific function by ID. If function_id is omitted, an interactive picker is shown.",
55
+ usage: "xano function get [function_id] [options]",
45
56
  args: [
46
57
  { name: "function_id", required: false, description: "Function ID (interactive selection if omitted)" }
47
58
  ],
48
59
  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, json, xs" },
51
- { name: "include_draft", type: "boolean", required: false, description: "Get draft version if available" },
52
- { name: "include_xanoscript", type: "boolean", required: false, description: "Include XanoScript in JSON output" }
60
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
61
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary, json, or xs" },
62
+ { name: "include_draft", type: "boolean", required: false, default: "false", description: "Get draft version if available" },
63
+ { name: "include_xanoscript", type: "boolean", required: false, default: "false", description: "Include XanoScript source in JSON output" },
64
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
53
65
  ],
54
66
  examples: [
55
- "xano function:get 145",
56
- "xano function:get 145 -o xs > my_function.xs",
57
- "xano function:get 145 -o json --include_xanoscript"
67
+ "xano function get 145",
68
+ "xano function get 145 -o xs > my_function.xs",
69
+ "xano function get 145 -o json --include_xanoscript",
70
+ "xano function get 145 --include_draft"
58
71
  ]
59
72
  },
60
73
  {
61
- name: "function:create",
62
- description: "Create a new function from XanoScript",
63
- usage: "xano function:create [options]",
74
+ name: "function create",
75
+ description: "Create a new function from XanoScript. Provide source via --file, --stdin, or open in editor via --edit (requires --file).",
76
+ usage: "xano function create [options]",
64
77
  flags: [
65
- { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
66
- { name: "file", short: "f", type: "string", required: false, description: "Path to .xs file" },
67
- { name: "stdin", type: "boolean", required: false, description: "Read from stdin" },
68
- { name: "edit", type: "boolean", required: false, description: "Open in $EDITOR before creating" }
78
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
79
+ { name: "file", short: "f", type: "string", required: false, description: "Path to file containing XanoScript code (mutually exclusive with --stdin)" },
80
+ { name: "stdin", short: "s", type: "boolean", required: false, default: "false", description: "Read XanoScript code from stdin (mutually exclusive with --file)" },
81
+ { name: "edit", short: "e", type: "boolean", required: false, default: "false", description: "Open the file in $EDITOR before creating (requires --file)" },
82
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" },
83
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
69
84
  ],
70
85
  examples: [
71
- "xano function:create -f ./my_function.xs",
72
- "cat function.xs | xano function:create --stdin",
73
- "xano function:create --edit"
86
+ "xano function create -f ./my_function.xs",
87
+ "cat function.xs | xano function create --stdin",
88
+ "xano function create -f ./scaffold.xs --edit",
89
+ "xano function create -f ./my_function.xs -o json"
74
90
  ]
75
91
  },
76
92
  {
77
- name: "function:edit",
78
- description: "Edit an existing function",
79
- usage: "xano function:edit [function_id] [options]",
93
+ name: "function edit",
94
+ description: "Edit an existing function. If neither --file nor --stdin is provided, the CLI fetches the current XanoScript from the API and opens it directly in $EDITOR — this is the most ergonomic usage. If function_id is omitted, an interactive picker is shown.",
95
+ usage: "xano function edit [function_id] [options]",
80
96
  args: [
81
97
  { name: "function_id", required: false, description: "Function ID (interactive selection if omitted)" }
82
98
  ],
83
99
  flags: [
84
- { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
85
- { name: "file", short: "f", type: "string", required: false, description: "Path to .xs file with updated code" },
86
- { name: "stdin", type: "boolean", required: false, description: "Read updated code from stdin" },
87
- { name: "edit", type: "boolean", required: false, description: "Open current code in $EDITOR before updating" },
88
- { name: "no-publish", type: "boolean", required: false, description: "Save as draft without publishing" }
100
+ { name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID (uses profile workspace if not provided)" },
101
+ { name: "file", short: "f", type: "string", required: false, description: "Path to file with updated XanoScript (mutually exclusive with --stdin)" },
102
+ { name: "stdin", short: "s", type: "boolean", required: false, default: "false", description: "Read updated XanoScript from stdin (mutually exclusive with --file)" },
103
+ { name: "edit", short: "e", type: "boolean", required: false, default: "false", description: "Open the file in $EDITOR before updating (requires --file)" },
104
+ { name: "publish", type: "boolean", required: false, default: "true", description: "Publish after editing (use --no-publish to save as draft only)" },
105
+ { name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary or json" },
106
+ { name: "profile", short: "p", type: "string", required: false, description: "Profile name to use" }
89
107
  ],
90
108
  examples: [
91
- "xano function:edit 145",
92
- "xano function:edit 145 -f ./updated_function.xs",
93
- "xano function:edit 145 --edit",
94
- "xano function:edit 145 --no-publish"
109
+ "xano function edit 145 # fetch current code, open in $EDITOR",
110
+ "xano function edit 145 -f ./updated_function.xs",
111
+ "xano function edit 145 -f ./updated_function.xs --edit",
112
+ "xano function edit 145 -f ./draft.xs --no-publish"
95
113
  ]
96
114
  }
97
115
  ],
@@ -100,20 +118,29 @@ export const functionDoc = {
100
118
  name: "Quick Function Edit",
101
119
  description: "Quickly edit a function without full workspace sync",
102
120
  steps: [
103
- "Get function code: `xano function:get 145 -o xs > func.xs`",
121
+ "Get function code: `xano function get 145 -o xs > func.xs`",
104
122
  "Edit the file locally",
105
- "Upload changes: `xano function:edit 145 -f func.xs`"
123
+ "Upload changes: `xano function edit 145 -f func.xs`"
106
124
  ],
107
- example: `xano function:get 145 -o xs > auth_check.xs
125
+ example: `xano function get 145 -o xs > auth_check.xs
108
126
  vim auth_check.xs
109
- xano function:edit 145 -f auth_check.xs`
127
+ xano function edit 145 -f auth_check.xs`
110
128
  },
111
129
  {
112
130
  name: "Create from Template",
113
131
  description: "Create a new function from a template file",
114
132
  steps: [
115
133
  "Write your XanoScript function in a .xs file",
116
- "Create in Xano: `xano function:create -f template.xs`"
134
+ "Create in Xano: `xano function create -f template.xs`"
135
+ ]
136
+ },
137
+ {
138
+ name: "Draft Then Publish",
139
+ description: "Save an edit as a draft and publish later",
140
+ steps: [
141
+ "Save as draft: `xano function edit 145 -f func.xs --no-publish`",
142
+ "Review via `xano function get 145 --include_draft`",
143
+ "Publish with a normal edit: `xano function edit 145 -f func.xs`"
117
144
  ]
118
145
  }
119
146
  ]