Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit a5038f4

Browse files
committed
Add handler for workspaces
1 parent 09329cb commit a5038f4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/cli/commands/workspaces.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import executeCommand from "../execute-command"
2+
import { YargsWithGlobalOptions } from "../global-options"
3+
4+
export default {
5+
command: "workspaces",
6+
aliases: ["workspace"],
7+
describe: "interact with workspaces",
8+
builder: (yargs: YargsWithGlobalOptions) => {
9+
yargs
10+
.demandCommand()
11+
.command(
12+
"get <id>",
13+
"get a workspace",
14+
(yargs) => {
15+
return yargs.positional("id", {
16+
describe: "the workspace ID",
17+
demandOption: true,
18+
})
19+
},
20+
async (argv) => {
21+
await executeCommand("workspaces.get", [argv.id], argv)
22+
}
23+
)
24+
.command(
25+
"list",
26+
"list workspaces",
27+
() => {},
28+
async (argv) => {
29+
await executeCommand("workspaces.list", [], argv)
30+
}
31+
)
32+
.command(
33+
"reset-sandbox",
34+
"reset the sandbox associated with the current API key",
35+
() => {},
36+
async (argv) => {
37+
await executeCommand("workspaces.resetSandbox", [], argv)
38+
}
39+
)
40+
},
41+
}

0 commit comments

Comments
 (0)