@xano/developer-mcp 2.2.1-beta.0 → 2.2.1-beta.3
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.
|
@@ -13,15 +13,48 @@ export const authDoc = {
|
|
|
13
13
|
|
|
14
14
|
The authentication flow has a 5-minute timeout.
|
|
15
15
|
|
|
16
|
+
## One-Shot Flow (\`--code\`) — recommended for scripts and AI agents
|
|
17
|
+
|
|
18
|
+
The login URL is static — no CLI process needs to be running while the user logs in:
|
|
19
|
+
|
|
20
|
+
\`\`\`
|
|
21
|
+
<origin>/login?dest=cli&display=code (e.g. https://app.xano.com/login?dest=cli&display=code)
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Send the user there, have them copy the code shown after login, then complete everything in a single non-interactive command:
|
|
25
|
+
|
|
26
|
+
\`\`\`bash
|
|
27
|
+
xano auth --code "$CODE" -i <instance> -w <workspace-id> --json
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
\`--code\` (or the \`XANO_AUTH_CODE\` env var) implies headless mode and guarantees zero prompts: a missing \`-w\` skips workspace selection, a missing \`-b\` uses the live branch, and a missing \`-p\` saves to the \`default\` profile. If \`-i\` is omitted and the account has exactly one instance, it is auto-selected; otherwise the command fails with the list of available instances.
|
|
31
|
+
|
|
16
32
|
## Headless Flow (\`--no-browser\`)
|
|
17
33
|
|
|
18
|
-
On remote/SSH sessions, Docker containers, or locked-down networks where the browser can't reach the CLI's loopback address, use \`--no-browser\`: the CLI prints
|
|
34
|
+
On remote/SSH sessions, Docker containers, or locked-down networks where the browser can't reach the CLI's loopback address, use \`--no-browser\`: the CLI prints the login URL, you open it in any browser, and paste back the code it displays. No local callback server required.
|
|
35
|
+
|
|
36
|
+
When stdin is piped (not a TTY), \`--no-browser\` reads the code directly from stdin instead of prompting: \`echo "$CODE" | xano auth --no-browser -i my-instance -w 5\`. Piped runs are fully non-interactive with the same defaults as \`--code\`.
|
|
19
37
|
|
|
20
38
|
## Pre-selecting with Flags
|
|
21
39
|
|
|
22
|
-
Each interactive picker can be pre-answered with a flag: \`-i/--instance\` (instance name), \`-w/--workspace\` (workspace ID or name), \`-b/--branch\` (branch label), and \`-p/--profile\` (profile name to save). An empty value (\`""\`) takes the picker's default answer: \`-w ""\` skips workspace selection, \`-b ""\` skips and uses the live branch, \`-p ""\` uses the default profile name.
|
|
23
|
-
|
|
40
|
+
Each interactive picker can be pre-answered with a flag: \`-i/--instance\` (instance name, numeric ID, or instance URL/hostname), \`-w/--workspace\` (workspace ID or name), \`-b/--branch\` (branch label), and \`-p/--profile\` (profile name to save). An empty value (\`""\`) takes the picker's default answer: \`-w ""\` skips workspace selection, \`-b ""\` skips and uses the live branch, \`-p ""\` uses the default profile name.
|
|
41
|
+
|
|
42
|
+
## JSON Output (\`--json\`)
|
|
43
|
+
|
|
44
|
+
With \`--json\`, the command prints a machine-readable result (profile name, user, instance, workspace, branch, credentials path) on success, or \`{"error": {"message": ...}}\` on failure — error messages include the list of available instances/workspaces/branches so callers can correct the flags and retry. \`--json\` also forces non-interactive behavior.`,
|
|
45
|
+
ai_hints: `**Agent setup recipe (no TTY, no waiting process):**
|
|
46
|
+
1. Install: \`npm install -g @xano/cli\` (or \`@xano/cli@beta\`)
|
|
47
|
+
2. Send the user to \`https://app.xano.com/login?dest=cli&display=code\` (swap the origin for self-hosted/custom origins) and ask them to paste back the code shown after login
|
|
48
|
+
3. Run one command: \`xano auth --code "$CODE" -i <instance> -w <workspace-id> --json\`
|
|
49
|
+
4. Verify: \`xano profile me\`
|
|
50
|
+
|
|
51
|
+
If the Xano MCP server is connected, call its \`xano_me\` tool first: pass its \`instanceUrl\` value directly to \`-i\` (URLs/hostnames match by instance origin) and its \`workspaceId\` to \`-w\`. Do NOT run \`xano auth --no-browser\` interactively and wait at the masked code prompt — use \`--code\` (or pipe the code on stdin) instead.
|
|
52
|
+
|
|
53
|
+
**Recovery on failure:** with \`--json\`, a wrong \`-i\`/\`-w\`/\`-b\` fails with the available options listed in the error — correct the flag and rerun. If the code itself is rejected, send the user back to the login URL for a fresh code.
|
|
54
|
+
|
|
55
|
+
**auth vs profile wizard:**
|
|
24
56
|
- \`xano auth\` - Browser-based OAuth login (recommended for interactive use)
|
|
57
|
+
- \`xano auth --code "$CODE" ...\` - One-shot non-interactive login for scripts/agents (user fetches the code from the static login URL)
|
|
25
58
|
- \`xano auth --no-browser\` - Headless login: open the printed URL in any browser, paste back the code (for SSH/Docker/remote hosts)
|
|
26
59
|
- \`xano profile wizard\` - Token-based interactive setup (requires manually copying token)
|
|
27
60
|
- \`xano profile create\` - Non-interactive, requires all flags
|
|
@@ -31,13 +64,16 @@ Each interactive picker can be pre-answered with a flag: \`-i/--instance\` (inst
|
|
|
31
64
|
- User doesn't have an access token handy
|
|
32
65
|
- User prefers browser-based login
|
|
33
66
|
- User is in a headless/SSH environment: use \`xano auth --no-browser\`
|
|
67
|
+
- Script or agent needs to complete auth non-interactively: use \`--code\`/\`XANO_AUTH_CODE\` (or pipe the code on stdin with \`--no-browser\`)
|
|
34
68
|
|
|
35
69
|
**When to suggest profile wizard/create instead:**
|
|
36
70
|
- User already has an access token
|
|
37
|
-
-
|
|
71
|
+
- Fully unattended runs with no human in the loop (CI/CD) — \`profile create\` uses a stored token and needs no login step, while \`--code\` still needs a human to log in once and supply the code
|
|
38
72
|
|
|
39
73
|
**Flag meaning caution:** On \`xano auth\`, \`-p/--profile\` is the *profile name to save*, not the profile-selection flag that other commands use. Backup branches are filtered out of the branch picker.
|
|
40
74
|
|
|
75
|
+
**Instance matching:** \`-i\` accepts the instance name (\`xabc-1234-defg\`), the numeric instance ID, or the instance URL/hostname (\`https://xabc-1234-defg.xano.io\`). Older API versions may not return numeric IDs — the name or URL always works.
|
|
76
|
+
|
|
41
77
|
**Self-hosted note:** With a non-default \`--origin\`, the origin itself is the instance, so \`--instance\` is ignored.
|
|
42
78
|
|
|
43
79
|
**After auth, suggest \`xano sandbox\`:**
|
|
@@ -50,11 +86,13 @@ The sandbox is a free-tier personal dev environment (auto-provisioned singleton
|
|
|
50
86
|
usage: "xano auth [options]",
|
|
51
87
|
flags: [
|
|
52
88
|
{ 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." },
|
|
89
|
+
{ name: "code", type: "string", required: false, description: "Login code copied from the browser (implies --no-browser and runs fully non-interactively). Get the code at <origin>/login?dest=cli&display=code. Env: XANO_AUTH_CODE" },
|
|
53
90
|
{ name: "no-browser", type: "boolean", required: false, description: "Headless login: print a URL and paste back the code shown in the browser, instead of starting a local callback server (use on remote/SSH/Docker hosts where 127.0.0.1 is not reachable from the browser)" },
|
|
54
|
-
{ name: "instance", short: "i", type: "string", required: false, description: "Pre-select an instance by name (skips the instance picker). Ignored for self-hosted origins." },
|
|
91
|
+
{ name: "instance", short: "i", type: "string", required: false, description: "Pre-select an instance by name, numeric ID, or instance URL/hostname (skips the instance picker). Ignored for self-hosted origins." },
|
|
55
92
|
{ name: "workspace", short: "w", type: "string", required: false, description: "Pre-select a workspace by ID or name (skips the workspace picker); pass \"\" to skip workspace" },
|
|
56
93
|
{ name: "branch", short: "b", type: "string", required: false, description: "Pre-select a branch by label (skips the branch picker); pass \"\" to skip and use the live branch" },
|
|
57
94
|
{ name: "profile", short: "p", type: "string", required: false, description: "Profile name to save (skips the profile name prompt); pass \"\" to use the default name. Note: unlike other commands, -p here names the profile being created." },
|
|
95
|
+
{ name: "json", type: "boolean", required: false, description: "Print a machine-readable JSON result (and JSON errors that include the available options); forces non-interactive behavior" },
|
|
58
96
|
{ name: "insecure", short: "k", type: "boolean", required: false, description: "Skip TLS certificate verification (for self-signed certificates)" },
|
|
59
97
|
{ name: "config", short: "c", type: "string", required: false, description: "Path to credentials file (default: ~/.xano/credentials.yaml). Env: XANO_CONFIG" }
|
|
60
98
|
],
|
|
@@ -63,8 +101,11 @@ The sandbox is a free-tier personal dev environment (auto-provisioned singleton
|
|
|
63
101
|
"xano auth --origin https://custom.xano.com",
|
|
64
102
|
"xano auth -k # for self-signed certificates",
|
|
65
103
|
"xano auth --no-browser # headless: paste the code shown in the browser",
|
|
104
|
+
"xano auth --code \"$CODE\" -i my-instance -w 5 --json # one-shot non-interactive (scripts/agents)",
|
|
105
|
+
"xano auth --code \"$CODE\" -i https://my-instance.xano.io -w 5 # -i also accepts the instance URL",
|
|
106
|
+
"XANO_AUTH_CODE=\"$CODE\" xano auth -i 42 -w 5 # code via env var, instance by numeric ID",
|
|
66
107
|
"xano auth -i my-instance -w 5 -b dev -p staging # pre-answer all pickers",
|
|
67
|
-
"xano auth --no-browser -i my-instance -w
|
|
108
|
+
"echo \"$CODE\" | xano auth --no-browser -i my-instance -w 5 # piped stdin, no prompt at all"
|
|
68
109
|
]
|
|
69
110
|
}
|
|
70
111
|
],
|
|
@@ -82,6 +123,21 @@ The sandbox is a free-tier personal dev environment (auto-provisioned singleton
|
|
|
82
123
|
],
|
|
83
124
|
example: `npm install -g @xano/cli
|
|
84
125
|
xano auth
|
|
126
|
+
xano profile me`
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "AI Agent / Scripted Setup (one-shot, no TTY)",
|
|
130
|
+
description: "Authenticate without an interactive terminal or a waiting CLI process — the agent sends the user to the static login URL, the user pastes back the code, and one command finishes the profile",
|
|
131
|
+
steps: [
|
|
132
|
+
"Install CLI: `npm install -g @xano/cli`",
|
|
133
|
+
"Send the user to `<origin>/login?dest=cli&display=code` and ask for the code shown after login",
|
|
134
|
+
"(With the Xano MCP connected) call `xano_me` and use its instanceUrl for -i and workspaceId for -w",
|
|
135
|
+
"Run: `xano auth --code \"$CODE\" -i <instanceUrl> -w <workspaceId> --json`",
|
|
136
|
+
"Verify: `xano profile me`"
|
|
137
|
+
],
|
|
138
|
+
example: `npm install -g @xano/cli
|
|
139
|
+
# user logs in at https://app.xano.com/login?dest=cli&display=code and pastes back the code
|
|
140
|
+
xano auth --code "$CODE" -i https://xabc-1234-defg.xano.io -w 9 --json
|
|
85
141
|
xano profile me`
|
|
86
142
|
},
|
|
87
143
|
{
|
|
@@ -90,7 +146,7 @@ xano profile me`
|
|
|
90
146
|
steps: [
|
|
91
147
|
"Run: `xano auth --no-browser` (add -i/-w/-b/-p to skip the pickers)",
|
|
92
148
|
"Open the printed URL in any browser and log in",
|
|
93
|
-
"Copy the code shown in the browser and paste it into the CLI prompt",
|
|
149
|
+
"Copy the code shown in the browser and paste it into the CLI prompt (or pipe it on stdin: `echo \"$CODE\" | xano auth --no-browser ...`)",
|
|
94
150
|
"Verify: `xano profile me`"
|
|
95
151
|
],
|
|
96
152
|
example: `xano auth --no-browser -i my-instance -w 5 -b dev -p staging
|
|
@@ -32,7 +32,7 @@ npm link
|
|
|
32
32
|
\`\`\`bash
|
|
33
33
|
xano auth
|
|
34
34
|
\`\`\`
|
|
35
|
-
Opens your browser to log in. Automatically creates a profile. On remote/SSH/Docker hosts where the browser can't reach the CLI, use \`xano auth --no-browser\` (prints a URL; paste back the code shown in the browser).
|
|
35
|
+
Opens your browser to log in. Automatically creates a profile. On remote/SSH/Docker hosts where the browser can't reach the CLI, use \`xano auth --no-browser\` (prints a URL; paste back the code shown in the browser). Scripts and AI agents should use the one-shot form instead: \`xano auth --code "$CODE" -i <instance> -w <workspace> --json\` (see the auth topic).
|
|
36
36
|
|
|
37
37
|
**Option 2: Interactive wizard**
|
|
38
38
|
\`\`\`bash
|
package/package.json
CHANGED