import { defineCommand } from "citty"; import { buildNamespaceGraphs, fetchNamespaceObjects, renderNamespaceGraphs, } from "../lib/graph"; import { getProject } from "../lib/shared"; export const ps = defineCommand({ meta: { name: "ps", description: "List deployments", }, args: { all: { type: "boolean", alias: "a", description: "Show all stopped deployments (including those created by the run command)", }, }, async run({ args: { all } }) { const objects = await fetchNamespaceObjects(getProject()); console.log( renderNamespaceGraphs( buildNamespaceGraphs(objects, { includeIdle: all }), ), ); }, });