// SPDX-License-Identifier: MIT import { login } from "../../azure/index.ts"; import { loadConfig } from "../../index.ts"; import type { CommandValues } from "./types.ts"; export function usageLogin(): string { return `Usage: sk-az-tools login [--resources ] [--use-device-code] [--no-browser] [--browser ] [--browser-profile ] [global options] Options: --resources Comma-separated resources: graph,devops,arm (default: all) --use-device-code Use device code flow instead of interactive flow --no-browser Do not launch browser; print interactive URL to stderr --browser Browser keyword: brave|browser|browserPrivate|chrome|edge|firefox --browser-profile Chromium profile name (e.g. Default, "Profile 1")`; } export async function runLoginCommand(values: CommandValues): Promise { const config = await loadConfig("public-config"); return login( config.tenantId, config.clientId, values.resources, Boolean(values["use-device-code"]), Boolean(values["no-browser"]), values.browser, values["browser-profile"], ); }