coolsecrets 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # coolsecrets
2
+
3
+ CLI that syncs secrets from [Infisical](https://infisical.com) into a [Coolify](https://coolify.io) application's environment variables.
4
+
5
+ It reads a JSON payload from stdin (typically the output of `infisical export --format=json`) and upserts the keys into a single Coolify app you linked once. No file is ever written with your secret values — the CLI is a thin glue between the two APIs.
6
+
7
+ > Need automatic syncing on every Infisical change? The same repo ships a webhook server you can self-host via Docker (`ghcr.io/joaoseixas88/coolsecrets-server`). See the [project README](https://github.com/joaoseixas88/coolsecrets) for the server setup.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g coolsecrets
13
+ # or
14
+ pnpm add -g coolsecrets
15
+ ```
16
+
17
+ Requires Node `>=20`.
18
+
19
+ ## Quick start
20
+
21
+ ```bash
22
+ # 1. one-time setup: paste your Coolify base URL + API token, pick the app
23
+ coolsecrets init
24
+
25
+ # 2. sync — pipe the Infisical export, the CLI upserts the envs in Coolify
26
+ infisical export --env=prod --format=json | coolsecrets sync
27
+ ```
28
+
29
+ The first run of `init` writes credentials to `~/.config/coolsecrets/config.json` (mode `0600`) and a `.coolsecrets.json` in the current directory binding it to a specific Coolify application. `sync` reuses both.
30
+
31
+ Re-run `init` (or `coolsecrets --init`) inside a different project directory to link it to another Coolify app.
32
+
33
+ ## Commands
34
+
35
+ ### `coolsecrets init`
36
+
37
+ Interactive setup. Prompts for:
38
+
39
+ - Coolify base URL (e.g. `https://coolify.example.com`)
40
+ - Coolify API token (Bearer token from Coolify → Keys & Tokens)
41
+ - Which application in your Coolify instance this directory should sync to
42
+
43
+ Writes credentials once globally; subsequent `init` runs in other directories skip the prompts and only ask for the target application.
44
+
45
+ ### `coolsecrets sync`
46
+
47
+ Reads a JSON payload from stdin and PATCHes it into the linked Coolify application as environment variables. Performs **upsert only** — keys that exist in Coolify but are not in the input are left untouched.
48
+
49
+ Two stdin payload shapes are accepted:
50
+
51
+ ```json
52
+ [
53
+ { "key": "DATABASE_URL", "value": "postgres://..." },
54
+ { "key": "API_KEY", "value": "secret" }
55
+ ]
56
+ ```
57
+
58
+ or the legacy flat object:
59
+
60
+ ```json
61
+ { "DATABASE_URL": "postgres://...", "API_KEY": "secret" }
62
+ ```
63
+
64
+ The first shape is what `infisical export --format=json` produces in current versions.
65
+
66
+ ### Default action
67
+
68
+ Running `coolsecrets` with no arguments behaves like `coolsecrets sync`. Running `coolsecrets --init` is equivalent to `coolsecrets init`.
69
+
70
+ ## Configuration files
71
+
72
+ | Path | Purpose |
73
+ |---|---|
74
+ | `$XDG_CONFIG_HOME/coolsecrets/config.json` (or `~/.config/coolsecrets/config.json`) | Coolify base URL + API token. Shared across all projects on this machine. Mode `0600`. |
75
+ | `./.coolsecrets.json` | Binding to a specific Coolify application (`applicationId`, `applicationName`, `projectName`). One per directory. Mode `0600`. |
76
+
77
+ Both files are JSON and safe to edit by hand if needed.
78
+
79
+ ## Behavior notes
80
+
81
+ - **Upsert only.** Removing a key in Infisical does not remove it in Coolify. Use the Coolify UI to drop stale keys.
82
+ - **Multi-line values** are sent with `is_multiline: true` automatically when the value contains `\n`.
83
+ - **Folder conflicts.** If your export contains the same key under multiple secret paths, the last one wins (whichever appears last in the input).
84
+ - **No subcommand TTY trap.** If you run `coolsecrets sync` without piping anything, it errors out with a clear "no stdin received" message and an example invocation.
85
+
86
+ ## License
87
+
88
+ ISC. See the [project repository](https://github.com/joaoseixas88/coolsecrets) for the full source.
package/dist/index.js CHANGED
@@ -22,7 +22,17 @@ var ZodSchemaValidator = class {
22
22
  applicationName: z.string().trim().min(1, "Application name is required."),
23
23
  projectName: z.string().trim().min(1).nullable()
24
24
  });
25
- infisicalExportSchema = z.record(z.string().trim().min(1, "Environment variable keys must not be empty."), z.string());
25
+ infisicalExportObjectSchema = z.record(z.string().trim().min(1, "Environment variable keys must not be empty."), z.string());
26
+ infisicalExportArraySchema = z.array(z.object({
27
+ key: z.string().trim().min(1, "Environment variable keys must not be empty."),
28
+ value: z.string()
29
+ }).passthrough()).transform((entries) => {
30
+ const out = {};
31
+ for (const entry of entries) {
32
+ out[entry.key] = entry.value;
33
+ }
34
+ return out;
35
+ });
26
36
  rawCoolifyApplicationSchema = z.object({
27
37
  id: z.string().trim().min(1).optional(),
28
38
  uuid: z.string().trim().min(1).optional(),
@@ -66,7 +76,10 @@ var ZodSchemaValidator = class {
66
76
  return this.parseWithSchema(this.applicationsPayloadSchema, value, "Invalid applications payload received from Coolify.");
67
77
  }
68
78
  parseInfisicalExport(value) {
69
- return this.parseWithSchema(this.infisicalExportSchema, value, "Infisical export payload must be a JSON object with string values.");
79
+ if (Array.isArray(value)) {
80
+ return this.parseWithSchema(this.infisicalExportArraySchema, value, "Infisical export array must contain objects with `key` and `value` strings.");
81
+ }
82
+ return this.parseWithSchema(this.infisicalExportObjectSchema, value, "Infisical export payload must be a JSON object with string values or an array of { key, value } entries.");
70
83
  }
71
84
  parseWithSchema(schema, value, fallbackMessage) {
72
85
  const result = schema.safeParse(value);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/create-cli.ts","../../shared/src/schemas.ts","../../shared/src/coolify-client.ts","../../shared/src/infisical-export-parser.ts","../src/config-store.ts","../src/init-prompter.ts","../src/init-command.ts","../src/read-stdin.ts","../src/sync-command.ts"],"sourcesContent":["import { CommanderError } from 'commander';\n\nimport { createCli } from './create-cli.js';\n\nasync function main(): Promise<void> {\n const program = createCli();\n\n try {\n await program.parseAsync(process.argv);\n } catch (error) {\n if (error instanceof CommanderError) {\n process.exitCode = error.exitCode;\n return;\n }\n\n throw error;\n }\n}\n\nvoid main();\n","import { Command } from 'commander';\n\nimport { HttpCoolifyClient, type CoolifyClient } from '@coolsecrets/shared';\n\nimport { FileConfigStore, type ConfigStore } from './config-store.js';\nimport { InteractiveInitPrompter, type InitPrompter } from './init-prompter.js';\nimport { InitCommand } from './init-command.js';\nimport { SyncCommand } from './sync-command.js';\n\nexport interface CreateCliOptions {\n cwd?: string;\n stdin?: NodeJS.ReadableStream;\n stdout?: NodeJS.WritableStream;\n stderr?: NodeJS.WritableStream;\n configStore?: ConfigStore;\n coolifyClient?: CoolifyClient;\n prompter?: InitPrompter;\n}\n\nexport class CoolSecretsCli {\n private readonly cwd: string;\n private readonly stdin: NodeJS.ReadableStream;\n private readonly stdout: NodeJS.WritableStream;\n private readonly stderr: NodeJS.WritableStream;\n private readonly configStore: ConfigStore;\n private readonly coolifyClient: CoolifyClient;\n private readonly prompter: InitPrompter;\n private readonly program: Command;\n\n constructor(options: CreateCliOptions = {}) {\n this.cwd = options.cwd ?? process.cwd();\n this.stdin = options.stdin ?? process.stdin;\n this.stdout = options.stdout ?? process.stdout;\n this.stderr = options.stderr ?? process.stderr;\n this.configStore = options.configStore ?? new FileConfigStore();\n this.coolifyClient = options.coolifyClient ?? new HttpCoolifyClient();\n this.prompter = options.prompter ?? new InteractiveInitPrompter();\n this.program = this.createProgram();\n }\n\n public getProgram(): Command {\n return this.program;\n }\n\n private createProgram(): Command {\n const program = new Command()\n .name('coolsecrets')\n .description('CLI to sync secrets from stdin into Coolify applications')\n .version('0.1.0')\n .option('--init', 'Initialize Coolify settings for the current directory')\n .configureOutput({\n writeOut: (message) => this.stdout.write(message),\n writeErr: (message) => this.stderr.write(message),\n })\n .showHelpAfterError()\n .exitOverride();\n\n this.configureInitCommand(program);\n this.configureSyncCommand(program);\n this.configureDefaultAction(program);\n\n return program;\n }\n\n private configureInitCommand(program: Command): void {\n const initCommand = program\n .command('init')\n .description('Initialize Coolify settings for the current directory');\n\n initCommand.action(async () => {\n await this.runInit(initCommand);\n });\n }\n\n private configureSyncCommand(program: Command): void {\n const syncCommand = program\n .command('sync')\n .description('Sync a piped JSON secrets payload into the linked Coolify application');\n\n syncCommand.action(async () => {\n await this.runSync(syncCommand);\n });\n }\n\n private configureDefaultAction(program: Command): void {\n program.action(async () => {\n if (program.opts<{ init?: boolean }>().init) {\n await this.runInit(program);\n return;\n }\n\n await this.runSync(program);\n });\n }\n\n private async runInit(command: Command): Promise<void> {\n try {\n await new InitCommand({\n cwd: this.cwd,\n stdout: this.stdout,\n configStore: this.configStore,\n coolifyClient: this.coolifyClient,\n prompter: this.prompter,\n }).execute();\n } catch (error) {\n command.error(error instanceof Error ? error.message : 'Unexpected init error.', {\n code: 'coolsecrets.init',\n exitCode: 1,\n });\n }\n }\n\n private async runSync(command: Command): Promise<void> {\n try {\n await new SyncCommand({\n cwd: this.cwd,\n stdin: this.stdin,\n stdout: this.stdout,\n configStore: this.configStore,\n coolifyClient: this.coolifyClient,\n }).execute();\n } catch (error) {\n command.error(error instanceof Error ? error.message : 'Unexpected sync error.', {\n code: 'coolsecrets.sync',\n exitCode: 1,\n });\n }\n }\n}\n\nexport function createCli(options: CreateCliOptions = {}): Command {\n return new CoolSecretsCli(options).getProgram();\n}\n","import { z } from 'zod';\n\nimport type {\n CoolifyApplication,\n CoolifyCredentials,\n InfisicalExport,\n LocalBinding,\n} from './types.js';\n\nexport interface SchemaValidator {\n normalizeCoolifyCredentials(input: { baseUrl: string; apiToken: string }): CoolifyCredentials;\n parseGlobalConfig(value: unknown): CoolifyCredentials;\n parseLocalBinding(value: unknown): LocalBinding;\n parseApplicationsPayload(value: unknown): CoolifyApplication[];\n parseInfisicalExport(value: unknown): InfisicalExport;\n}\n\nexport class ZodSchemaValidator implements SchemaValidator {\n private readonly apiTokenSchema = z.string().trim().min(1, 'Coolify API token is required.');\n\n private readonly baseUrlSchema = z\n .string()\n .trim()\n .min(1, 'Coolify base URL is required.')\n .url('Coolify base URL must be a valid absolute URL.')\n .refine((value) => value.startsWith('http://') || value.startsWith('https://'), {\n message: 'Coolify base URL must use http or https.',\n })\n .transform((value) => value.replace(/\\/$/, ''));\n\n private readonly coolifyCredentialsSchema = z.object({\n baseUrl: this.baseUrlSchema,\n apiToken: this.apiTokenSchema,\n });\n\n private readonly localBindingSchema = z.object({\n applicationId: z.string().trim().min(1, 'Application ID is required.'),\n applicationName: z.string().trim().min(1, 'Application name is required.'),\n projectName: z.string().trim().min(1).nullable(),\n });\n\n private readonly infisicalExportSchema = z.record(\n z.string().trim().min(1, 'Environment variable keys must not be empty.'),\n z.string(),\n );\n\n private readonly rawCoolifyApplicationSchema = z\n .object({\n id: z.string().trim().min(1).optional(),\n uuid: z.string().trim().min(1).optional(),\n name: z.string().trim().min(1, 'Coolify application payload is missing a valid name.'),\n project: z\n .object({\n name: z.string().trim().min(1).optional(),\n })\n .partial()\n .nullish(),\n projectName: z.string().trim().min(1).optional(),\n project_name: z.string().trim().min(1).optional(),\n })\n .passthrough()\n .transform((value, context): CoolifyApplication => {\n const applicationId = value.id ?? value.uuid;\n\n if (!applicationId) {\n context.addIssue({\n code: 'custom',\n message: 'Coolify application payload is missing a valid id or uuid.',\n });\n return z.NEVER;\n }\n\n return {\n id: applicationId,\n name: value.name,\n projectName: value.project?.name ?? value.projectName ?? value.project_name ?? null,\n };\n });\n\n private readonly applicationsPayloadSchema = z\n .union([\n z.array(this.rawCoolifyApplicationSchema),\n z.object({\n data: z.array(this.rawCoolifyApplicationSchema),\n }),\n ])\n .transform((value) => (Array.isArray(value) ? value : value.data));\n\n public normalizeCoolifyCredentials(input: {\n baseUrl: string;\n apiToken: string;\n }): CoolifyCredentials {\n return this.parseWithSchema(\n this.coolifyCredentialsSchema,\n input,\n 'Invalid Coolify credentials.',\n );\n }\n\n public parseGlobalConfig(value: unknown): CoolifyCredentials {\n return this.parseWithSchema(this.coolifyCredentialsSchema, value, 'Invalid global config format.');\n }\n\n public parseLocalBinding(value: unknown): LocalBinding {\n return this.parseWithSchema(this.localBindingSchema, value, 'Invalid local binding format.');\n }\n\n public parseApplicationsPayload(value: unknown): CoolifyApplication[] {\n return this.parseWithSchema(\n this.applicationsPayloadSchema,\n value,\n 'Invalid applications payload received from Coolify.',\n );\n }\n\n public parseInfisicalExport(value: unknown): InfisicalExport {\n return this.parseWithSchema(\n this.infisicalExportSchema,\n value,\n 'Infisical export payload must be a JSON object with string values.',\n );\n }\n\n private parseWithSchema<TSchema extends z.ZodType>(\n schema: TSchema,\n value: unknown,\n fallbackMessage: string,\n ): z.infer<TSchema> {\n const result = schema.safeParse(value);\n\n if (!result.success) {\n throw new Error(this.getFirstIssueMessage(result.error, fallbackMessage));\n }\n\n return result.data;\n }\n\n private getFirstIssueMessage(error: z.ZodError, fallbackMessage: string): string {\n return error.issues[0]?.message ?? fallbackMessage;\n }\n}\n","import { ZodSchemaValidator, type SchemaValidator } from './schemas.js';\nimport type {\n CoolifyApplication,\n CoolifyApplicationEnvironmentVariable,\n CoolifyCredentials,\n} from './types.js';\n\nexport interface CoolifyClient {\n listApplications(config: CoolifyCredentials): Promise<CoolifyApplication[]>;\n syncApplicationEnvs(\n config: CoolifyCredentials,\n applicationId: string,\n environmentVariables: CoolifyApplicationEnvironmentVariable[],\n ): Promise<void>;\n}\n\nexport class HttpCoolifyClient implements CoolifyClient {\n constructor(\n private readonly fetchFn: typeof fetch = fetch,\n private readonly validator: SchemaValidator = new ZodSchemaValidator(),\n ) {}\n\n public async listApplications(config: CoolifyCredentials): Promise<CoolifyApplication[]> {\n const response = await this.fetchFn(this.buildApplicationsUrl(config.baseUrl), {\n method: 'GET',\n headers: this.buildHeaders(config),\n });\n\n if (!response.ok) {\n throw new Error(this.buildFetchErrorMessage('fetch applications', response));\n }\n\n return this.validator.parseApplicationsPayload(await response.json());\n }\n\n public async syncApplicationEnvs(\n config: CoolifyCredentials,\n applicationId: string,\n environmentVariables: CoolifyApplicationEnvironmentVariable[],\n ): Promise<void> {\n const response = await this.fetchFn(this.buildBulkEnvsUrl(config.baseUrl, applicationId), {\n method: 'PATCH',\n headers: this.buildHeaders(config),\n body: JSON.stringify({ data: environmentVariables }),\n });\n\n if (!response.ok) {\n throw new Error(this.buildFetchErrorMessage('sync application environment variables', response));\n }\n }\n\n private buildApplicationsUrl(baseUrl: string): string {\n return new URL('/api/v1/applications', `${baseUrl}/`).toString();\n }\n\n private buildBulkEnvsUrl(baseUrl: string, applicationId: string): string {\n return new URL(`/api/v1/applications/${applicationId}/envs/bulk`, `${baseUrl}/`).toString();\n }\n\n private buildHeaders(config: CoolifyCredentials): HeadersInit {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${config.apiToken}`,\n 'Content-Type': 'application/json',\n };\n }\n\n private buildFetchErrorMessage(action: string, response: Response): string {\n return `Failed to ${action} in Coolify (${response.status} ${response.statusText}).`;\n }\n}\n","import { ZodSchemaValidator, type SchemaValidator } from './schemas.js';\nimport type { CoolifyApplicationEnvironmentVariable } from './types.js';\n\nexport class InfisicalExportParser {\n constructor(private readonly validator: SchemaValidator = new ZodSchemaValidator()) {}\n\n public parse(rawInput: string): CoolifyApplicationEnvironmentVariable[] {\n return this.fromObject(this.parseJson(rawInput));\n }\n\n public fromObject(payload: unknown): CoolifyApplicationEnvironmentVariable[] {\n const exportPayload = this.validator.parseInfisicalExport(payload);\n const environmentVariables = Object.entries(exportPayload).map(([key, value]) => ({\n key,\n value,\n is_preview: false,\n is_literal: false,\n is_multiline: value.includes('\\n'),\n is_shown_once: false,\n }));\n\n if (environmentVariables.length === 0) {\n throw new Error('Infisical export payload does not contain any environment variables.');\n }\n\n return environmentVariables;\n }\n\n private parseJson(rawInput: string): unknown {\n try {\n return JSON.parse(rawInput);\n } catch {\n throw new Error('Infisical export input must be valid JSON.');\n }\n }\n}\n","import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\n\nimport {\n ZodSchemaValidator,\n type CoolifyCredentials,\n type LocalBinding,\n type SchemaValidator,\n} from '@coolsecrets/shared';\n\nexport interface ConfigStore {\n readGlobalConfig(): Promise<CoolifyCredentials | null>;\n saveGlobalConfig(config: CoolifyCredentials): Promise<void>;\n readLocalBinding(cwd: string): Promise<LocalBinding | null>;\n saveLocalBinding(cwd: string, binding: LocalBinding): Promise<void>;\n}\n\nexport class FileConfigStore implements ConfigStore {\n constructor(private readonly validator: SchemaValidator = new ZodSchemaValidator()) {}\n\n public async readGlobalConfig(): Promise<CoolifyCredentials | null> {\n try {\n const contents = await readFile(this.getGlobalConfigPath(), 'utf8');\n return this.validator.parseGlobalConfig(JSON.parse(contents));\n } catch (error) {\n if (this.isMissingFileError(error)) {\n return null;\n }\n\n throw error;\n }\n }\n\n public async saveGlobalConfig(config: CoolifyCredentials): Promise<void> {\n const configPath = this.getGlobalConfigPath();\n const normalizedConfig = this.validator.parseGlobalConfig(config);\n\n await mkdir(path.dirname(configPath), { recursive: true });\n await writeFile(configPath, `${JSON.stringify(normalizedConfig, null, 2)}\\n`, {\n encoding: 'utf8',\n mode: 0o600,\n });\n }\n\n public async readLocalBinding(cwd: string): Promise<LocalBinding | null> {\n try {\n const contents = await readFile(this.getLocalConfigPath(cwd), 'utf8');\n return this.validator.parseLocalBinding(JSON.parse(contents));\n } catch (error) {\n if (this.isMissingFileError(error)) {\n return null;\n }\n\n throw error;\n }\n }\n\n public async saveLocalBinding(cwd: string, binding: LocalBinding): Promise<void> {\n const configPath = this.getLocalConfigPath(cwd);\n const normalizedBinding = this.validator.parseLocalBinding(binding);\n\n await writeFile(configPath, `${JSON.stringify(normalizedBinding, null, 2)}\\n`, {\n encoding: 'utf8',\n mode: 0o600,\n });\n }\n\n private getGlobalConfigPath(): string {\n return path.join(this.getGlobalConfigDirectory(), 'config.json');\n }\n\n private getLocalConfigPath(cwd: string): string {\n return path.join(cwd, '.coolsecrets.json');\n }\n\n private getGlobalConfigDirectory(): string {\n const xdgConfigHome = process.env.XDG_CONFIG_HOME;\n\n if (xdgConfigHome) {\n return path.join(xdgConfigHome, 'coolsecrets');\n }\n\n return path.join(homedir(), '.config', 'coolsecrets');\n }\n\n private isMissingFileError(error: unknown): boolean {\n return (error as NodeJS.ErrnoException).code === 'ENOENT';\n }\n}\n","import { input, password, select } from '@inquirer/prompts';\n\nimport type { CoolifyApplication } from '@coolsecrets/shared';\n\nexport interface InitPrompter {\n promptBaseUrl(): Promise<string>;\n promptApiToken(): Promise<string>;\n selectApplication(applications: CoolifyApplication[]): Promise<CoolifyApplication>;\n}\n\nexport function formatApplicationLabel(application: CoolifyApplication): string {\n return application.projectName\n ? `${application.projectName} / ${application.name}`\n : application.name;\n}\n\nexport class InteractiveInitPrompter implements InitPrompter {\n async promptBaseUrl(): Promise<string> {\n return input({\n message: 'Coolify base URL',\n validate: (value) => (value.trim().length > 0 ? true : 'Base URL is required.'),\n });\n }\n\n async promptApiToken(): Promise<string> {\n return password({\n message: 'Coolify API token',\n mask: '*',\n validate: (value) => (value.trim().length > 0 ? true : 'API token is required.'),\n });\n }\n\n async selectApplication(applications: CoolifyApplication[]): Promise<CoolifyApplication> {\n return select({\n message: 'Select the Coolify application for this directory',\n choices: applications.map((application) => ({\n name: formatApplicationLabel(application),\n value: application,\n })),\n pageSize: 12,\n });\n }\n}\n","import {\n ZodSchemaValidator,\n type CoolifyClient,\n type CoolifyCredentials,\n type SchemaValidator,\n} from '@coolsecrets/shared';\n\nimport type { ConfigStore } from './config-store.js';\nimport { formatApplicationLabel, type InitPrompter } from './init-prompter.js';\n\nexport interface RunInitOptions {\n cwd: string;\n stdout: NodeJS.WritableStream;\n configStore: ConfigStore;\n coolifyClient: CoolifyClient;\n prompter: InitPrompter;\n}\n\ninterface ResolvedCredentials {\n credentials: CoolifyCredentials;\n shouldPersist: boolean;\n}\n\nexport class InitCommand {\n constructor(\n private readonly options: RunInitOptions,\n private readonly validator: SchemaValidator = new ZodSchemaValidator(),\n ) {}\n\n public async execute(): Promise<void> {\n const { credentials, shouldPersist } = await this.resolveCredentials();\n const applications = await this.options.coolifyClient.listApplications(credentials);\n\n if (applications.length === 0) {\n throw new Error('No Coolify applications were found for the provided credentials.');\n }\n\n if (shouldPersist) {\n await this.options.configStore.saveGlobalConfig(credentials);\n }\n\n const application = await this.options.prompter.selectApplication(applications);\n\n await this.options.configStore.saveLocalBinding(this.options.cwd, {\n applicationId: application.id,\n applicationName: application.name,\n projectName: application.projectName,\n });\n\n this.options.stdout.write(\n `Linked current directory to ${formatApplicationLabel(application)}.\\n`,\n );\n }\n\n private async resolveCredentials(): Promise<ResolvedCredentials> {\n const existingConfig = await this.options.configStore.readGlobalConfig();\n\n if (existingConfig) {\n return {\n credentials: existingConfig,\n shouldPersist: false,\n };\n }\n\n return {\n credentials: this.validator.normalizeCoolifyCredentials({\n baseUrl: await this.options.prompter.promptBaseUrl(),\n apiToken: await this.options.prompter.promptApiToken(),\n }),\n shouldPersist: true,\n };\n }\n}\n\nexport async function runInit(options: RunInitOptions): Promise<void> {\n await new InitCommand(options).execute();\n}\n","export async function readStdin(\n stream: NodeJS.ReadableStream = process.stdin,\n): Promise<string | null> {\n if ('isTTY' in stream && stream.isTTY) {\n return null;\n }\n\n const chunks: Buffer[] = [];\n\n for await (const chunk of stream) {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));\n }\n\n const input = Buffer.concat(chunks).toString('utf8').trim();\n\n return input.length > 0 ? input : null;\n}\n","import {\n InfisicalExportParser,\n type CoolifyClient,\n type CoolifyCredentials,\n type LocalBinding,\n} from '@coolsecrets/shared';\n\nimport type { ConfigStore } from './config-store.js';\nimport { readStdin } from './read-stdin.js';\n\nexport interface RunSyncOptions {\n cwd: string;\n stdin: NodeJS.ReadableStream;\n stdout: NodeJS.WritableStream;\n configStore: ConfigStore;\n coolifyClient: CoolifyClient;\n}\n\nexport class SyncCommand {\n private static readonly noStdinMessage = [\n 'No input received from stdin.',\n 'Example: infisical export --env=prod --format=json | coolsecrets sync',\n ].join('\\n');\n\n constructor(\n private readonly options: RunSyncOptions,\n private readonly parser: InfisicalExportParser = new InfisicalExportParser(),\n ) {}\n\n public async execute(): Promise<void> {\n const rawInput = await readStdin(this.options.stdin);\n\n if (rawInput === null) {\n throw new Error(SyncCommand.noStdinMessage);\n }\n\n const environmentVariables = this.parser.parse(rawInput);\n const credentials = await this.readGlobalConfig();\n const binding = await this.readLocalBinding();\n\n await this.options.coolifyClient.syncApplicationEnvs(\n credentials,\n binding.applicationId,\n environmentVariables,\n );\n\n this.options.stdout.write(\n `Synced ${environmentVariables.length} environment variable${environmentVariables.length === 1 ? '' : 's'} to ${this.formatBindingLabel(binding)}.\\n`,\n );\n }\n\n private async readGlobalConfig(): Promise<CoolifyCredentials> {\n const config = await this.options.configStore.readGlobalConfig();\n\n if (config === null) {\n throw new Error('Coolify credentials are not configured. Run `coolsecrets init` first.');\n }\n\n return config;\n }\n\n private async readLocalBinding(): Promise<LocalBinding> {\n const binding = await this.options.configStore.readLocalBinding(this.options.cwd);\n\n if (binding === null) {\n throw new Error(\n 'Current directory is not linked to a Coolify application. Run `coolsecrets init` first.',\n );\n }\n\n return binding;\n }\n\n private formatBindingLabel(binding: LocalBinding): string {\n return binding.projectName\n ? `${binding.projectName} / ${binding.applicationName}`\n : binding.applicationName;\n }\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;;;ACA/B,SAAS,eAAe;;;ACAxB,SAAS,SAAS;AAiBZ,IAAO,qBAAP,MAAyB;EACZ,iBAAiB,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,gCAAgC;EAE1E,gBAAgB,EAC9B,OAAM,EACN,KAAI,EACJ,IAAI,GAAG,+BAA+B,EACtC,IAAI,gDAAgD,EACpD,OAAO,CAAC,UAAU,MAAM,WAAW,SAAS,KAAK,MAAM,WAAW,UAAU,GAAG;IAC9E,SAAS;GACV,EACA,UAAU,CAAC,UAAU,MAAM,QAAQ,OAAO,EAAE,CAAC;EAE/B,2BAA2B,EAAE,OAAO;IACnD,SAAS,KAAK;IACd,UAAU,KAAK;GAChB;EAEgB,qBAAqB,EAAE,OAAO;IAC7C,eAAe,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,6BAA6B;IACrE,iBAAiB,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,+BAA+B;IACzE,aAAa,EAAE,OAAM,EAA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hIA,eAAe,OAAsB;AACnC,QAAM,UAAU,UAAU;AAE1B,MAAI;AACF,UAAM,QAAQ,WAAW,QAAQ,IAAI;AAAA,EACvC,SAAS,OAAO;AACd,QAAI,iBAAiB,gBAAgB;AACnC,cAAQ,WAAW,MAAM;AACzB;AAAA,IACF;AAEA,UAAM;AAAA,EACR;AACF;AAEA,KAAK,KAAK;","names":["input","input"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/create-cli.ts","../../shared/src/schemas.ts","../../shared/src/coolify-client.ts","../../shared/src/infisical-export-parser.ts","../src/config-store.ts","../src/init-prompter.ts","../src/init-command.ts","../src/read-stdin.ts","../src/sync-command.ts"],"sourcesContent":["import { CommanderError } from 'commander';\n\nimport { createCli } from './create-cli.js';\n\nasync function main(): Promise<void> {\n const program = createCli();\n\n try {\n await program.parseAsync(process.argv);\n } catch (error) {\n if (error instanceof CommanderError) {\n process.exitCode = error.exitCode;\n return;\n }\n\n throw error;\n }\n}\n\nvoid main();\n","import { Command } from 'commander';\n\nimport { HttpCoolifyClient, type CoolifyClient } from '@coolsecrets/shared';\n\nimport { FileConfigStore, type ConfigStore } from './config-store.js';\nimport { InteractiveInitPrompter, type InitPrompter } from './init-prompter.js';\nimport { InitCommand } from './init-command.js';\nimport { SyncCommand } from './sync-command.js';\n\nexport interface CreateCliOptions {\n cwd?: string;\n stdin?: NodeJS.ReadableStream;\n stdout?: NodeJS.WritableStream;\n stderr?: NodeJS.WritableStream;\n configStore?: ConfigStore;\n coolifyClient?: CoolifyClient;\n prompter?: InitPrompter;\n}\n\nexport class CoolSecretsCli {\n private readonly cwd: string;\n private readonly stdin: NodeJS.ReadableStream;\n private readonly stdout: NodeJS.WritableStream;\n private readonly stderr: NodeJS.WritableStream;\n private readonly configStore: ConfigStore;\n private readonly coolifyClient: CoolifyClient;\n private readonly prompter: InitPrompter;\n private readonly program: Command;\n\n constructor(options: CreateCliOptions = {}) {\n this.cwd = options.cwd ?? process.cwd();\n this.stdin = options.stdin ?? process.stdin;\n this.stdout = options.stdout ?? process.stdout;\n this.stderr = options.stderr ?? process.stderr;\n this.configStore = options.configStore ?? new FileConfigStore();\n this.coolifyClient = options.coolifyClient ?? new HttpCoolifyClient();\n this.prompter = options.prompter ?? new InteractiveInitPrompter();\n this.program = this.createProgram();\n }\n\n public getProgram(): Command {\n return this.program;\n }\n\n private createProgram(): Command {\n const program = new Command()\n .name('coolsecrets')\n .description('CLI to sync secrets from stdin into Coolify applications')\n .version('0.1.0')\n .option('--init', 'Initialize Coolify settings for the current directory')\n .configureOutput({\n writeOut: (message) => this.stdout.write(message),\n writeErr: (message) => this.stderr.write(message),\n })\n .showHelpAfterError()\n .exitOverride();\n\n this.configureInitCommand(program);\n this.configureSyncCommand(program);\n this.configureDefaultAction(program);\n\n return program;\n }\n\n private configureInitCommand(program: Command): void {\n const initCommand = program\n .command('init')\n .description('Initialize Coolify settings for the current directory');\n\n initCommand.action(async () => {\n await this.runInit(initCommand);\n });\n }\n\n private configureSyncCommand(program: Command): void {\n const syncCommand = program\n .command('sync')\n .description('Sync a piped JSON secrets payload into the linked Coolify application');\n\n syncCommand.action(async () => {\n await this.runSync(syncCommand);\n });\n }\n\n private configureDefaultAction(program: Command): void {\n program.action(async () => {\n if (program.opts<{ init?: boolean }>().init) {\n await this.runInit(program);\n return;\n }\n\n await this.runSync(program);\n });\n }\n\n private async runInit(command: Command): Promise<void> {\n try {\n await new InitCommand({\n cwd: this.cwd,\n stdout: this.stdout,\n configStore: this.configStore,\n coolifyClient: this.coolifyClient,\n prompter: this.prompter,\n }).execute();\n } catch (error) {\n command.error(error instanceof Error ? error.message : 'Unexpected init error.', {\n code: 'coolsecrets.init',\n exitCode: 1,\n });\n }\n }\n\n private async runSync(command: Command): Promise<void> {\n try {\n await new SyncCommand({\n cwd: this.cwd,\n stdin: this.stdin,\n stdout: this.stdout,\n configStore: this.configStore,\n coolifyClient: this.coolifyClient,\n }).execute();\n } catch (error) {\n command.error(error instanceof Error ? error.message : 'Unexpected sync error.', {\n code: 'coolsecrets.sync',\n exitCode: 1,\n });\n }\n }\n}\n\nexport function createCli(options: CreateCliOptions = {}): Command {\n return new CoolSecretsCli(options).getProgram();\n}\n","import { z } from 'zod';\n\nimport type {\n CoolifyApplication,\n CoolifyCredentials,\n InfisicalExport,\n LocalBinding,\n} from './types.js';\n\nexport interface SchemaValidator {\n normalizeCoolifyCredentials(input: { baseUrl: string; apiToken: string }): CoolifyCredentials;\n parseGlobalConfig(value: unknown): CoolifyCredentials;\n parseLocalBinding(value: unknown): LocalBinding;\n parseApplicationsPayload(value: unknown): CoolifyApplication[];\n parseInfisicalExport(value: unknown): InfisicalExport;\n}\n\nexport class ZodSchemaValidator implements SchemaValidator {\n private readonly apiTokenSchema = z.string().trim().min(1, 'Coolify API token is required.');\n\n private readonly baseUrlSchema = z\n .string()\n .trim()\n .min(1, 'Coolify base URL is required.')\n .url('Coolify base URL must be a valid absolute URL.')\n .refine((value) => value.startsWith('http://') || value.startsWith('https://'), {\n message: 'Coolify base URL must use http or https.',\n })\n .transform((value) => value.replace(/\\/$/, ''));\n\n private readonly coolifyCredentialsSchema = z.object({\n baseUrl: this.baseUrlSchema,\n apiToken: this.apiTokenSchema,\n });\n\n private readonly localBindingSchema = z.object({\n applicationId: z.string().trim().min(1, 'Application ID is required.'),\n applicationName: z.string().trim().min(1, 'Application name is required.'),\n projectName: z.string().trim().min(1).nullable(),\n });\n\n private readonly infisicalExportObjectSchema = z.record(\n z.string().trim().min(1, 'Environment variable keys must not be empty.'),\n z.string(),\n );\n\n private readonly infisicalExportArraySchema = z\n .array(\n z\n .object({\n key: z.string().trim().min(1, 'Environment variable keys must not be empty.'),\n value: z.string(),\n })\n .passthrough(),\n )\n .transform((entries): InfisicalExport => {\n const out: InfisicalExport = {};\n for (const entry of entries) {\n out[entry.key] = entry.value;\n }\n return out;\n });\n\n private readonly rawCoolifyApplicationSchema = z\n .object({\n id: z.string().trim().min(1).optional(),\n uuid: z.string().trim().min(1).optional(),\n name: z.string().trim().min(1, 'Coolify application payload is missing a valid name.'),\n project: z\n .object({\n name: z.string().trim().min(1).optional(),\n })\n .partial()\n .nullish(),\n projectName: z.string().trim().min(1).optional(),\n project_name: z.string().trim().min(1).optional(),\n })\n .passthrough()\n .transform((value, context): CoolifyApplication => {\n const applicationId = value.id ?? value.uuid;\n\n if (!applicationId) {\n context.addIssue({\n code: 'custom',\n message: 'Coolify application payload is missing a valid id or uuid.',\n });\n return z.NEVER;\n }\n\n return {\n id: applicationId,\n name: value.name,\n projectName: value.project?.name ?? value.projectName ?? value.project_name ?? null,\n };\n });\n\n private readonly applicationsPayloadSchema = z\n .union([\n z.array(this.rawCoolifyApplicationSchema),\n z.object({\n data: z.array(this.rawCoolifyApplicationSchema),\n }),\n ])\n .transform((value) => (Array.isArray(value) ? value : value.data));\n\n public normalizeCoolifyCredentials(input: {\n baseUrl: string;\n apiToken: string;\n }): CoolifyCredentials {\n return this.parseWithSchema(\n this.coolifyCredentialsSchema,\n input,\n 'Invalid Coolify credentials.',\n );\n }\n\n public parseGlobalConfig(value: unknown): CoolifyCredentials {\n return this.parseWithSchema(this.coolifyCredentialsSchema, value, 'Invalid global config format.');\n }\n\n public parseLocalBinding(value: unknown): LocalBinding {\n return this.parseWithSchema(this.localBindingSchema, value, 'Invalid local binding format.');\n }\n\n public parseApplicationsPayload(value: unknown): CoolifyApplication[] {\n return this.parseWithSchema(\n this.applicationsPayloadSchema,\n value,\n 'Invalid applications payload received from Coolify.',\n );\n }\n\n public parseInfisicalExport(value: unknown): InfisicalExport {\n if (Array.isArray(value)) {\n return this.parseWithSchema(\n this.infisicalExportArraySchema,\n value,\n 'Infisical export array must contain objects with `key` and `value` strings.',\n );\n }\n return this.parseWithSchema(\n this.infisicalExportObjectSchema,\n value,\n 'Infisical export payload must be a JSON object with string values or an array of { key, value } entries.',\n );\n }\n\n private parseWithSchema<TSchema extends z.ZodType>(\n schema: TSchema,\n value: unknown,\n fallbackMessage: string,\n ): z.infer<TSchema> {\n const result = schema.safeParse(value);\n\n if (!result.success) {\n throw new Error(this.getFirstIssueMessage(result.error, fallbackMessage));\n }\n\n return result.data;\n }\n\n private getFirstIssueMessage(error: z.ZodError, fallbackMessage: string): string {\n return error.issues[0]?.message ?? fallbackMessage;\n }\n}\n","import { ZodSchemaValidator, type SchemaValidator } from './schemas.js';\nimport type {\n CoolifyApplication,\n CoolifyApplicationEnvironmentVariable,\n CoolifyCredentials,\n} from './types.js';\n\nexport interface CoolifyClient {\n listApplications(config: CoolifyCredentials): Promise<CoolifyApplication[]>;\n syncApplicationEnvs(\n config: CoolifyCredentials,\n applicationId: string,\n environmentVariables: CoolifyApplicationEnvironmentVariable[],\n ): Promise<void>;\n}\n\nexport class HttpCoolifyClient implements CoolifyClient {\n constructor(\n private readonly fetchFn: typeof fetch = fetch,\n private readonly validator: SchemaValidator = new ZodSchemaValidator(),\n ) {}\n\n public async listApplications(config: CoolifyCredentials): Promise<CoolifyApplication[]> {\n const response = await this.fetchFn(this.buildApplicationsUrl(config.baseUrl), {\n method: 'GET',\n headers: this.buildHeaders(config),\n });\n\n if (!response.ok) {\n throw new Error(this.buildFetchErrorMessage('fetch applications', response));\n }\n\n return this.validator.parseApplicationsPayload(await response.json());\n }\n\n public async syncApplicationEnvs(\n config: CoolifyCredentials,\n applicationId: string,\n environmentVariables: CoolifyApplicationEnvironmentVariable[],\n ): Promise<void> {\n const response = await this.fetchFn(this.buildBulkEnvsUrl(config.baseUrl, applicationId), {\n method: 'PATCH',\n headers: this.buildHeaders(config),\n body: JSON.stringify({ data: environmentVariables }),\n });\n\n if (!response.ok) {\n throw new Error(this.buildFetchErrorMessage('sync application environment variables', response));\n }\n }\n\n private buildApplicationsUrl(baseUrl: string): string {\n return new URL('/api/v1/applications', `${baseUrl}/`).toString();\n }\n\n private buildBulkEnvsUrl(baseUrl: string, applicationId: string): string {\n return new URL(`/api/v1/applications/${applicationId}/envs/bulk`, `${baseUrl}/`).toString();\n }\n\n private buildHeaders(config: CoolifyCredentials): HeadersInit {\n return {\n Accept: 'application/json',\n Authorization: `Bearer ${config.apiToken}`,\n 'Content-Type': 'application/json',\n };\n }\n\n private buildFetchErrorMessage(action: string, response: Response): string {\n return `Failed to ${action} in Coolify (${response.status} ${response.statusText}).`;\n }\n}\n","import { ZodSchemaValidator, type SchemaValidator } from './schemas.js';\nimport type { CoolifyApplicationEnvironmentVariable } from './types.js';\n\nexport class InfisicalExportParser {\n constructor(private readonly validator: SchemaValidator = new ZodSchemaValidator()) {}\n\n public parse(rawInput: string): CoolifyApplicationEnvironmentVariable[] {\n return this.fromObject(this.parseJson(rawInput));\n }\n\n public fromObject(payload: unknown): CoolifyApplicationEnvironmentVariable[] {\n const exportPayload = this.validator.parseInfisicalExport(payload);\n const environmentVariables = Object.entries(exportPayload).map(([key, value]) => ({\n key,\n value,\n is_preview: false,\n is_literal: false,\n is_multiline: value.includes('\\n'),\n is_shown_once: false,\n }));\n\n if (environmentVariables.length === 0) {\n throw new Error('Infisical export payload does not contain any environment variables.');\n }\n\n return environmentVariables;\n }\n\n private parseJson(rawInput: string): unknown {\n try {\n return JSON.parse(rawInput);\n } catch {\n throw new Error('Infisical export input must be valid JSON.');\n }\n }\n}\n","import { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\n\nimport {\n ZodSchemaValidator,\n type CoolifyCredentials,\n type LocalBinding,\n type SchemaValidator,\n} from '@coolsecrets/shared';\n\nexport interface ConfigStore {\n readGlobalConfig(): Promise<CoolifyCredentials | null>;\n saveGlobalConfig(config: CoolifyCredentials): Promise<void>;\n readLocalBinding(cwd: string): Promise<LocalBinding | null>;\n saveLocalBinding(cwd: string, binding: LocalBinding): Promise<void>;\n}\n\nexport class FileConfigStore implements ConfigStore {\n constructor(private readonly validator: SchemaValidator = new ZodSchemaValidator()) {}\n\n public async readGlobalConfig(): Promise<CoolifyCredentials | null> {\n try {\n const contents = await readFile(this.getGlobalConfigPath(), 'utf8');\n return this.validator.parseGlobalConfig(JSON.parse(contents));\n } catch (error) {\n if (this.isMissingFileError(error)) {\n return null;\n }\n\n throw error;\n }\n }\n\n public async saveGlobalConfig(config: CoolifyCredentials): Promise<void> {\n const configPath = this.getGlobalConfigPath();\n const normalizedConfig = this.validator.parseGlobalConfig(config);\n\n await mkdir(path.dirname(configPath), { recursive: true });\n await writeFile(configPath, `${JSON.stringify(normalizedConfig, null, 2)}\\n`, {\n encoding: 'utf8',\n mode: 0o600,\n });\n }\n\n public async readLocalBinding(cwd: string): Promise<LocalBinding | null> {\n try {\n const contents = await readFile(this.getLocalConfigPath(cwd), 'utf8');\n return this.validator.parseLocalBinding(JSON.parse(contents));\n } catch (error) {\n if (this.isMissingFileError(error)) {\n return null;\n }\n\n throw error;\n }\n }\n\n public async saveLocalBinding(cwd: string, binding: LocalBinding): Promise<void> {\n const configPath = this.getLocalConfigPath(cwd);\n const normalizedBinding = this.validator.parseLocalBinding(binding);\n\n await writeFile(configPath, `${JSON.stringify(normalizedBinding, null, 2)}\\n`, {\n encoding: 'utf8',\n mode: 0o600,\n });\n }\n\n private getGlobalConfigPath(): string {\n return path.join(this.getGlobalConfigDirectory(), 'config.json');\n }\n\n private getLocalConfigPath(cwd: string): string {\n return path.join(cwd, '.coolsecrets.json');\n }\n\n private getGlobalConfigDirectory(): string {\n const xdgConfigHome = process.env.XDG_CONFIG_HOME;\n\n if (xdgConfigHome) {\n return path.join(xdgConfigHome, 'coolsecrets');\n }\n\n return path.join(homedir(), '.config', 'coolsecrets');\n }\n\n private isMissingFileError(error: unknown): boolean {\n return (error as NodeJS.ErrnoException).code === 'ENOENT';\n }\n}\n","import { input, password, select } from '@inquirer/prompts';\n\nimport type { CoolifyApplication } from '@coolsecrets/shared';\n\nexport interface InitPrompter {\n promptBaseUrl(): Promise<string>;\n promptApiToken(): Promise<string>;\n selectApplication(applications: CoolifyApplication[]): Promise<CoolifyApplication>;\n}\n\nexport function formatApplicationLabel(application: CoolifyApplication): string {\n return application.projectName\n ? `${application.projectName} / ${application.name}`\n : application.name;\n}\n\nexport class InteractiveInitPrompter implements InitPrompter {\n async promptBaseUrl(): Promise<string> {\n return input({\n message: 'Coolify base URL',\n validate: (value) => (value.trim().length > 0 ? true : 'Base URL is required.'),\n });\n }\n\n async promptApiToken(): Promise<string> {\n return password({\n message: 'Coolify API token',\n mask: '*',\n validate: (value) => (value.trim().length > 0 ? true : 'API token is required.'),\n });\n }\n\n async selectApplication(applications: CoolifyApplication[]): Promise<CoolifyApplication> {\n return select({\n message: 'Select the Coolify application for this directory',\n choices: applications.map((application) => ({\n name: formatApplicationLabel(application),\n value: application,\n })),\n pageSize: 12,\n });\n }\n}\n","import {\n ZodSchemaValidator,\n type CoolifyClient,\n type CoolifyCredentials,\n type SchemaValidator,\n} from '@coolsecrets/shared';\n\nimport type { ConfigStore } from './config-store.js';\nimport { formatApplicationLabel, type InitPrompter } from './init-prompter.js';\n\nexport interface RunInitOptions {\n cwd: string;\n stdout: NodeJS.WritableStream;\n configStore: ConfigStore;\n coolifyClient: CoolifyClient;\n prompter: InitPrompter;\n}\n\ninterface ResolvedCredentials {\n credentials: CoolifyCredentials;\n shouldPersist: boolean;\n}\n\nexport class InitCommand {\n constructor(\n private readonly options: RunInitOptions,\n private readonly validator: SchemaValidator = new ZodSchemaValidator(),\n ) {}\n\n public async execute(): Promise<void> {\n const { credentials, shouldPersist } = await this.resolveCredentials();\n const applications = await this.options.coolifyClient.listApplications(credentials);\n\n if (applications.length === 0) {\n throw new Error('No Coolify applications were found for the provided credentials.');\n }\n\n if (shouldPersist) {\n await this.options.configStore.saveGlobalConfig(credentials);\n }\n\n const application = await this.options.prompter.selectApplication(applications);\n\n await this.options.configStore.saveLocalBinding(this.options.cwd, {\n applicationId: application.id,\n applicationName: application.name,\n projectName: application.projectName,\n });\n\n this.options.stdout.write(\n `Linked current directory to ${formatApplicationLabel(application)}.\\n`,\n );\n }\n\n private async resolveCredentials(): Promise<ResolvedCredentials> {\n const existingConfig = await this.options.configStore.readGlobalConfig();\n\n if (existingConfig) {\n return {\n credentials: existingConfig,\n shouldPersist: false,\n };\n }\n\n return {\n credentials: this.validator.normalizeCoolifyCredentials({\n baseUrl: await this.options.prompter.promptBaseUrl(),\n apiToken: await this.options.prompter.promptApiToken(),\n }),\n shouldPersist: true,\n };\n }\n}\n\nexport async function runInit(options: RunInitOptions): Promise<void> {\n await new InitCommand(options).execute();\n}\n","export async function readStdin(\n stream: NodeJS.ReadableStream = process.stdin,\n): Promise<string | null> {\n if ('isTTY' in stream && stream.isTTY) {\n return null;\n }\n\n const chunks: Buffer[] = [];\n\n for await (const chunk of stream) {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));\n }\n\n const input = Buffer.concat(chunks).toString('utf8').trim();\n\n return input.length > 0 ? input : null;\n}\n","import {\n InfisicalExportParser,\n type CoolifyClient,\n type CoolifyCredentials,\n type LocalBinding,\n} from '@coolsecrets/shared';\n\nimport type { ConfigStore } from './config-store.js';\nimport { readStdin } from './read-stdin.js';\n\nexport interface RunSyncOptions {\n cwd: string;\n stdin: NodeJS.ReadableStream;\n stdout: NodeJS.WritableStream;\n configStore: ConfigStore;\n coolifyClient: CoolifyClient;\n}\n\nexport class SyncCommand {\n private static readonly noStdinMessage = [\n 'No input received from stdin.',\n 'Example: infisical export --env=prod --format=json | coolsecrets sync',\n ].join('\\n');\n\n constructor(\n private readonly options: RunSyncOptions,\n private readonly parser: InfisicalExportParser = new InfisicalExportParser(),\n ) {}\n\n public async execute(): Promise<void> {\n const rawInput = await readStdin(this.options.stdin);\n\n if (rawInput === null) {\n throw new Error(SyncCommand.noStdinMessage);\n }\n\n const environmentVariables = this.parser.parse(rawInput);\n const credentials = await this.readGlobalConfig();\n const binding = await this.readLocalBinding();\n\n await this.options.coolifyClient.syncApplicationEnvs(\n credentials,\n binding.applicationId,\n environmentVariables,\n );\n\n this.options.stdout.write(\n `Synced ${environmentVariables.length} environment variable${environmentVariables.length === 1 ? '' : 's'} to ${this.formatBindingLabel(binding)}.\\n`,\n );\n }\n\n private async readGlobalConfig(): Promise<CoolifyCredentials> {\n const config = await this.options.configStore.readGlobalConfig();\n\n if (config === null) {\n throw new Error('Coolify credentials are not configured. Run `coolsecrets init` first.');\n }\n\n return config;\n }\n\n private async readLocalBinding(): Promise<LocalBinding> {\n const binding = await this.options.configStore.readLocalBinding(this.options.cwd);\n\n if (binding === null) {\n throw new Error(\n 'Current directory is not linked to a Coolify application. Run `coolsecrets init` first.',\n );\n }\n\n return binding;\n }\n\n private formatBindingLabel(binding: LocalBinding): string {\n return binding.projectName\n ? `${binding.projectName} / ${binding.applicationName}`\n : binding.applicationName;\n }\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;;;ACA/B,SAAS,eAAe;;;ACAxB,SAAS,SAAS;AAiBZ,IAAO,qBAAP,MAAyB;EACZ,iBAAiB,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,gCAAgC;EAE1E,gBAAgB,EAC9B,OAAM,EACN,KAAI,EACJ,IAAI,GAAG,+BAA+B,EACtC,IAAI,gDAAgD,EACpD,OAAO,CAAC,UAAU,MAAM,WAAW,SAAS,KAAK,MAAM,WAAW,UAAU,GAAG;IAC9E,SAAS;GACV,EACA,UAAU,CAAC,UAAU,MAAM,QAAQ,OAAO,EAAE,CAAC;EAE/B,2BAA2B,EAAE,OAAO;IACnD,SAAS,KAAK;IACd,UAAU,KAAK;GAChB;EAEgB,qBAAqB,EAAE,OAAO;IAC7C,eAAe,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,6BAA6B;IACrE,iBAAiB,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,+BAA+B;IACzE,aAAa,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,CAAC,EAAE,SAAQ;GAC/C;EAEgB,8BAA8B,EAAE,OAC/C,EAAE,OAAM,EAAG,KAAI,EAAG,IAAI,GAAG,8CAA8C,GACvE,EAAE,OAAM,CAAE;EAGK,6BAA6B,EAC3C,MACC,EACG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AiB,QAAQ,MAAM,UAAU,0BAA0B;AAAA,QAC/E,MAAM;AAAA,QACN,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,SAAS,UAAU,UAA4B,CAAC,GAAY;AACjE,SAAO,IAAI,eAAe,OAAO,EAAE,WAAW;AAChD;;;ADhIA,eAAe,OAAsB;AACnC,QAAM,UAAU,UAAU;AAE1B,MAAI;AACF,UAAM,QAAQ,WAAW,QAAQ,IAAI;AAAA,EACvC,SAAS,OAAO;AACd,QAAI,iBAAiB,gBAAgB;AACnC,cAAQ,WAAW,MAAM;AACzB;AAAA,IACF;AAEA,UAAM;AAAA,EACR;AACF;AAEA,KAAK,KAAK;","names":["input","input"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolsecrets",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI to sync secrets from stdin into Coolify applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,6 +20,10 @@
20
20
  "infisical",
21
21
  "typescript"
22
22
  ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/joaoseixas88/coolsecrets"
26
+ },
23
27
  "author": "",
24
28
  "license": "ISC",
25
29
  "engines": {