Initial Commit

This commit is contained in:
2026-08-08 22:23:27 +07:00 Unverified
commit c08fb36d2e
22 changed files with 6212 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { defineCommand } from "citty";
import { listDeployments } from "../lib/shared";
import { toTable } from "../lib/format";
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 } }) {
console.log(
toTable(
(await listDeployments())
.filter((d) => all || d.status?.replicas)
.map((d) => ({
name: d.metadata?.name,
status: `${d.status?.availableReplicas}/${d.status?.replicas}`,
})),
),
);
},
});
+26
View File
@@ -0,0 +1,26 @@
import { defineCommand } from "citty";
import { ctx } from "../lib/context";
import { serviceToDeployment } from "../lib/convert";
export const up = defineCommand({
meta: {
name: "up",
description: "Create and start deployments",
},
args: {
build: {
type: "boolean",
default: true,
alias: "b",
description: "Build images before starting deployments",
negativeDescription: "Don't build an image, even if it's policy",
},
},
async run() {
const { project, compose } = ctx();
const cmp = await compose();
console.dir(serviceToDeployment(project, "app", cmp.services!.app!), {
depth: 999,
});
},
});