Skip to content

Commit 7926c49

Browse files
kitlangtonbalcsida
authored andcommitted
feat(cli): add console account subcommands (anomalyco#17265)
1 parent 1ad228f commit 7926c49

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

packages/opencode/src/cli/cmd/account.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,28 @@ export const OrgsCommand = cmd({
192192
await runtime.runPromise(orgsEffect())
193193
},
194194
})
195+
196+
export const ConsoleCommand = cmd({
197+
command: "console",
198+
describe: "manage console account",
199+
builder: (yargs) =>
200+
yargs
201+
.command({
202+
...LoginCommand,
203+
describe: "log in to console",
204+
})
205+
.command({
206+
...LogoutCommand,
207+
describe: "log out from console",
208+
})
209+
.command({
210+
...SwitchCommand,
211+
describe: "switch active org",
212+
})
213+
.command({
214+
...OrgsCommand,
215+
describe: "list orgs",
216+
})
217+
.demandCommand(),
218+
async handler() {},
219+
})

packages/opencode/src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { hideBin } from "yargs/helpers"
33
import { RunCommand } from "./cli/cmd/run"
44
import { GenerateCommand } from "./cli/cmd/generate"
55
import { Log } from "./util/log"
6-
import { LoginCommand, LogoutCommand, SwitchCommand, OrgsCommand } from "./cli/cmd/account"
6+
import { ConsoleCommand } from "./cli/cmd/account"
77
import { ProvidersCommand } from "./cli/cmd/providers"
88
import { AgentCommand } from "./cli/cmd/agent"
99
import { UpgradeCommand } from "./cli/cmd/upgrade"
@@ -135,10 +135,7 @@ let cli = yargs(hideBin(process.argv))
135135
.command(RunCommand)
136136
.command(GenerateCommand)
137137
.command(DebugCommand)
138-
.command(LoginCommand)
139-
.command(LogoutCommand)
140-
.command(SwitchCommand)
141-
.command(OrgsCommand)
138+
.command(ConsoleCommand)
142139
.command(ProvidersCommand)
143140
.command(AgentCommand)
144141
.command(UpgradeCommand)

0 commit comments

Comments
 (0)