Skip to content

Commit 9c6219f

Browse files
committed
fix(cli): restore positional session command routing
1 parent 93bb3a3 commit 9c6219f

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/awsesh/src/cli/cmd/cli-integration.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ describe("CLI", () => {
102102
});
103103
});
104104

105+
describe("direct session command", () => {
106+
test("resolves positional args to session command", async () => {
107+
const { stderr, exitCode } = await runCli(["missing-session", "account", "role"], testEnv("session-direct"));
108+
expect(exitCode).toBe(1);
109+
expect(stderr).toContain("SSO session 'missing-session' not found");
110+
});
111+
});
112+
105113
describe("auth (no session)", () => {
106114
test("exits with error when no session specified", async () => {
107115
const { stderr, exitCode } = await runCli(["auth"], testEnv("auth-no-session"));

packages/awsesh/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { sessions } from "./cli/cmd/sessions.js"
1414
import { accounts } from "./cli/cmd/accounts.js"
1515
import { credentials } from "./cli/cmd/credentials.js"
1616
import { set } from "./cli/cmd/set.js"
17+
import { session } from "./cli/cmd/session.js"
1718

1819
import { Installation } from "./installation"
1920
import { createCliRenderer } from "@opentui/core"
@@ -57,6 +58,7 @@ const cli = yargs(args)
5758
})
5859
})
5960
.usage("")
61+
.command(session)
6062
.command(TuiCommand)
6163
.command(set)
6264
.command(sessions)

0 commit comments

Comments
 (0)