envmatic 1.0.0
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 +567 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +203 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +11 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +77 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/delete.d.ts +6 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +78 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/edit.d.ts +13 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +364 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/import.d.ts +11 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +103 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +237 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/link.d.ts +16 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +157 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/list.d.ts +9 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +73 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/lock.d.ts +16 -0
- package/dist/commands/lock.d.ts.map +1 -0
- package/dist/commands/lock.js +245 -0
- package/dist/commands/lock.js.map +1 -0
- package/dist/commands/rotate.d.ts +15 -0
- package/dist/commands/rotate.d.ts.map +1 -0
- package/dist/commands/rotate.js +406 -0
- package/dist/commands/rotate.js.map +1 -0
- package/dist/commands/show.d.ts +9 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +72 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/sync.d.ts +13 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +174 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/use.d.ts +19 -0
- package/dist/commands/use.d.ts.map +1 -0
- package/dist/commands/use.js +238 -0
- package/dist/commands/use.js.map +1 -0
- package/dist/constants.d.ts +20 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +47 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/services/config.d.ts +64 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +133 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/encryption.d.ts +30 -0
- package/dist/services/encryption.d.ts.map +1 -0
- package/dist/services/encryption.js +146 -0
- package/dist/services/encryption.js.map +1 -0
- package/dist/services/envfile.d.ts +76 -0
- package/dist/services/envfile.d.ts.map +1 -0
- package/dist/services/envfile.js +247 -0
- package/dist/services/envfile.js.map +1 -0
- package/dist/services/git.d.ts +60 -0
- package/dist/services/git.d.ts.map +1 -0
- package/dist/services/git.js +239 -0
- package/dist/services/git.js.map +1 -0
- package/dist/services/linker.d.ts +46 -0
- package/dist/services/linker.d.ts.map +1 -0
- package/dist/services/linker.js +222 -0
- package/dist/services/linker.js.map +1 -0
- package/dist/services/protection.d.ts +32 -0
- package/dist/services/protection.d.ts.map +1 -0
- package/dist/services/protection.js +190 -0
- package/dist/services/protection.js.map +1 -0
- package/dist/types/index.d.ts +73 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/display.d.ts +74 -0
- package/dist/utils/display.d.ts.map +1 -0
- package/dist/utils/display.js +138 -0
- package/dist/utils/display.js.map +1 -0
- package/dist/utils/editor.d.ts +22 -0
- package/dist/utils/editor.d.ts.map +1 -0
- package/dist/utils/editor.js +159 -0
- package/dist/utils/editor.js.map +1 -0
- package/dist/utils/prompts.d.ts +41 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +222 -0
- package/dist/utils/prompts.js.map +1 -0
- package/package.json +69 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Envmatic CLI
|
|
4
|
+
* Cross-platform dotfile and secret manager
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { VERSION, BRAND } from './constants.js';
|
|
8
|
+
// Import commands
|
|
9
|
+
import { initCommand } from './commands/init.js';
|
|
10
|
+
import { addCommand } from './commands/add.js';
|
|
11
|
+
import { listCommand } from './commands/list.js';
|
|
12
|
+
import { showCommand } from './commands/show.js';
|
|
13
|
+
import { linkCommand, copyCommand, unlinkCommand, listLinksCommand } from './commands/link.js';
|
|
14
|
+
import { syncCommand, syncLinksCommand, statusCommand } from './commands/sync.js';
|
|
15
|
+
import { importCommand } from './commands/import.js';
|
|
16
|
+
import { editCommand, setCommand, unsetCommand } from './commands/edit.js';
|
|
17
|
+
import { deleteCommand } from './commands/delete.js';
|
|
18
|
+
import { useCommand, pullCommand } from './commands/use.js';
|
|
19
|
+
import { changePasswordCommand, rotateKeyCommand } from './commands/rotate.js';
|
|
20
|
+
import { lockCommand } from './commands/lock.js';
|
|
21
|
+
const program = new Command();
|
|
22
|
+
program
|
|
23
|
+
.name('envmatic')
|
|
24
|
+
.description(`${BRAND.prefix} ${BRAND.name} - ${BRAND.tagline}`)
|
|
25
|
+
.version(VERSION);
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// SETUP COMMANDS
|
|
28
|
+
// ============================================================================
|
|
29
|
+
program
|
|
30
|
+
.command('init')
|
|
31
|
+
.description('Initialize Envmatic with a Git repository')
|
|
32
|
+
.option('-f, --force', 'Force re-initialization')
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
await initCommand(options);
|
|
35
|
+
});
|
|
36
|
+
program
|
|
37
|
+
.command('status')
|
|
38
|
+
.description('Show current status and configuration')
|
|
39
|
+
.option('--json', 'Output as JSON')
|
|
40
|
+
.action(async (options) => {
|
|
41
|
+
await statusCommand(options);
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command('change-password')
|
|
45
|
+
.description('Change your encryption password')
|
|
46
|
+
.action(async () => {
|
|
47
|
+
await changePasswordCommand();
|
|
48
|
+
});
|
|
49
|
+
program
|
|
50
|
+
.command('rotate-key')
|
|
51
|
+
.description('Rotate encryption key or change encryption method')
|
|
52
|
+
.action(async () => {
|
|
53
|
+
await rotateKeyCommand();
|
|
54
|
+
});
|
|
55
|
+
// ============================================================================
|
|
56
|
+
// FILE MANAGEMENT COMMANDS
|
|
57
|
+
// ============================================================================
|
|
58
|
+
program
|
|
59
|
+
.command('add')
|
|
60
|
+
.description('Add a new env file to the vault')
|
|
61
|
+
.option('-p, --project <name>', 'Project name')
|
|
62
|
+
.option('-e, --environment <name>', 'Environment name')
|
|
63
|
+
.option('-n, --name <name>', 'File name (default: .env)')
|
|
64
|
+
.option('-d, --description <text>', 'Description')
|
|
65
|
+
.action(async (options) => {
|
|
66
|
+
await addCommand(options);
|
|
67
|
+
});
|
|
68
|
+
program
|
|
69
|
+
.command('import <path>')
|
|
70
|
+
.description('Import an existing .env file into the vault')
|
|
71
|
+
.option('-p, --project <name>', 'Project name')
|
|
72
|
+
.option('-e, --environment <name>', 'Environment name')
|
|
73
|
+
.option('-n, --name <name>', 'File name')
|
|
74
|
+
.option('-d, --description <text>', 'Description')
|
|
75
|
+
.action(async (path, options) => {
|
|
76
|
+
await importCommand(path, options);
|
|
77
|
+
});
|
|
78
|
+
program
|
|
79
|
+
.command('list')
|
|
80
|
+
.alias('ls')
|
|
81
|
+
.description('List all env files in the vault')
|
|
82
|
+
.option('-p, --project <name>', 'Filter by project')
|
|
83
|
+
.option('--json', 'Output as JSON')
|
|
84
|
+
.action(async (options) => {
|
|
85
|
+
await listCommand(options);
|
|
86
|
+
});
|
|
87
|
+
program
|
|
88
|
+
.command('show [file-id]')
|
|
89
|
+
.alias('get')
|
|
90
|
+
.description('Display contents of an env file')
|
|
91
|
+
.option('-r, --reveal', 'Reveal full values (not masked)')
|
|
92
|
+
.option('--json', 'Output as JSON')
|
|
93
|
+
.action(async (fileId, options) => {
|
|
94
|
+
await showCommand(fileId, options);
|
|
95
|
+
});
|
|
96
|
+
program
|
|
97
|
+
.command('edit [file-id]')
|
|
98
|
+
.description('Interactively edit an env file')
|
|
99
|
+
.option('-e, --editor', 'Open in external editor (vim, VS Code, etc.)')
|
|
100
|
+
.action(async (fileId, options) => {
|
|
101
|
+
await editCommand(fileId, options);
|
|
102
|
+
});
|
|
103
|
+
program
|
|
104
|
+
.command('set <file-id> <key> <value>')
|
|
105
|
+
.description('Set a variable in an env file')
|
|
106
|
+
.action(async (fileId, key, value) => {
|
|
107
|
+
await setCommand(fileId, key, value);
|
|
108
|
+
});
|
|
109
|
+
program
|
|
110
|
+
.command('unset <file-id> <key>')
|
|
111
|
+
.description('Remove a variable from an env file')
|
|
112
|
+
.action(async (fileId, key) => {
|
|
113
|
+
await unsetCommand(fileId, key);
|
|
114
|
+
});
|
|
115
|
+
program
|
|
116
|
+
.command('delete [file-id]')
|
|
117
|
+
.alias('rm')
|
|
118
|
+
.description('Delete an env file from the vault')
|
|
119
|
+
.action(async (fileId) => {
|
|
120
|
+
await deleteCommand(fileId);
|
|
121
|
+
});
|
|
122
|
+
program
|
|
123
|
+
.command('lock [file-id]')
|
|
124
|
+
.description('Lock (protect) env files after editing')
|
|
125
|
+
.option('-a, --all', 'Lock all unlocked files')
|
|
126
|
+
.action(async (fileId, options) => {
|
|
127
|
+
await lockCommand(fileId, options);
|
|
128
|
+
});
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// USE/PULL COMMANDS (import env to current project)
|
|
131
|
+
// ============================================================================
|
|
132
|
+
program
|
|
133
|
+
.command('use [file-id]')
|
|
134
|
+
.description('Import an env file into the current project')
|
|
135
|
+
.option('-o, --output <path>', 'Output file path (default: .env)')
|
|
136
|
+
.option('-s, --symlink', 'Create symlink instead of copy')
|
|
137
|
+
.option('-f, --force', 'Overwrite without confirmation')
|
|
138
|
+
.action(async (fileId, options) => {
|
|
139
|
+
await useCommand(fileId, options);
|
|
140
|
+
});
|
|
141
|
+
program
|
|
142
|
+
.command('pull')
|
|
143
|
+
.description('Auto-detect project and pull matching env file')
|
|
144
|
+
.option('-e, --env <name>', 'Environment name (development, production, etc.)')
|
|
145
|
+
.option('-o, --output <path>', 'Output file path (default: .env)')
|
|
146
|
+
.option('-s, --symlink', 'Create symlink instead of copy')
|
|
147
|
+
.option('-f, --force', 'Overwrite without confirmation')
|
|
148
|
+
.action(async (options) => {
|
|
149
|
+
await pullCommand(options);
|
|
150
|
+
});
|
|
151
|
+
// ============================================================================
|
|
152
|
+
// LINK COMMANDS
|
|
153
|
+
// ============================================================================
|
|
154
|
+
program
|
|
155
|
+
.command('link [file-id] [target]')
|
|
156
|
+
.description('Create a symlink to an env file')
|
|
157
|
+
.option('-c, --copy', 'Create a copy instead of symlink')
|
|
158
|
+
.option('-a, --auto-sync', 'Auto-sync copies on changes')
|
|
159
|
+
.action(async (fileId, target, options) => {
|
|
160
|
+
await linkCommand(fileId, target, options);
|
|
161
|
+
});
|
|
162
|
+
program
|
|
163
|
+
.command('copy [file-id] [target]')
|
|
164
|
+
.description('Create a decrypted copy of an env file')
|
|
165
|
+
.option('-a, --auto-sync', 'Auto-sync on changes')
|
|
166
|
+
.action(async (fileId, target, options) => {
|
|
167
|
+
await copyCommand(fileId, target, options);
|
|
168
|
+
});
|
|
169
|
+
program
|
|
170
|
+
.command('unlink [target]')
|
|
171
|
+
.description('Remove a linked file')
|
|
172
|
+
.action(async (target) => {
|
|
173
|
+
await unlinkCommand(target);
|
|
174
|
+
});
|
|
175
|
+
program
|
|
176
|
+
.command('links')
|
|
177
|
+
.description('List all linked files')
|
|
178
|
+
.option('--json', 'Output as JSON')
|
|
179
|
+
.action(async (options) => {
|
|
180
|
+
await listLinksCommand(options);
|
|
181
|
+
});
|
|
182
|
+
// ============================================================================
|
|
183
|
+
// SYNC COMMANDS
|
|
184
|
+
// ============================================================================
|
|
185
|
+
program
|
|
186
|
+
.command('sync')
|
|
187
|
+
.description('Sync vault with remote repository')
|
|
188
|
+
.option('--push', 'Push only')
|
|
189
|
+
.option('--pull', 'Pull only')
|
|
190
|
+
.action(async (options) => {
|
|
191
|
+
await syncCommand(options);
|
|
192
|
+
});
|
|
193
|
+
program
|
|
194
|
+
.command('sync-links')
|
|
195
|
+
.description('Update all copied files from vault')
|
|
196
|
+
.action(async () => {
|
|
197
|
+
await syncLinksCommand();
|
|
198
|
+
});
|
|
199
|
+
// ============================================================================
|
|
200
|
+
// RUN
|
|
201
|
+
// ============================================================================
|
|
202
|
+
program.parse();
|
|
203
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEhD,kBAAkB;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,sB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,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEL,+EAA+E;AAC/E,MAAM;AACN,+EAA+E;AAE/E,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAsB,UAAU,CAAC,OAAO,EAAE;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4EhB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add Command
|
|
3
|
+
* Add a new env file to the vault
|
|
4
|
+
*/
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { createEnvFile, listProjects } from '../services/envfile.js';
|
|
7
|
+
import { sync } from '../services/git.js';
|
|
8
|
+
import { getConfig } from '../services/config.js';
|
|
9
|
+
import { makeImmutable } from '../services/protection.js';
|
|
10
|
+
import { getEnvFilePath } from '../services/envfile.js';
|
|
11
|
+
import { printBanner, success, error, formatFileId, colors } from '../utils/display.js';
|
|
12
|
+
import { promptProject, promptEnvironment, promptVariables, getEncryptionOptions } from '../utils/prompts.js';
|
|
13
|
+
export async function addCommand(options) {
|
|
14
|
+
printBanner();
|
|
15
|
+
const config = await getConfig();
|
|
16
|
+
if (!config) {
|
|
17
|
+
error('Envmatic is not initialized. Run `envmatic init` first.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log('Add a new environment file to your vault.\n');
|
|
21
|
+
// Get project
|
|
22
|
+
const projects = await listProjects();
|
|
23
|
+
const project = options.project || await promptProject(projects);
|
|
24
|
+
// Get environment
|
|
25
|
+
const environment = options.environment || await promptEnvironment();
|
|
26
|
+
// Get variables
|
|
27
|
+
const variables = await promptVariables();
|
|
28
|
+
if (Object.keys(variables).length === 0) {
|
|
29
|
+
error('No variables provided. Aborting.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Get encryption options
|
|
33
|
+
const encryptionOptions = await getEncryptionOptions();
|
|
34
|
+
// Create the file
|
|
35
|
+
const spinner = ora('Creating env file...').start();
|
|
36
|
+
try {
|
|
37
|
+
const envFile = await createEnvFile(project, environment, variables, {
|
|
38
|
+
name: options.name || '.env',
|
|
39
|
+
description: options.description,
|
|
40
|
+
encryptionOptions,
|
|
41
|
+
immutable: config.immutableByDefault,
|
|
42
|
+
});
|
|
43
|
+
// Apply file protection if needed
|
|
44
|
+
if (envFile.immutable) {
|
|
45
|
+
const filePath = getEnvFilePath(envFile.id, envFile.encrypted);
|
|
46
|
+
await makeImmutable(filePath);
|
|
47
|
+
}
|
|
48
|
+
spinner.succeed('Env file created');
|
|
49
|
+
// Sync to remote
|
|
50
|
+
const syncSpinner = ora('Syncing to remote...').start();
|
|
51
|
+
try {
|
|
52
|
+
await sync();
|
|
53
|
+
syncSpinner.succeed('Synced to remote');
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
syncSpinner.warn('Could not sync to remote (will sync later)');
|
|
57
|
+
}
|
|
58
|
+
console.log();
|
|
59
|
+
success('Environment file added successfully!');
|
|
60
|
+
console.log();
|
|
61
|
+
console.log(' File ID: ' + formatFileId(envFile.id));
|
|
62
|
+
console.log(' Variables: ' + Object.keys(variables).length);
|
|
63
|
+
console.log(' Encrypted: ' + (envFile.encrypted ? colors.secondary('yes') : 'no'));
|
|
64
|
+
console.log(' Immutable: ' + (envFile.immutable ? colors.secondary('yes') : 'no'));
|
|
65
|
+
console.log();
|
|
66
|
+
console.log(colors.muted('Use this file:'));
|
|
67
|
+
console.log(' • Link to project: ' + colors.primary(`envmatic link "${envFile.id}" .env`));
|
|
68
|
+
console.log(' • Copy to project: ' + colors.primary(`envmatic copy "${envFile.id}" .env`));
|
|
69
|
+
console.log(' • View contents: ' + colors.primary(`envmatic show "${envFile.id}"`));
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
spinner.fail('Failed to create env file');
|
|
73
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
74
|
+
error(errorMessage);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAiB,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAQ,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAKhC;IACC,WAAW,EAAE,CAAC;IAEd,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;IACjC,IAA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kB,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC5F,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAEzF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtE,KAAK,CAAC,YAAY,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,wBAAsB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFlE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Command
|
|
3
|
+
* Delete an env file from the vault
|
|
4
|
+
*/
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { deleteEnvFile, listEnvFiles } from '../services/envfile.js';
|
|
7
|
+
import { sync } from '../services/git.js';
|
|
8
|
+
import { getConfig } from '../services/config.js';
|
|
9
|
+
import { getLinksForEnvFile, unlink } from '../services/linker.js';
|
|
10
|
+
import { printBanner, success, error, warning, colors, formatFileId } from '../utils/display.js';
|
|
11
|
+
import { select, confirm } from '../utils/prompts.js';
|
|
12
|
+
export async function deleteCommand(fileId) {
|
|
13
|
+
printBanner();
|
|
14
|
+
const config = await getConfig();
|
|
15
|
+
if (!config) {
|
|
16
|
+
error('Envmatic is not initialized. Run `envmatic init` first.');
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// If no file ID provided, prompt for selection
|
|
20
|
+
if (!fileId) {
|
|
21
|
+
const files = await listEnvFiles();
|
|
22
|
+
if (files.length === 0) {
|
|
23
|
+
error('No env files found.');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
fileId = await select('Select an env file to delete:', files.map(f => ({
|
|
27
|
+
name: `${f.project}/${f.environment || 'default'}/${f.name}`,
|
|
28
|
+
value: f.id,
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
// Check for links
|
|
32
|
+
const links = await getLinksForEnvFile(fileId);
|
|
33
|
+
if (links.length > 0) {
|
|
34
|
+
console.log(colors.muted(`This file has ${links.length} linked location(s):\n`));
|
|
35
|
+
for (const link of links) {
|
|
36
|
+
console.log(` • ${link.targetPath}`);
|
|
37
|
+
}
|
|
38
|
+
console.log();
|
|
39
|
+
warning('Deleting will also remove all linked files.');
|
|
40
|
+
}
|
|
41
|
+
// Confirm deletion
|
|
42
|
+
const confirmed = await confirm(`Are you sure you want to delete ${formatFileId(fileId)}?`, false);
|
|
43
|
+
if (!confirmed) {
|
|
44
|
+
console.log();
|
|
45
|
+
console.log('Deletion cancelled.');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const spinner = ora('Deleting env file...').start();
|
|
49
|
+
try {
|
|
50
|
+
// Remove all links first
|
|
51
|
+
for (const link of links) {
|
|
52
|
+
await unlink(link.targetPath);
|
|
53
|
+
}
|
|
54
|
+
// Delete the file
|
|
55
|
+
await deleteEnvFile(fileId);
|
|
56
|
+
spinner.succeed('Env file deleted');
|
|
57
|
+
// Sync to remote
|
|
58
|
+
const syncSpinner = ora('Syncing to remote...').start();
|
|
59
|
+
try {
|
|
60
|
+
await sync();
|
|
61
|
+
syncSpinner.succeed('Synced');
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
syncSpinner.warn('Could not sync (will sync later)');
|
|
65
|
+
}
|
|
66
|
+
console.log();
|
|
67
|
+
success('File deleted successfully');
|
|
68
|
+
if (links.length > 0) {
|
|
69
|
+
console.log(colors.muted(`Removed ${links.length} linked location(s)`));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
spinner.fail('Failed to delete env file');
|
|
74
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
75
|
+
error(errorMessage);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACL,WAAW,EACX,OAAO,EACP,KAAK,EACL,OAAO,EACP,MAAM,EACN,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAe;IACjD,WAAW,EAAE,CAAC;IAEd,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IAED,+CAA+C;IAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,MAAM,YAAY,EAAE,CAAC;QAEnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,KAAK,CAAC,qBAAqB,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;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ED,kBAAkB;QAClB,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;QAE5B,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEpC,iBAAiB;QACjB,MAAM,WAAW,GAAG,GAAG,CAAC,sBAAsB,CAAC,CAAC,KAAK,EAAE,CAAC;QAExD,IAAI,CAAC;YACH,MAAM,IAAI,EAAE,CAAC;YACb,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,2BAA2B,CAAC,CAAC;QAErC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,CAAC,MAAM,qBAAqB,CAAC,CAAC,CAAC;QAC1E,CAAC;IAEH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtE,KAAK,CAAC,YAAY,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit Command
|
|
3
|
+
* Edit variables in an env file
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Edit command with optional external editor support
|
|
7
|
+
*/
|
|
8
|
+
export declare function editCommand(fileId?: string, options?: {
|
|
9
|
+
editor?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function setCommand(fileId: string, key: string, value: string): Promise<void>;
|
|
12
|
+
export declare function unsetCommand(fileId: string, key: string): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoCH;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CA6Kf;AAgLD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B7E"}
|