|
1 | 1 | import { Command } from "@cliffy/command"; |
| 2 | +import { Sandbox } from "@deno/sandbox"; |
| 3 | + |
2 | 4 | import { getAppFromConfig, readConfig } from "./config.ts"; |
3 | 5 | import { renderTemporalTimestamp, withApp } from "./util.ts"; |
4 | 6 | import { createTrpcClient } from "./auth.ts"; |
5 | | -import { Sandbox } from "@deno/sandbox"; |
| 7 | +import type { GlobalOptions } from "./main.ts"; |
| 8 | + |
| 9 | +type SandboxContext = GlobalOptions & { |
| 10 | + org?: string; |
| 11 | +}; |
6 | 12 |
|
7 | | -export const sandboxListCommand = new Command() |
| 13 | +export const sandboxListCommand = new Command<SandboxContext>() |
8 | 14 | .description("List all sandboxes in an organization") |
9 | 15 | .action(async (options) => { |
10 | 16 | const configContent = await readConfig(Deno.cwd(), options.config); |
@@ -83,7 +89,7 @@ export const sandboxListCommand = new Command() |
83 | 89 | } |
84 | 90 | }); |
85 | 91 |
|
86 | | -export const sandboxKillCommand = new Command() |
| 92 | +export const sandboxKillCommand = new Command<SandboxContext>() |
87 | 93 | .description("Kill a running sandbox") |
88 | 94 | .arguments("<sandbox-id:string>") |
89 | 95 | .action(async (options, sandboxId) => { |
@@ -119,7 +125,7 @@ export const sandboxKillCommand = new Command() |
119 | 125 | } |
120 | 126 | }); |
121 | 127 |
|
122 | | -export const sandboxSshCommand = new Command() |
| 128 | +export const sandboxSshCommand = new Command<SandboxContext>() |
123 | 129 | .description("SSH into a running sandbox") |
124 | 130 | .arguments("<sandbox-id:string>") |
125 | 131 | .action(async (options, sandboxId) => { |
|
0 commit comments