@vincentt-xr/cli 0.4.0 → 0.4.1
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/index.js +7 -4
- package/dist/shared/config.d.ts +2 -0
- package/dist/shared/config.js +2 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -62,18 +62,20 @@ function positional(n) {
|
|
|
62
62
|
return positionalArgs(argv)[n];
|
|
63
63
|
}
|
|
64
64
|
// ---- auth -------------------------------------------------------------------
|
|
65
|
-
function resolveAuthUrls() {
|
|
65
|
+
async function resolveAuthUrls() {
|
|
66
|
+
const machine = await loadMachineConfig();
|
|
66
67
|
const consoleUrl = flag("--console") ??
|
|
67
68
|
flag("--editor") ??
|
|
68
69
|
process.env.VINCENTT_CONSOLE_URL ??
|
|
69
70
|
process.env.VINCENTT_EDITOR_URL ??
|
|
71
|
+
machine.consoleUrl ??
|
|
70
72
|
DEFAULT_CONSOLE_URL;
|
|
71
|
-
const apiUrl = flag("--api") ?? process.env.VINCENTT_API_URL ?? DEFAULT_API_URL;
|
|
73
|
+
const apiUrl = flag("--api") ?? process.env.VINCENTT_API_URL ?? machine.apiUrl ?? DEFAULT_API_URL;
|
|
72
74
|
return { consoleUrl, apiUrl };
|
|
73
75
|
}
|
|
74
76
|
/** The PKCE loopback + code-exchange login (f1). The raw PAT never rides a redirect query. */
|
|
75
77
|
async function runLoginFlow() {
|
|
76
|
-
const { consoleUrl, apiUrl } = resolveAuthUrls();
|
|
78
|
+
const { consoleUrl, apiUrl } = await resolveAuthUrls();
|
|
77
79
|
return runPkceLogin({
|
|
78
80
|
consoleUrl,
|
|
79
81
|
apiUrl,
|
|
@@ -82,7 +84,7 @@ async function runLoginFlow() {
|
|
|
82
84
|
}
|
|
83
85
|
/** `vincentt login` [--force] — the L1/L2/L4 transcripts. */
|
|
84
86
|
async function login() {
|
|
85
|
-
const { apiUrl } = resolveAuthUrls();
|
|
87
|
+
const { apiUrl } = await resolveAuthUrls();
|
|
86
88
|
const code = await loginCommand({
|
|
87
89
|
print: (line) => console.log(line),
|
|
88
90
|
currentToken,
|
|
@@ -563,6 +565,7 @@ function usage() {
|
|
|
563
565
|
` Full guide: npm view @vincentt-xr/cli readme\n\n` +
|
|
564
566
|
`Auth\n` +
|
|
565
567
|
` login Sign in; save an access token to ~/.vincentt/config.json\n` +
|
|
568
|
+
` [--api <url>] [--console <url>] to target a non-prod env\n` +
|
|
566
569
|
` logout Remove the saved access token\n` +
|
|
567
570
|
` whoami Show the signed-in account\n\n` +
|
|
568
571
|
`Project\n` +
|
package/dist/shared/config.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface MachineConfig {
|
|
2
2
|
/** Base URL of the Vincentt backend API (e.g. https://api.vincentt.studio). */
|
|
3
3
|
apiUrl: string;
|
|
4
|
+
/** Console origin that serves /cli-auth (e.g. https://vincentt.app); used by `login`. */
|
|
5
|
+
consoleUrl: string;
|
|
4
6
|
/** Personal access token (bearer) for machine auth. */
|
|
5
7
|
pat: string;
|
|
6
8
|
/** Org slug commands act in when no --org flag or VINCENTT_ORG env is given. */
|
package/dist/shared/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Config the lifecycle MCP verbs (project_create / project_publish) read to reach
|
|
2
2
|
// a creator's Vincentt backend. Two homes, by sensitivity:
|
|
3
|
-
// • ~/.vincentt/config.json — machine-global { apiUrl, pat }. The
|
|
4
|
-
// bearer credential, so it lives OUTSIDE any repo (never committed).
|
|
3
|
+
// • ~/.vincentt/config.json — machine-global { apiUrl, consoleUrl, pat }. The
|
|
4
|
+
// PAT is a bearer credential, so it lives OUTSIDE any repo (never committed).
|
|
5
5
|
// • <project>/.vincentt/project.json — the per-tree binding { projectId, slug }.
|
|
6
6
|
// Gitignored: `git archive HEAD` (the remix path) must NOT carry it, or a
|
|
7
7
|
// remixer would inherit — and publish over — the original's project.
|
package/package.json
CHANGED