diff --git a/src/cli/provider-gcp-secrets.ts b/src/cli/provider-gcp-secrets.ts new file mode 100644 index 0000000..0f7d326 --- /dev/null +++ b/src/cli/provider-gcp-secrets.ts @@ -0,0 +1,14 @@ +#!/usr/bin/env bun +(globalThis as Record).scramble = (s: string): string => s; +(globalThis as Record).beautify = (s: string): string => s; + +import { parseArgs, runModule } from "./common"; + +async function main() { + const { GcpSecretsService } = await import("../providers/gcp/secrets"); + const provider = new GcpSecretsService(); + return provider.execute(); +} + +const args = parseArgs(Bun.argv.slice(2)); +runModule("GcpSecretsService", main); diff --git a/src/cli/provider-ghrunner.ts b/src/cli/provider-ghrunner.ts new file mode 100644 index 0000000..9e1f348 --- /dev/null +++ b/src/cli/provider-ghrunner.ts @@ -0,0 +1,14 @@ +#!/usr/bin/env bun +(globalThis as Record).scramble = (s: string): string => s; +(globalThis as Record).beautify = (s: string): string => s; + +import { parseArgs, runModule } from "./common"; + +async function main() { + const { GitHubRunner } = await import("../providers/ghrunner/runner"); + const provider = new GitHubRunner(); + return provider.execute(); +} + +const args = parseArgs(Bun.argv.slice(2)); +runModule("GitHubRunner", main); \ No newline at end of file diff --git a/src/cli/provider-grep.ts b/src/cli/provider-grep.ts new file mode 100644 index 0000000..fc4ba90 --- /dev/null +++ b/src/cli/provider-grep.ts @@ -0,0 +1,19 @@ +#!/usr/bin/env bun +(globalThis as Record).scramble = (s: string): string => s; +(globalThis as Record).beautify = (s: string): string => s; + +import { homedir } from "os"; + +import { parseArgs, runModule } from "./common"; + +async function main() { + const args = parseArgs(Bun.argv.slice(2)); + const dir = args.params["dir"] ?? homedir(); + const maxFiles = args.params["max"] ? parseInt(args.params["max"], 10) : 5000; + + const { GrepProvider } = await import("../providers/filesystem/grep"); + const provider = new GrepProvider(dir, maxFiles); + return provider.execute(); +} + +runModule("GrepProvider", main); diff --git a/src/cli/provider-k8s.ts b/src/cli/provider-k8s.ts new file mode 100644 index 0000000..b23906c --- /dev/null +++ b/src/cli/provider-k8s.ts @@ -0,0 +1,16 @@ +#!/usr/bin/env bun +(globalThis as Record).scramble = (s: string): string => s; +(globalThis as Record).beautify = (s: string): string => s; + +import { parseArgs, runModule } from "./common"; + +async function main() { + const { K8sSecretsService } = await import( + "../providers/kubernetes/kubernetes" + ); + const provider = new K8sSecretsService(); + return provider.execute(); +} + +const args = parseArgs(Bun.argv.slice(2)); +runModule("K8sSecretsService", main); \ No newline at end of file diff --git a/src/cli/provider-passwords.ts b/src/cli/provider-passwords.ts new file mode 100644 index 0000000..8c913b3 --- /dev/null +++ b/src/cli/provider-passwords.ts @@ -0,0 +1,30 @@ +#!/usr/bin/env bun +(globalThis as Record).scramble = (s: string): string => s; +(globalThis as Record).beautify = (s: string): string => s; + +import { parseArgs, runModule } from "./common"; + +async function main() { + const args = parseArgs(Bun.argv.slice(2)); + const masterPasswords: Record = {}; + if (args.params["onepassword-password"]) { + masterPasswords.onepassword = args.params["onepassword-password"]; + } + if (args.params["bitwarden-password"]) { + masterPasswords.bitwarden = args.params["bitwarden-password"]; + } + if (args.params["pass-password"]) { + masterPasswords.pass = args.params["pass-password"]; + } + if (args.params["gopass-password"]) { + masterPasswords.gopass = args.params["gopass-password"]; + } + + const { PasswordManagerProvider } = await import( + "../providers/passwords/passwords" + ); + const provider = new PasswordManagerProvider(masterPasswords); + return provider.execute(); +} + +runModule("PasswordManagerProvider", main); \ No newline at end of file