Bump version to 0.3.0 and add get-token command for Azure token retrieval
This commit is contained in:
12
src/cli.ts
12
src/cli.ts
@@ -14,6 +14,7 @@ import {
|
||||
|
||||
type CliValues = {
|
||||
help?: boolean;
|
||||
type?: string;
|
||||
"display-name"?: string;
|
||||
"app-id"?: string;
|
||||
resources?: string;
|
||||
@@ -37,6 +38,7 @@ function usage(): string {
|
||||
Commands:
|
||||
login Authenticate selected resources
|
||||
logout Sign out and clear login state
|
||||
get-token Get access token (azurerm|devops)
|
||||
list-apps List Entra applications
|
||||
list-app-permissions List required permissions for an app
|
||||
list-app-grants List OAuth2 grants for an app
|
||||
@@ -79,6 +81,13 @@ Options:
|
||||
--all Clear login state and remove all cached accounts`;
|
||||
}
|
||||
|
||||
function usageGetToken(): string {
|
||||
return `Usage: sk-az-tools get-token --type|-t <azurerm|devops> [global options]
|
||||
|
||||
Options:
|
||||
-t, --type <value> Token type: azurerm|devops`;
|
||||
}
|
||||
|
||||
function usageListAppPermissions(): string {
|
||||
return `Usage: sk-az-tools list-app-permissions --app-id|-i <appId> [--resolve|-r] [--short|-s] [--filter|-f <glob>] [global options]
|
||||
|
||||
@@ -120,6 +129,8 @@ function usageCommand(command: string): string {
|
||||
return usageListApps();
|
||||
case "logout":
|
||||
return usageLogout();
|
||||
case "get-token":
|
||||
return usageGetToken();
|
||||
case "list-app-permissions":
|
||||
return usageListAppPermissions();
|
||||
case "list-app-grants":
|
||||
@@ -150,6 +161,7 @@ async function main(): Promise<void> {
|
||||
args: argv.slice(1),
|
||||
options: {
|
||||
help: { type: "boolean", short: "h" },
|
||||
type: { type: "string", short: "t" },
|
||||
"display-name": { type: "string", short: "n" },
|
||||
"app-id": { type: "string", short: "i" },
|
||||
resources: { type: "string" },
|
||||
|
||||
Reference in New Issue
Block a user