@xano/developer-mcp 1.0.25 → 1.0.27
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 +50 -0
- package/dist/cli_docs/format.d.ts +12 -0
- package/dist/cli_docs/format.js +98 -0
- package/dist/{api_docs → cli_docs}/index.d.ts +6 -11
- package/dist/cli_docs/index.js +86 -0
- package/dist/cli_docs/topics/function.js +114 -0
- package/dist/cli_docs/topics/integration.d.ts +2 -0
- package/dist/cli_docs/topics/integration.js +157 -0
- package/dist/{api_docs/topics/agent.d.ts → cli_docs/topics/profile.d.ts} +1 -1
- package/dist/cli_docs/topics/profile.js +153 -0
- package/dist/{api_docs/topics/api.d.ts → cli_docs/topics/run.d.ts} +1 -1
- package/dist/cli_docs/topics/run.js +248 -0
- package/dist/cli_docs/topics/start.js +111 -0
- package/dist/cli_docs/topics/static_host.d.ts +2 -0
- package/dist/cli_docs/topics/static_host.js +77 -0
- package/dist/cli_docs/topics/workspace.js +119 -0
- package/dist/cli_docs/types.d.ts +44 -0
- package/dist/cli_docs/types.js +4 -0
- package/dist/index.js +42 -0
- package/dist/xanoscript_docs/README.md +78 -64
- package/dist/xanoscript_docs/apis.md +81 -27
- package/dist/xanoscript_docs/branch.md +13 -13
- package/dist/xanoscript_docs/database.md +57 -17
- package/dist/xanoscript_docs/functions.md +43 -71
- package/dist/xanoscript_docs/performance.md +14 -23
- package/dist/xanoscript_docs/tables.md +47 -1
- package/dist/xanoscript_docs/tools.md +9 -7
- package/dist/xanoscript_docs/types.md +12 -10
- package/package.json +1 -1
- package/dist/api_docs/format.d.ts +0 -5
- package/dist/api_docs/format.js +0 -171
- package/dist/api_docs/index.js +0 -111
- package/dist/api_docs/topics/agent.js +0 -142
- package/dist/api_docs/topics/api.js +0 -176
- package/dist/api_docs/topics/apigroup.d.ts +0 -2
- package/dist/api_docs/topics/apigroup.js +0 -124
- package/dist/api_docs/topics/authentication.d.ts +0 -2
- package/dist/api_docs/topics/authentication.js +0 -61
- package/dist/api_docs/topics/branch.d.ts +0 -2
- package/dist/api_docs/topics/branch.js +0 -73
- package/dist/api_docs/topics/file.d.ts +0 -2
- package/dist/api_docs/topics/file.js +0 -70
- package/dist/api_docs/topics/function.js +0 -164
- package/dist/api_docs/topics/history.d.ts +0 -2
- package/dist/api_docs/topics/history.js +0 -149
- package/dist/api_docs/topics/mcp_server.d.ts +0 -2
- package/dist/api_docs/topics/mcp_server.js +0 -139
- package/dist/api_docs/topics/middleware.d.ts +0 -2
- package/dist/api_docs/topics/middleware.js +0 -156
- package/dist/api_docs/topics/realtime.d.ts +0 -2
- package/dist/api_docs/topics/realtime.js +0 -112
- package/dist/api_docs/topics/start.js +0 -107
- package/dist/api_docs/topics/table.d.ts +0 -2
- package/dist/api_docs/topics/table.js +0 -195
- package/dist/api_docs/topics/task.d.ts +0 -2
- package/dist/api_docs/topics/task.js +0 -165
- package/dist/api_docs/topics/tool.d.ts +0 -2
- package/dist/api_docs/topics/tool.js +0 -150
- package/dist/api_docs/topics/workflows.d.ts +0 -2
- package/dist/api_docs/topics/workflows.js +0 -131
- package/dist/api_docs/topics/workspace.js +0 -153
- package/dist/api_docs/types.d.ts +0 -79
- package/dist/api_docs/types.js +0 -4
- package/dist/templates/init-workspace.d.ts +0 -10
- package/dist/templates/init-workspace.js +0 -278
- package/dist/templates/xanoscript-index.d.ts +0 -11
- package/dist/templates/xanoscript-index.js +0 -72
- package/dist/xanoscript_docs/ephemeral.md +0 -330
- package/dist/xanoscript_docs_auto/README.md +0 -119
- package/dist/xanoscript_docs_auto/agents.md +0 -446
- package/dist/xanoscript_docs_auto/apis.md +0 -517
- package/dist/xanoscript_docs_auto/control-flow.md +0 -543
- package/dist/xanoscript_docs_auto/database.md +0 -551
- package/dist/xanoscript_docs_auto/debugging.md +0 -527
- package/dist/xanoscript_docs_auto/filters.md +0 -464
- package/dist/xanoscript_docs_auto/functions.md +0 -431
- package/dist/xanoscript_docs_auto/integrations.md +0 -657
- package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
- package/dist/xanoscript_docs_auto/operators.md +0 -368
- package/dist/xanoscript_docs_auto/syntax.md +0 -287
- package/dist/xanoscript_docs_auto/tables.md +0 -447
- package/dist/xanoscript_docs_auto/tasks.md +0 -479
- package/dist/xanoscript_docs_auto/testing.md +0 -574
- package/dist/xanoscript_docs_auto/tools.md +0 -485
- package/dist/xanoscript_docs_auto/triggers.md +0 -595
- package/dist/xanoscript_docs_auto/types.md +0 -323
- package/dist/xanoscript_docs_auto/variables.md +0 -462
- package/dist/xanoscript_docs_auto/version.json +0 -5
- /package/dist/{api_docs → cli_docs}/topics/function.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/start.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/workspace.d.ts +0 -0
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ This MCP server acts as a bridge between AI models and Xano's developer ecosyste
|
|
|
30
30
|
|
|
31
31
|
- **Meta API Documentation** - Programmatically manage Xano workspaces, databases, APIs, functions, and more
|
|
32
32
|
- **Run API Documentation** - Runtime execution, session management, and XanoScript execution
|
|
33
|
+
- **CLI Documentation** - Command-line interface for local development, code sync, and execution
|
|
33
34
|
- **XanoScript Documentation** - Language reference with context-aware docs based on file type
|
|
34
35
|
- **Code Validation** - Syntax checking with the official XanoScript language server
|
|
35
36
|
- **Workflow Guides** - Step-by-step guides for common development tasks
|
|
@@ -318,6 +319,48 @@ meta_api_docs({ topic: "api", detail_level: "examples", include_schemas: false }
|
|
|
318
319
|
meta_api_docs({ topic: "workflows" })
|
|
319
320
|
```
|
|
320
321
|
|
|
322
|
+
### 6. `cli_docs`
|
|
323
|
+
|
|
324
|
+
Get documentation for the Xano CLI. The CLI is **optional but recommended** for local development workflows. Not all users will have it installed.
|
|
325
|
+
|
|
326
|
+
- **npm:** https://www.npmjs.com/package/@xano/cli
|
|
327
|
+
- **GitHub:** https://github.com/xano-inc/cli
|
|
328
|
+
|
|
329
|
+
Use this tool to understand CLI commands for local development, code synchronization, and XanoScript execution.
|
|
330
|
+
|
|
331
|
+
**Parameters:**
|
|
332
|
+
| Parameter | Type | Required | Description |
|
|
333
|
+
|-----------|------|----------|-------------|
|
|
334
|
+
| `topic` | string | Yes | Documentation topic to retrieve |
|
|
335
|
+
| `detail_level` | string | No | `overview`, `detailed` (default), or `examples` |
|
|
336
|
+
|
|
337
|
+
**Available Topics:**
|
|
338
|
+
|
|
339
|
+
| Topic | Description |
|
|
340
|
+
|-------|-------------|
|
|
341
|
+
| `start` | Getting started with the CLI - installation and setup |
|
|
342
|
+
| `profile` | Profile management - credentials and multi-environment setup |
|
|
343
|
+
| `workspace` | Workspace operations - pull/push code sync |
|
|
344
|
+
| `function` | Function management - list, get, create, edit |
|
|
345
|
+
| `run` | Run API commands - execute code, manage projects/sessions |
|
|
346
|
+
| `static_host` | Static hosting - deploy frontend builds |
|
|
347
|
+
| `integration` | CLI + Meta API integration guide - when to use each |
|
|
348
|
+
|
|
349
|
+
**Examples:**
|
|
350
|
+
```
|
|
351
|
+
// Get CLI setup guide
|
|
352
|
+
cli_docs({ topic: "start" })
|
|
353
|
+
|
|
354
|
+
// Learn when to use CLI vs Meta API
|
|
355
|
+
cli_docs({ topic: "integration" })
|
|
356
|
+
|
|
357
|
+
// Get workspace sync commands
|
|
358
|
+
cli_docs({ topic: "workspace", detail_level: "detailed" })
|
|
359
|
+
|
|
360
|
+
// Profile management with examples
|
|
361
|
+
cli_docs({ topic: "profile", detail_level: "examples" })
|
|
362
|
+
```
|
|
363
|
+
|
|
321
364
|
## MCP Resources
|
|
322
365
|
|
|
323
366
|
The server also exposes XanoScript documentation as MCP resources for direct access:
|
|
@@ -382,6 +425,11 @@ xano-developer-mcp/
|
|
|
382
425
|
│ │ ├── format.ts # Documentation formatter
|
|
383
426
|
│ │ ├── format.test.ts # Tests for formatter
|
|
384
427
|
│ │ └── topics/ # Individual topic modules
|
|
428
|
+
│ ├── cli_docs/ # Xano CLI documentation
|
|
429
|
+
│ │ ├── index.ts # CLI docs tool handler
|
|
430
|
+
│ │ ├── types.ts # Type definitions
|
|
431
|
+
│ │ ├── format.ts # Documentation formatter
|
|
432
|
+
│ │ └── topics/ # Individual topic modules
|
|
385
433
|
│ └── xanoscript_docs/ # XanoScript language documentation
|
|
386
434
|
│ ├── version.json
|
|
387
435
|
│ ├── README.md
|
|
@@ -429,6 +477,8 @@ Xano Developer MCP Server
|
|
|
429
477
|
│
|
|
430
478
|
├─► run_api_docs → Run API documentation for runtime execution
|
|
431
479
|
│
|
|
480
|
+
├─► cli_docs → CLI documentation for local development workflows
|
|
481
|
+
│
|
|
432
482
|
├─► mcp_version → Returns server version from package.json
|
|
433
483
|
│
|
|
434
484
|
└─► MCP Resources → Direct access to XanoScript documentation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utilities for CLI documentation
|
|
3
|
+
*/
|
|
4
|
+
import type { TopicDoc, CommandDoc, DetailLevel } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Format a command for display
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatCommand(cmd: CommandDoc, detailed: boolean): string;
|
|
9
|
+
/**
|
|
10
|
+
* Format complete documentation for a topic
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDocumentation(doc: TopicDoc, detailLevel: DetailLevel): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utilities for CLI documentation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Format a command for display
|
|
6
|
+
*/
|
|
7
|
+
export function formatCommand(cmd, detailed) {
|
|
8
|
+
const lines = [];
|
|
9
|
+
lines.push(`### \`${cmd.name}\``);
|
|
10
|
+
lines.push(cmd.description);
|
|
11
|
+
lines.push("");
|
|
12
|
+
lines.push("```bash");
|
|
13
|
+
lines.push(cmd.usage);
|
|
14
|
+
lines.push("```");
|
|
15
|
+
if (detailed && cmd.flags && cmd.flags.length > 0) {
|
|
16
|
+
lines.push("");
|
|
17
|
+
lines.push("**Flags:**");
|
|
18
|
+
lines.push("| Flag | Type | Required | Description |");
|
|
19
|
+
lines.push("|------|------|----------|-------------|");
|
|
20
|
+
for (const flag of cmd.flags) {
|
|
21
|
+
const flagName = flag.short ? `-${flag.short}, --${flag.name}` : `--${flag.name}`;
|
|
22
|
+
const required = flag.required ? "Yes" : "No";
|
|
23
|
+
const desc = flag.default ? `${flag.description} (default: ${flag.default})` : flag.description;
|
|
24
|
+
lines.push(`| \`${flagName}\` | ${flag.type} | ${required} | ${desc} |`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (detailed && cmd.args && cmd.args.length > 0) {
|
|
28
|
+
lines.push("");
|
|
29
|
+
lines.push("**Arguments:**");
|
|
30
|
+
lines.push("| Argument | Required | Description |");
|
|
31
|
+
lines.push("|----------|----------|-------------|");
|
|
32
|
+
for (const arg of cmd.args) {
|
|
33
|
+
const required = arg.required ? "Yes" : "No";
|
|
34
|
+
lines.push(`| \`${arg.name}\` | ${required} | ${arg.description} |`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (cmd.examples && cmd.examples.length > 0) {
|
|
38
|
+
lines.push("");
|
|
39
|
+
lines.push("**Examples:**");
|
|
40
|
+
lines.push("```bash");
|
|
41
|
+
lines.push(cmd.examples.join("\n"));
|
|
42
|
+
lines.push("```");
|
|
43
|
+
}
|
|
44
|
+
return lines.join("\n");
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format complete documentation for a topic
|
|
48
|
+
*/
|
|
49
|
+
export function formatDocumentation(doc, detailLevel) {
|
|
50
|
+
const sections = [];
|
|
51
|
+
// Title and description
|
|
52
|
+
sections.push(`# ${doc.title}`);
|
|
53
|
+
sections.push("");
|
|
54
|
+
sections.push(doc.description);
|
|
55
|
+
// AI hints for overview/detailed
|
|
56
|
+
if (doc.ai_hints && (detailLevel === "overview" || detailLevel === "detailed")) {
|
|
57
|
+
sections.push("");
|
|
58
|
+
sections.push("## AI Usage Notes");
|
|
59
|
+
sections.push(doc.ai_hints);
|
|
60
|
+
}
|
|
61
|
+
// Commands
|
|
62
|
+
if (doc.commands && doc.commands.length > 0) {
|
|
63
|
+
sections.push("");
|
|
64
|
+
sections.push("## Commands");
|
|
65
|
+
const showDetailed = detailLevel === "detailed" || detailLevel === "examples";
|
|
66
|
+
for (const cmd of doc.commands) {
|
|
67
|
+
sections.push("");
|
|
68
|
+
sections.push(formatCommand(cmd, showDetailed));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Workflows
|
|
72
|
+
if (doc.workflows && doc.workflows.length > 0 && detailLevel !== "overview") {
|
|
73
|
+
sections.push("");
|
|
74
|
+
sections.push("## Workflows");
|
|
75
|
+
for (const workflow of doc.workflows) {
|
|
76
|
+
sections.push("");
|
|
77
|
+
sections.push(`### ${workflow.name}`);
|
|
78
|
+
sections.push(workflow.description);
|
|
79
|
+
sections.push("");
|
|
80
|
+
workflow.steps.forEach((step, i) => {
|
|
81
|
+
sections.push(`${i + 1}. ${step}`);
|
|
82
|
+
});
|
|
83
|
+
if (workflow.example) {
|
|
84
|
+
sections.push("");
|
|
85
|
+
sections.push("```bash");
|
|
86
|
+
sections.push(workflow.example);
|
|
87
|
+
sections.push("```");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Related topics
|
|
92
|
+
if (doc.related_topics && doc.related_topics.length > 0) {
|
|
93
|
+
sections.push("");
|
|
94
|
+
sections.push("## Related Topics");
|
|
95
|
+
sections.push(doc.related_topics.map(t => `- \`${t}\``).join("\n"));
|
|
96
|
+
}
|
|
97
|
+
return sections.join("\n");
|
|
98
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Xano
|
|
2
|
+
* Xano CLI Documentation Index
|
|
3
3
|
*
|
|
4
4
|
* This module exports all documentation topics and provides
|
|
5
|
-
* the
|
|
5
|
+
* the cli_docs tool handler for the MCP server.
|
|
6
6
|
*/
|
|
7
|
-
import type { TopicDoc,
|
|
7
|
+
import type { TopicDoc, CliDocsArgs } from "./types.js";
|
|
8
8
|
/**
|
|
9
9
|
* All available documentation topics
|
|
10
10
|
*/
|
|
@@ -18,13 +18,13 @@ export declare function getTopicNames(): string[];
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function getTopicDescriptions(): string;
|
|
20
20
|
/**
|
|
21
|
-
* Handler for the
|
|
21
|
+
* Handler for the cli_docs tool
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function handleCliDocs(args: CliDocsArgs): string;
|
|
24
24
|
/**
|
|
25
25
|
* Tool definition for MCP server
|
|
26
26
|
*/
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const cliDocsToolDefinition: {
|
|
28
28
|
name: string;
|
|
29
29
|
description: string;
|
|
30
30
|
inputSchema: {
|
|
@@ -41,11 +41,6 @@ export declare const apiDocsToolDefinition: {
|
|
|
41
41
|
default: string;
|
|
42
42
|
description: string;
|
|
43
43
|
};
|
|
44
|
-
include_schemas: {
|
|
45
|
-
type: string;
|
|
46
|
-
default: boolean;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
44
|
};
|
|
50
45
|
required: string[];
|
|
51
46
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Xano CLI Documentation Index
|
|
3
|
+
*
|
|
4
|
+
* This module exports all documentation topics and provides
|
|
5
|
+
* the cli_docs tool handler for the MCP server.
|
|
6
|
+
*/
|
|
7
|
+
import { formatDocumentation } from "./format.js";
|
|
8
|
+
// Import all topic documentation
|
|
9
|
+
import { startDoc } from "./topics/start.js";
|
|
10
|
+
import { profileDoc } from "./topics/profile.js";
|
|
11
|
+
import { workspaceDoc } from "./topics/workspace.js";
|
|
12
|
+
import { functionDoc } from "./topics/function.js";
|
|
13
|
+
import { runDoc } from "./topics/run.js";
|
|
14
|
+
import { staticHostDoc } from "./topics/static_host.js";
|
|
15
|
+
import { integrationDoc } from "./topics/integration.js";
|
|
16
|
+
/**
|
|
17
|
+
* All available documentation topics
|
|
18
|
+
*/
|
|
19
|
+
export const topics = {
|
|
20
|
+
start: startDoc,
|
|
21
|
+
profile: profileDoc,
|
|
22
|
+
workspace: workspaceDoc,
|
|
23
|
+
function: functionDoc,
|
|
24
|
+
run: runDoc,
|
|
25
|
+
static_host: staticHostDoc,
|
|
26
|
+
integration: integrationDoc,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Get list of all available topic names
|
|
30
|
+
*/
|
|
31
|
+
export function getTopicNames() {
|
|
32
|
+
return Object.keys(topics);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get topic descriptions for tool documentation
|
|
36
|
+
*/
|
|
37
|
+
export function getTopicDescriptions() {
|
|
38
|
+
return Object.entries(topics)
|
|
39
|
+
.map(([key, doc]) => `- ${key}: ${doc.title}`)
|
|
40
|
+
.join("\n");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Handler for the cli_docs tool
|
|
44
|
+
*/
|
|
45
|
+
export function handleCliDocs(args) {
|
|
46
|
+
const { topic, detail_level = "detailed" } = args;
|
|
47
|
+
// Validate topic
|
|
48
|
+
if (!topics[topic]) {
|
|
49
|
+
const available = getTopicNames().join(", ");
|
|
50
|
+
return `Error: Unknown topic "${topic}".\n\nAvailable topics: ${available}`;
|
|
51
|
+
}
|
|
52
|
+
const doc = topics[topic];
|
|
53
|
+
return formatDocumentation(doc, detail_level);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Tool definition for MCP server
|
|
57
|
+
*/
|
|
58
|
+
export const cliDocsToolDefinition = {
|
|
59
|
+
name: "cli_docs",
|
|
60
|
+
description: `Get documentation for the Xano CLI. Use this to understand how to use the CLI for local development, code sync, and XanoScript execution.
|
|
61
|
+
|
|
62
|
+
## Topics
|
|
63
|
+
${getTopicDescriptions()}
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
- Start with "start" topic for installation and setup
|
|
67
|
+
- Use "integration" to understand when to use CLI vs Meta API
|
|
68
|
+
- Use specific topics (profile, workspace, function, run) for command reference`,
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
topic: {
|
|
73
|
+
type: "string",
|
|
74
|
+
enum: getTopicNames(),
|
|
75
|
+
description: "Documentation topic to retrieve",
|
|
76
|
+
},
|
|
77
|
+
detail_level: {
|
|
78
|
+
type: "string",
|
|
79
|
+
enum: ["overview", "detailed", "examples"],
|
|
80
|
+
default: "detailed",
|
|
81
|
+
description: "Level of detail: overview (brief), detailed (full docs), examples (with examples)",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ["topic"],
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export const functionDoc = {
|
|
2
|
+
topic: "function",
|
|
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.`,
|
|
5
|
+
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
|
|
8
|
+
|
|
9
|
+
**Output formats:**
|
|
10
|
+
- \`summary\` - Human-readable table
|
|
11
|
+
- \`json\` - Full metadata (good for scripting)
|
|
12
|
+
- \`xs\` - Raw XanoScript code only
|
|
13
|
+
|
|
14
|
+
**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"],
|
|
19
|
+
commands: [
|
|
20
|
+
{
|
|
21
|
+
name: "function:list",
|
|
22
|
+
description: "List all functions in the workspace",
|
|
23
|
+
usage: "xano function:list [options]",
|
|
24
|
+
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
|
+
],
|
|
34
|
+
examples: [
|
|
35
|
+
"xano function:list",
|
|
36
|
+
"xano function:list --search auth",
|
|
37
|
+
"xano function:list -o json --include_draft"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "function:get",
|
|
42
|
+
description: "Get a specific function by ID",
|
|
43
|
+
usage: "xano function:get [function_id] [options]",
|
|
44
|
+
args: [
|
|
45
|
+
{ name: "function_id", required: false, description: "Function ID (interactive selection if omitted)" }
|
|
46
|
+
],
|
|
47
|
+
flags: [
|
|
48
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
49
|
+
{ name: "output", short: "o", type: "string", required: false, default: "summary", description: "Output format: summary, json, xs" },
|
|
50
|
+
{ name: "include_draft", type: "boolean", required: false, description: "Get draft version if available" },
|
|
51
|
+
{ name: "include_xanoscript", type: "boolean", required: false, description: "Include XanoScript in JSON output" }
|
|
52
|
+
],
|
|
53
|
+
examples: [
|
|
54
|
+
"xano function:get 145",
|
|
55
|
+
"xano function:get 145 -o xs > my_function.xs",
|
|
56
|
+
"xano function:get 145 -o json --include_xanoscript"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "function:create",
|
|
61
|
+
description: "Create a new function from XanoScript",
|
|
62
|
+
usage: "xano function:create [options]",
|
|
63
|
+
flags: [
|
|
64
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
65
|
+
{ name: "file", short: "f", type: "string", required: false, description: "Path to .xs file" },
|
|
66
|
+
{ name: "stdin", type: "boolean", required: false, description: "Read from stdin" },
|
|
67
|
+
{ name: "edit", type: "boolean", required: false, description: "Open in $EDITOR before creating" }
|
|
68
|
+
],
|
|
69
|
+
examples: [
|
|
70
|
+
"xano function:create -f ./my_function.xs",
|
|
71
|
+
"cat function.xs | xano function:create --stdin",
|
|
72
|
+
"xano function:create --edit"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "function:edit",
|
|
77
|
+
description: "Edit an existing function",
|
|
78
|
+
usage: "xano function:edit [function_id] [options]",
|
|
79
|
+
args: [
|
|
80
|
+
{ name: "function_id", required: false, description: "Function ID (interactive selection if omitted)" }
|
|
81
|
+
],
|
|
82
|
+
flags: [
|
|
83
|
+
{ name: "workspace", short: "w", type: "string", required: false, description: "Workspace ID" },
|
|
84
|
+
{ name: "file", short: "f", type: "string", required: false, description: "Path to .xs file with updated code" }
|
|
85
|
+
],
|
|
86
|
+
examples: [
|
|
87
|
+
"xano function:edit 145",
|
|
88
|
+
"xano function:edit 145 -f ./updated_function.xs"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
workflows: [
|
|
93
|
+
{
|
|
94
|
+
name: "Quick Function Edit",
|
|
95
|
+
description: "Quickly edit a function without full workspace sync",
|
|
96
|
+
steps: [
|
|
97
|
+
"Get function code: `xano function:get 145 -o xs > func.xs`",
|
|
98
|
+
"Edit the file locally",
|
|
99
|
+
"Upload changes: `xano function:edit 145 -f func.xs`"
|
|
100
|
+
],
|
|
101
|
+
example: `xano function:get 145 -o xs > auth_check.xs
|
|
102
|
+
vim auth_check.xs
|
|
103
|
+
xano function:edit 145 -f auth_check.xs`
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "Create from Template",
|
|
107
|
+
description: "Create a new function from a template file",
|
|
108
|
+
steps: [
|
|
109
|
+
"Write your XanoScript function in a .xs file",
|
|
110
|
+
"Create in Xano: `xano function:create -f template.xs`"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export const integrationDoc = {
|
|
2
|
+
topic: "integration",
|
|
3
|
+
title: "Xano CLI + Meta API Integration Guide",
|
|
4
|
+
description: `This guide explains when to use the CLI vs the Meta API, and how they work together for different workflows.
|
|
5
|
+
|
|
6
|
+
> **Note:** The CLI is optional but recommended for local development. Not all users will have it installed. Everything the CLI does can also be accomplished via the Meta API and Run API directly.
|
|
7
|
+
|
|
8
|
+
## CLI Installation (Optional)
|
|
9
|
+
|
|
10
|
+
\`\`\`bash
|
|
11
|
+
npm install -g @xano/cli
|
|
12
|
+
\`\`\`
|
|
13
|
+
|
|
14
|
+
- npm: https://www.npmjs.com/package/@xano/cli
|
|
15
|
+
- GitHub: https://github.com/xano-inc/cli
|
|
16
|
+
|
|
17
|
+
## CLI vs Meta API
|
|
18
|
+
|
|
19
|
+
| Task | Use CLI | Use Meta API |
|
|
20
|
+
|------|---------|--------------|
|
|
21
|
+
| Local development | Yes | - |
|
|
22
|
+
| Code sync (pull/push) | Yes | - |
|
|
23
|
+
| Quick function edits | Yes | - |
|
|
24
|
+
| Execute XanoScript | Yes | Yes (Run API) |
|
|
25
|
+
| CI/CD automation | Both | Both |
|
|
26
|
+
| Programmatic management | - | Yes |
|
|
27
|
+
| Create tables/schemas | - | Yes |
|
|
28
|
+
| Manage API groups | - | Yes |
|
|
29
|
+
| Build integrations | - | Yes |
|
|
30
|
+
|
|
31
|
+
## Authentication
|
|
32
|
+
|
|
33
|
+
Both use the same access token from your Xano dashboard:
|
|
34
|
+
|
|
35
|
+
**CLI:** Stored in \`~/.xano/credentials.yaml\`
|
|
36
|
+
\`\`\`bash
|
|
37
|
+
xano profile:wizard # Interactive setup
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
**Meta API:** Bearer token in Authorization header
|
|
41
|
+
\`\`\`
|
|
42
|
+
Authorization: Bearer <your-token>
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
## API URLs
|
|
46
|
+
|
|
47
|
+
| API | Base URL | Purpose |
|
|
48
|
+
|-----|----------|---------|
|
|
49
|
+
| Meta API | \`https://<instance>.xano.io/api:meta\` | Manage resources |
|
|
50
|
+
| Run API | \`https://app.dev.xano.com/api:run\` | Execute code |
|
|
51
|
+
|
|
52
|
+
The CLI uses both APIs internally.`,
|
|
53
|
+
ai_hints: `**Important:** The CLI is optional. Before suggesting CLI commands, verify the user has it installed or offer to help them install it. All CLI functionality has Meta API equivalents.
|
|
54
|
+
|
|
55
|
+
**Decision tree for AI:**
|
|
56
|
+
|
|
57
|
+
1. **User wants to edit code locally?**
|
|
58
|
+
- With CLI: \`workspace:pull/push\`
|
|
59
|
+
- Without CLI: Use Meta API \`/workspace/{id}/multidoc\` endpoints
|
|
60
|
+
2. **User wants to execute XanoScript?**
|
|
61
|
+
- With CLI: \`run:exec\`
|
|
62
|
+
- Without CLI: Use Run API directly
|
|
63
|
+
3. **User wants to create/modify tables?** → Meta API \`/table\` endpoints
|
|
64
|
+
4. **User wants to create/modify APIs?** → Meta API \`/api\` endpoints
|
|
65
|
+
5. **User wants to manage functions?**
|
|
66
|
+
- With CLI: \`function:*\` commands for code
|
|
67
|
+
- Without CLI: Meta API \`/function\` endpoints
|
|
68
|
+
6. **User wants automation in code?** → Meta API (HTTP calls)
|
|
69
|
+
7. **User wants shell scripting?** → CLI commands (if installed)
|
|
70
|
+
|
|
71
|
+
**If CLI not installed:**
|
|
72
|
+
- Recommend installation: \`npm install -g @xano/cli\`
|
|
73
|
+
- Or use Meta API endpoints directly for equivalent functionality
|
|
74
|
+
- The multidoc endpoint (\`/api:meta/beta/workspace/{id}/multidoc\`) provides pull/push functionality
|
|
75
|
+
|
|
76
|
+
**Token reuse (if CLI is installed):**
|
|
77
|
+
The same access token works for both:
|
|
78
|
+
\`\`\`bash
|
|
79
|
+
# Get token from CLI profile
|
|
80
|
+
TOKEN=$(xano profile:token)
|
|
81
|
+
|
|
82
|
+
# Use with Meta API
|
|
83
|
+
curl -H "Authorization: Bearer $TOKEN" https://instance.xano.io/api:meta/workspace
|
|
84
|
+
\`\`\``,
|
|
85
|
+
related_topics: ["start", "profile", "workspace"],
|
|
86
|
+
workflows: [
|
|
87
|
+
{
|
|
88
|
+
name: "Local Development with Version Control",
|
|
89
|
+
description: "Full workflow using CLI for code and git for versioning",
|
|
90
|
+
steps: [
|
|
91
|
+
"Setup: `xano profile:wizard`",
|
|
92
|
+
"Pull code: `xano workspace:pull ./xano`",
|
|
93
|
+
"Init git: `cd xano && git init && git add . && git commit -m 'Initial'`",
|
|
94
|
+
"Create feature branch: `git checkout -b feature/new-api`",
|
|
95
|
+
"Edit .xs files in your IDE",
|
|
96
|
+
"Validate with MCP: Use `validate_xanoscript` tool",
|
|
97
|
+
"Push to Xano: `xano workspace:push ./xano`",
|
|
98
|
+
"Test in Xano dashboard",
|
|
99
|
+
"Commit changes: `git add . && git commit -m 'Add new API'`"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "CI/CD Pipeline",
|
|
104
|
+
description: "Automated deployment using CLI in CI/CD",
|
|
105
|
+
steps: [
|
|
106
|
+
"Store XANO_TOKEN as CI secret",
|
|
107
|
+
"Create profile in CI: `xano profile:create ci -i $INSTANCE -t $XANO_TOKEN`",
|
|
108
|
+
"Pull from git repo (your versioned .xs files)",
|
|
109
|
+
"Push to Xano: `xano workspace:push ./xano -p ci`"
|
|
110
|
+
],
|
|
111
|
+
example: `# GitHub Actions example
|
|
112
|
+
- name: Deploy to Xano
|
|
113
|
+
env:
|
|
114
|
+
XANO_TOKEN: \${{ secrets.XANO_TOKEN }}
|
|
115
|
+
run: |
|
|
116
|
+
npm install -g @xano/cli
|
|
117
|
+
xano profile:create deploy -i https://x8ki.xano.io -t $XANO_TOKEN -w 1
|
|
118
|
+
xano workspace:push ./xano -p deploy`
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "Create Resources via Meta API + Edit via CLI",
|
|
122
|
+
description: "Use Meta API to scaffold, CLI to implement",
|
|
123
|
+
steps: [
|
|
124
|
+
"Use Meta API to create new function: `POST /workspace/{id}/function`",
|
|
125
|
+
"Pull workspace: `xano workspace:pull ./xano`",
|
|
126
|
+
"Find the new function .xs file",
|
|
127
|
+
"Implement the function logic",
|
|
128
|
+
"Push changes: `xano workspace:push ./xano`"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "Export Token for API Calls",
|
|
133
|
+
description: "Use CLI-stored credentials with Meta API",
|
|
134
|
+
steps: [
|
|
135
|
+
"Get token: `TOKEN=$(xano profile:token)`",
|
|
136
|
+
"Use in curl: `curl -H \"Authorization: Bearer $TOKEN\" <api-url>`",
|
|
137
|
+
"Or in code: read token and make HTTP requests"
|
|
138
|
+
],
|
|
139
|
+
example: `# Bash
|
|
140
|
+
TOKEN=$(xano profile:token)
|
|
141
|
+
curl -H "Authorization: Bearer $TOKEN" \\
|
|
142
|
+
https://x8ki.xano.io/api:meta/workspace`
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "Multi-Environment Workflow",
|
|
146
|
+
description: "Manage staging and production with profiles",
|
|
147
|
+
steps: [
|
|
148
|
+
"Create staging profile: `xano profile:create staging -i <url> -t <token> -b 2`",
|
|
149
|
+
"Create production profile: `xano profile:create prod -i <url> -t <token> -b 1`",
|
|
150
|
+
"Develop on staging: `xano workspace:pull ./code -p staging`",
|
|
151
|
+
"Edit and test",
|
|
152
|
+
"Push to staging: `xano workspace:push ./code -p staging`",
|
|
153
|
+
"When ready, push to production: `xano workspace:push ./code -p prod`"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TopicDoc } from "../types.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const profileDoc: TopicDoc;
|