@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
24 lines (22 loc) • 789 B
text/typescript
import { defineCommand } from "../../../core/defineCommand";
import { getProjectNamespace } from "../../../utils/projects";
import { envAndComponents } from "../../../apps/cli/commands/project/utils/autocompletions";
import { hasDeployType } from "../../availability";
export const commandNamespace = defineCommand({
name: "project k8s namespace",
description: "show namespace of local project",
group: "project",
isAvailable: hasDeployType("kubernetes"),
inputs: {
envComponent: {
type: "string",
message: "environment:component",
positional: true,
choices: async () => envAndComponents(),
},
},
execute: async (ctx) => {
const envComponent = await ctx.get("envComponent");
ctx.log(await getProjectNamespace(envComponent));
},
});