@f-o-h/cli 0.1.1 → 0.1.2
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 +7 -4
- package/dist/foh.js +47 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ AI-operator provisioning CLI for Front Of House.
|
|
|
4
4
|
|
|
5
5
|
Public mirror: https://github.com/iiko38/front-of-house-cli
|
|
6
6
|
|
|
7
|
-
Current published baseline: `@f-o-h/cli@0.1.
|
|
7
|
+
Current published baseline: `@f-o-h/cli@0.1.2`
|
|
8
8
|
|
|
9
9
|
This mirror is a generated release artifact. The private product monorepo is not
|
|
10
10
|
published here, and no open-source license is granted unless stated separately.
|
|
@@ -31,6 +31,7 @@ npx @f-o-h/cli --version
|
|
|
31
31
|
## First Run
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
+
foh auth signup --web
|
|
34
35
|
foh auth login --web
|
|
35
36
|
foh auth login
|
|
36
37
|
foh org list
|
|
@@ -41,6 +42,7 @@ foh setup
|
|
|
41
42
|
For AI agents and text-only terminals:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
45
|
+
foh auth signup --web --json
|
|
44
46
|
foh auth login --web --json
|
|
45
47
|
foh auth login --email "$FOH_EMAIL" --password "$FOH_PASSWORD" --json
|
|
46
48
|
foh org list --json
|
|
@@ -48,8 +50,9 @@ foh org use --org <org-id> --json
|
|
|
48
50
|
foh setup --org <org-id> --agent-template <template-id> --agent-name "Demo Agent" --json
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
`auth
|
|
52
|
-
prints the fallback URL.
|
|
53
|
-
device-code browser-token
|
|
53
|
+
`auth signup --web` opens the console signup page when possible and always
|
|
54
|
+
prints the fallback URL. `auth login --web` does the same for sign-in. The CLI
|
|
55
|
+
still requires explicit credential auth until device-code browser-token
|
|
56
|
+
exchange is available.
|
|
54
57
|
|
|
55
58
|
The CLI defaults to the production API at `https://api.frontofhouse.okii.uk`.
|
package/dist/foh.js
CHANGED
|
@@ -10146,7 +10146,10 @@ function resolveConsoleBaseUrl(cliOverride) {
|
|
|
10146
10146
|
return normalizeBaseUrl(cliOverride ?? process.env.FOH_CONSOLE_URL);
|
|
10147
10147
|
}
|
|
10148
10148
|
function buildConsoleSignInUrl(consoleUrl) {
|
|
10149
|
-
return `${normalizeBaseUrl(consoleUrl)}/sign-in?
|
|
10149
|
+
return `${normalizeBaseUrl(consoleUrl)}/sign-in?redirect=%2Fdashboard`;
|
|
10150
|
+
}
|
|
10151
|
+
function buildConsoleSignUpUrl(consoleUrl) {
|
|
10152
|
+
return `${normalizeBaseUrl(consoleUrl)}/sign-up?redirect=%2Fdashboard`;
|
|
10150
10153
|
}
|
|
10151
10154
|
function buildCliAuthFallbackCommands() {
|
|
10152
10155
|
return [
|
|
@@ -10170,6 +10173,22 @@ function buildCliAuthFallbackInstructions(signInUrl) {
|
|
|
10170
10173
|
]
|
|
10171
10174
|
};
|
|
10172
10175
|
}
|
|
10176
|
+
function buildCliSignupFallbackInstructions(signUpUrl) {
|
|
10177
|
+
return {
|
|
10178
|
+
human: [
|
|
10179
|
+
`Open ${signUpUrl}`,
|
|
10180
|
+
"Create a Front Of House account.",
|
|
10181
|
+
"Confirm your email if prompted.",
|
|
10182
|
+
"Return to the terminal and run `foh auth login --web --json` or credential login."
|
|
10183
|
+
],
|
|
10184
|
+
ai_agent: [
|
|
10185
|
+
"Show the sign_up_url to the user if browser opening is unavailable.",
|
|
10186
|
+
"Ask the user to complete signup and email confirmation in the browser.",
|
|
10187
|
+
"After the user confirms signup, run `foh auth login --web --json`.",
|
|
10188
|
+
"Never ask the user to paste browser cookies or local storage."
|
|
10189
|
+
]
|
|
10190
|
+
};
|
|
10191
|
+
}
|
|
10173
10192
|
|
|
10174
10193
|
// src/lib/open-url.ts
|
|
10175
10194
|
var import_child_process = require("child_process");
|
|
@@ -10213,6 +10232,25 @@ function emitBrowserAuthLink(opts) {
|
|
|
10213
10232
|
text_fallback: buildCliAuthFallbackInstructions(signInUrl)
|
|
10214
10233
|
}, { json: opts.json ?? false });
|
|
10215
10234
|
}
|
|
10235
|
+
function emitBrowserSignupLink(opts) {
|
|
10236
|
+
const consoleUrl = resolveConsoleBaseUrl(opts.consoleUrl);
|
|
10237
|
+
const signUpUrl = buildConsoleSignUpUrl(consoleUrl);
|
|
10238
|
+
const openResult = openUrl(signUpUrl);
|
|
10239
|
+
format({
|
|
10240
|
+
status: openResult.attempted ? "browser_signup_link_opened" : "browser_signup_link",
|
|
10241
|
+
sign_up_url: signUpUrl,
|
|
10242
|
+
opened: openResult.attempted,
|
|
10243
|
+
opener_command: openResult.command,
|
|
10244
|
+
opener_error: openResult.error ?? null,
|
|
10245
|
+
cli_auth_required_after_signup: true,
|
|
10246
|
+
note: "Signup is completed in the FOH console. After account creation and email confirmation, return to the CLI and authenticate.",
|
|
10247
|
+
next_commands: [
|
|
10248
|
+
"foh auth login --web --json",
|
|
10249
|
+
...buildCliAuthFallbackCommands()
|
|
10250
|
+
],
|
|
10251
|
+
text_fallback: buildCliSignupFallbackInstructions(signUpUrl)
|
|
10252
|
+
}, { json: opts.json ?? false });
|
|
10253
|
+
}
|
|
10216
10254
|
async function resolveLoginInputs(opts) {
|
|
10217
10255
|
let email3 = String(opts.email ?? "").trim();
|
|
10218
10256
|
let password = String(opts.password ?? "").trim();
|
|
@@ -10347,6 +10385,12 @@ function registerAuth(program3) {
|
|
|
10347
10385
|
}
|
|
10348
10386
|
format(output, { json: opts.json ?? false });
|
|
10349
10387
|
}));
|
|
10388
|
+
auth.command("signup").description("Open account signup and print text fallback commands").option("--web", "Open browser signup and print text fallback commands", true).option("--browser", "Alias for --web").option("--console-url <url>", "Console signup URL override").option("--json", "Output as JSON").action((opts) => {
|
|
10389
|
+
emitBrowserSignupLink({
|
|
10390
|
+
consoleUrl: opts.consoleUrl,
|
|
10391
|
+
json: opts.json
|
|
10392
|
+
});
|
|
10393
|
+
});
|
|
10350
10394
|
auth.command("logout").description("Remove stored credentials").option("--json", "Output as JSON").action((opts) => {
|
|
10351
10395
|
clearCredentials();
|
|
10352
10396
|
format({ status: "logged_out" }, { json: opts.json ?? false });
|
|
@@ -32184,7 +32228,7 @@ var StdioServerTransport = class {
|
|
|
32184
32228
|
};
|
|
32185
32229
|
|
|
32186
32230
|
// src/lib/cli-version.ts
|
|
32187
|
-
var CLI_VERSION = "0.1.
|
|
32231
|
+
var CLI_VERSION = "0.1.2";
|
|
32188
32232
|
|
|
32189
32233
|
// src/commands/mcp-serve.ts
|
|
32190
32234
|
var DEFAULT_TIMEOUT_MS = 12e4;
|
|
@@ -33702,6 +33746,7 @@ function buildMissingOptionsPlan(missing, opts) {
|
|
|
33702
33746
|
reason: "setup requires an authenticated org, an agent template, and an agent name before it can mutate customer resources",
|
|
33703
33747
|
sign_in_url: signInUrl,
|
|
33704
33748
|
next_commands: [
|
|
33749
|
+
"foh auth signup --web --json",
|
|
33705
33750
|
"foh auth login --web --json",
|
|
33706
33751
|
...buildCliAuthFallbackCommands(),
|
|
33707
33752
|
"foh templates list --json",
|