@dotenvx/dotenvx 2.38.2 → 3.0.0-beta.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 +186 -3315
- package/bin/dotenvx.cjs +34 -0
- package/config.cjs +1 -0
- package/config.d.ts +1 -0
- package/config.mjs +2 -0
- package/index.cjs +139 -0
- package/index.d.ts +66 -0
- package/index.mjs +3 -0
- package/lib/cli.cjs +43 -0
- package/lib/native-package.cjs +21 -0
- package/lib/platforms.cjs +18 -0
- package/{src/lib/helpers/redactOutput.js → lib/redactOutput.cjs} +2 -48
- package/lib/redaction.cjs +64 -0
- package/lib/validateOptions.cjs +57 -0
- package/native.cjs +23 -0
- package/package.json +57 -65
- package/CHANGELOG.md +0 -2733
- package/src/cli/actions/armor/down.js +0 -38
- package/src/cli/actions/armor/invite.js +0 -21
- package/src/cli/actions/armor/move.js +0 -43
- package/src/cli/actions/armor/open.js +0 -28
- package/src/cli/actions/armor/pull.js +0 -38
- package/src/cli/actions/armor/push.js +0 -38
- package/src/cli/actions/armor/status.js +0 -7
- package/src/cli/actions/armor/up.js +0 -38
- package/src/cli/actions/check.js +0 -78
- package/src/cli/actions/curl.js +0 -71
- package/src/cli/actions/decrypt.js +0 -119
- package/src/cli/actions/del.js +0 -54
- package/src/cli/actions/doctor.js +0 -22
- package/src/cli/actions/encrypt.js +0 -104
- package/src/cli/actions/ext/genexample.js +0 -36
- package/src/cli/actions/ext/gitignore.js +0 -106
- package/src/cli/actions/ext/prebuild.js +0 -7
- package/src/cli/actions/ext/precommit.js +0 -38
- package/src/cli/actions/ext/scan.js +0 -33
- package/src/cli/actions/feedback.js +0 -42
- package/src/cli/actions/get.js +0 -128
- package/src/cli/actions/init.js +0 -67
- package/src/cli/actions/keychain/down.js +0 -30
- package/src/cli/actions/keychain/pull.js +0 -30
- package/src/cli/actions/keychain/push.js +0 -30
- package/src/cli/actions/keychain/up.js +0 -30
- package/src/cli/actions/keypair.js +0 -84
- package/src/cli/actions/login.js +0 -64
- package/src/cli/actions/logout.js +0 -37
- package/src/cli/actions/ls.js +0 -76
- package/src/cli/actions/policy.js +0 -14
- package/src/cli/actions/primitivesCheck.js +0 -32
- package/src/cli/actions/primitivesProfile.js +0 -15
- package/src/cli/actions/primitivesRedact.js +0 -19
- package/src/cli/actions/protect.js +0 -75
- package/src/cli/actions/protectDocker.js +0 -30
- package/src/cli/actions/protectProcess.js +0 -126
- package/src/cli/actions/protectStdin.js +0 -80
- package/src/cli/actions/run.js +0 -203
- package/src/cli/actions/set.js +0 -103
- package/src/cli/actions/settings/device.js +0 -23
- package/src/cli/actions/settings/hostname.js +0 -20
- package/src/cli/actions/settings/off.js +0 -14
- package/src/cli/actions/settings/on.js +0 -14
- package/src/cli/actions/settings/path.js +0 -20
- package/src/cli/actions/settings/token.js +0 -23
- package/src/cli/actions/settings/username.js +0 -20
- package/src/cli/actions/update.js +0 -15
- package/src/cli/commandAction.js +0 -16
- package/src/cli/commands/armor.js +0 -129
- package/src/cli/commands/custody.js +0 -45
- package/src/cli/commands/ext.js +0 -88
- package/src/cli/commands/fileOptions.js +0 -22
- package/src/cli/commands/native.js +0 -54
- package/src/cli/commands/primitives.js +0 -73
- package/src/cli/commands/settings.js +0 -63
- package/src/cli/dotenvx.js +0 -443
- package/src/cli/help.js +0 -179
- package/src/db/device.js +0 -67
- package/src/db/session.js +0 -330
- package/src/lib/api/getAccount.js +0 -32
- package/src/lib/api/getConnectionResources.js +0 -21
- package/src/lib/api/getTeamConnections.js +0 -27
- package/src/lib/api/getTeamServices.js +0 -23
- package/src/lib/api/getTeams.js +0 -28
- package/src/lib/api/postArmorDown.js +0 -48
- package/src/lib/api/postArmorMove.js +0 -48
- package/src/lib/api/postArmorPull.js +0 -48
- package/src/lib/api/postArmorPush.js +0 -48
- package/src/lib/api/postArmorUp.js +0 -53
- package/src/lib/api/postConnectionKeypair.js +0 -23
- package/src/lib/api/postFeedback.js +0 -31
- package/src/lib/api/postLogout.js +0 -34
- package/src/lib/api/postOauthDeviceCode.js +0 -38
- package/src/lib/api/postOauthToken.js +0 -35
- package/src/lib/api/postTeamInvitation.js +0 -28
- package/src/lib/api/teamConnectionSetup.js +0 -31
- package/src/lib/config.d.ts +0 -1
- package/src/lib/config.js +0 -1
- package/src/lib/conventions/environment.js +0 -27
- package/src/lib/conventions/filepaths.js +0 -9
- package/src/lib/conventions/keynames.js +0 -38
- package/src/lib/custodians/index.js +0 -75
- package/src/lib/custodians/local/bitwarden.js +0 -165
- package/src/lib/custodians/local/file.js +0 -18
- package/src/lib/custodians/local/native/backend.js +0 -56
- package/src/lib/custodians/local/native/index.js +0 -28
- package/src/lib/custodians/local/native/store.js +0 -24
- package/src/lib/custodians/local/onepassword.js +0 -149
- package/src/lib/custodians/managed/armor/index.js +0 -14
- package/src/lib/custodians/managed/armor/store.js +0 -48
- package/src/lib/custodians/resolveLocalKey.js +0 -67
- package/src/lib/decryptors/armor/index.js +0 -23
- package/src/lib/decryptors/decryptor-worker.js +0 -6
- package/src/lib/decryptors/index.js +0 -69
- package/src/lib/envfile/discovery/discoverEnvFiles.js +0 -29
- package/src/lib/envfile/discovery/extractEnvKeys.js +0 -173
- package/src/lib/envfile/discovery/scanSource.js +0 -79
- package/src/lib/envfile/parsing/formatEnvfileSyntaxError.js +0 -24
- package/src/lib/envfile/parsing/readEnvfile.js +0 -43
- package/src/lib/envfile/parsing/resolveEnvfilePath.js +0 -5
- package/src/lib/envfile/rendering/normalizeEnvfile.js +0 -53
- package/src/lib/envfile/rendering/previewEnvfile.js +0 -43
- package/src/lib/envfile/rendering/renderEnvfile.js +0 -30
- package/src/lib/envfile/validation/diagnosticLocation.js +0 -29
- package/src/lib/envfile/validation/protectEnvfile.js +0 -40
- package/src/lib/envfile/validation/validateEnvfile.js +0 -14
- package/src/lib/events/backends/armor.js +0 -31
- package/src/lib/events/background.js +0 -59
- package/src/lib/events/catalog.js +0 -14
- package/src/lib/events/cli.js +0 -40
- package/src/lib/events/delivery.js +0 -89
- package/src/lib/events/index.js +0 -73
- package/src/lib/events/metadata.js +0 -25
- package/src/lib/events/sdk.js +0 -44
- package/src/lib/events/worker.js +0 -29
- package/src/lib/events/workerEnvironment.js +0 -14
- package/src/lib/helpers/armoredKeyDisplay.js +0 -10
- package/src/lib/helpers/arrayToTree.js +0 -27
- package/src/lib/helpers/buildApiError.js +0 -19
- package/src/lib/helpers/buildCommandEnvs.js +0 -40
- package/src/lib/helpers/buildConfigEnvs.js +0 -13
- package/src/lib/helpers/buildEnvs.js +0 -24
- package/src/lib/helpers/buildOauthError.js +0 -14
- package/src/lib/helpers/canonicalEnvFilename.js +0 -13
- package/src/lib/helpers/catchAndLog.js +0 -16
- package/src/lib/helpers/checklist.js +0 -50
- package/src/lib/helpers/chomp.js +0 -5
- package/src/lib/helpers/colorDepth.js +0 -23
- package/src/lib/helpers/conventions.js +0 -28
- package/src/lib/helpers/createElapsedStatus.js +0 -17
- package/src/lib/helpers/createProtectSpinner.js +0 -13
- package/src/lib/helpers/createSpinner.js +0 -40
- package/src/lib/helpers/cryptography/decryptKeyValue.js +0 -50
- package/src/lib/helpers/cryptography/index.js +0 -7
- package/src/lib/helpers/cryptography/isDotenvPublicKey.js +0 -7
- package/src/lib/helpers/cryptography/isPlainKey.js +0 -7
- package/src/lib/helpers/cryptography/mutateKeysSrc.js +0 -22
- package/src/lib/helpers/cryptography/mutateSrc.js +0 -24
- package/src/lib/helpers/custodySelect.js +0 -25
- package/src/lib/helpers/decryptDeviceValue.js +0 -7
- package/src/lib/helpers/detectEncoding.js +0 -22
- package/src/lib/helpers/detectEncodingSync.js +0 -22
- package/src/lib/helpers/dotenvOptionPaths.js +0 -25
- package/src/lib/helpers/dotenvPrivateKeyNames.js +0 -7
- package/src/lib/helpers/enclavedHint.js +0 -11
- package/src/lib/helpers/encryptDeviceValue.js +0 -7
- package/src/lib/helpers/envResolution/determine.js +0 -49
- package/src/lib/helpers/envResolution/index.js +0 -8
- package/src/lib/helpers/errors.js +0 -374
- package/src/lib/helpers/escape.js +0 -6
- package/src/lib/helpers/execute.js +0 -12
- package/src/lib/helpers/executeCommand.js +0 -208
- package/src/lib/helpers/executeDynamic.js +0 -86
- package/src/lib/helpers/executeExtension.js +0 -39
- package/src/lib/helpers/filterKeys.js +0 -15
- package/src/lib/helpers/findEnvFiles.js +0 -25
- package/src/lib/helpers/formatCode.js +0 -11
- package/src/lib/helpers/fsx.js +0 -110
- package/src/lib/helpers/guessPrivateKeyFilename.js +0 -15
- package/src/lib/helpers/hasPlaintextSecrets.js +0 -7
- package/src/lib/helpers/http.js +0 -14
- package/src/lib/helpers/installPrecommitHook.js +0 -82
- package/src/lib/helpers/installProtectFilter.js +0 -57
- package/src/lib/helpers/installProtectIgnore.js +0 -27
- package/src/lib/helpers/isPublicKey.js +0 -3
- package/src/lib/helpers/isTeamRequiredError.js +0 -10
- package/src/lib/helpers/jsonToEnv.js +0 -7
- package/src/lib/helpers/keypairMetadata.js +0 -90
- package/src/lib/helpers/kits/sample.js +0 -5
- package/src/lib/helpers/linuxSecretService.js +0 -52
- package/src/lib/helpers/listenForOpenKey.js +0 -46
- package/src/lib/helpers/logProtectedFiles.js +0 -9
- package/src/lib/helpers/logSetSummary.js +0 -21
- package/src/lib/helpers/macosKeychain.js +0 -52
- package/src/lib/helpers/mask.js +0 -22
- package/src/lib/helpers/maskEnvSrc.js +0 -15
- package/src/lib/helpers/maskProcessedEnvs.js +0 -29
- package/src/lib/helpers/matchesStoredKey.js +0 -5
- package/src/lib/helpers/nativeStoreError.js +0 -10
- package/src/lib/helpers/normalizeDotenvConfigConvention.js +0 -13
- package/src/lib/helpers/normalizeDotenvConfigIgnore.js +0 -18
- package/src/lib/helpers/normalizeDotenvConfigPath.js +0 -14
- package/src/lib/helpers/normalizeDotenvConfigQuiet.js +0 -13
- package/src/lib/helpers/normalizeToken.js +0 -5
- package/src/lib/helpers/openUrl.js +0 -7
- package/src/lib/helpers/packageJson.js +0 -3
- package/src/lib/helpers/parseWithDecryptor.js +0 -115
- package/src/lib/helpers/plaintextKeys.js +0 -9
- package/src/lib/helpers/precommitEnvPatterns.js +0 -1
- package/src/lib/helpers/prependPublicKey.js +0 -17
- package/src/lib/helpers/preserveShebang.js +0 -16
- package/src/lib/helpers/prompts.js +0 -169
- package/src/lib/helpers/protectSettings.js +0 -64
- package/src/lib/helpers/ptyCommand.js +0 -27
- package/src/lib/helpers/readEnvKey.js +0 -32
- package/src/lib/helpers/redact.js +0 -9
- package/src/lib/helpers/redactProcessOutput.js +0 -58
- package/src/lib/helpers/redactedValues.js +0 -29
- package/src/lib/helpers/removeDynamicHelpSection.js +0 -21
- package/src/lib/helpers/removeEnvKey.js +0 -51
- package/src/lib/helpers/removeLegacyProtectFilter.js +0 -43
- package/src/lib/helpers/removeOptionsHelpParts.js +0 -59
- package/src/lib/helpers/resolveBitwardenPassword.js +0 -165
- package/src/lib/helpers/resolveDirectoryFilepath.js +0 -16
- package/src/lib/helpers/resolveEnvKeysFile.js +0 -11
- package/src/lib/helpers/resolveHome.js +0 -12
- package/src/lib/helpers/resolveOnePassword.js +0 -82
- package/src/lib/helpers/sanitizeCommandForMetadata.js +0 -64
- package/src/lib/helpers/selectConnection.js +0 -51
- package/src/lib/helpers/selectConnectionResource.js +0 -41
- package/src/lib/helpers/selectEnvfileEnvs.js +0 -29
- package/src/lib/helpers/selectKeyStorage.js +0 -140
- package/src/lib/helpers/statusReporter.js +0 -8
- package/src/lib/helpers/storeKeyStorage.js +0 -39
- package/src/lib/helpers/teamChoicesFromMeta.js +0 -8
- package/src/lib/helpers/truncate.js +0 -10
- package/src/lib/helpers/uninstallPrecommitHook.js +0 -67
- package/src/lib/helpers/upsertEnvKey.js +0 -62
- package/src/lib/helpers/windowsCredentialManager.js +0 -166
- package/src/lib/main.d.ts +0 -509
- package/src/lib/main.js +0 -468
- package/src/lib/providers/index.js +0 -86
- package/src/lib/providers/native/index.js +0 -2
- package/src/lib/resolvers/envs.js +0 -416
- package/src/lib/resolvers/get.js +0 -87
- package/src/lib/resolvers/keypair.js +0 -135
- package/src/lib/resolvers/ls.js +0 -69
- package/src/lib/services/armorDown.js +0 -73
- package/src/lib/services/armorInvite.js +0 -36
- package/src/lib/services/armorMove.js +0 -55
- package/src/lib/services/armorOpen.js +0 -26
- package/src/lib/services/armorPull.js +0 -73
- package/src/lib/services/armorPush.js +0 -66
- package/src/lib/services/armorUp.js +0 -71
- package/src/lib/services/custodyTransfer.js +0 -50
- package/src/lib/services/doctor.js +0 -93
- package/src/lib/services/genexample.js +0 -112
- package/src/lib/services/init.js +0 -83
- package/src/lib/services/keychainDown.js +0 -60
- package/src/lib/services/keychainPull.js +0 -46
- package/src/lib/services/keychainPush.js +0 -51
- package/src/lib/services/keychainUp.js +0 -72
- package/src/lib/services/login.js +0 -51
- package/src/lib/services/logout.js +0 -26
- package/src/lib/services/prebuild.js +0 -91
- package/src/lib/services/precommit.js +0 -144
- package/src/lib/services/validate.js +0 -57
- package/src/lib/transforms/decrypt.js +0 -98
- package/src/lib/transforms/del.js +0 -58
- package/src/lib/transforms/encrypt.js +0 -164
- package/src/lib/transforms/set.js +0 -144
- package/src/shared/colors.js +0 -67
- package/src/shared/logger.js +0 -148
package/src/cli/dotenvx.js
DELETED
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/* c8 ignore start */
|
|
4
|
-
const { Command } = require('@dotenvx/tooling')
|
|
5
|
-
const program = new Command()
|
|
6
|
-
const commandAction = require('./commandAction')
|
|
7
|
-
|
|
8
|
-
const { setLogLevel } = require('../shared/logger')
|
|
9
|
-
const help = require('./help')
|
|
10
|
-
const packageJson = require('./../lib/helpers/packageJson')
|
|
11
|
-
const executeDynamic = require('./../lib/helpers/executeDynamic')
|
|
12
|
-
const removeDynamicHelpSection = require('./../lib/helpers/removeDynamicHelpSection')
|
|
13
|
-
const removeOptionsHelpParts = require('./../lib/helpers/removeOptionsHelpParts')
|
|
14
|
-
const normalizeDotenvConfigQuiet = require('./../lib/helpers/normalizeDotenvConfigQuiet')
|
|
15
|
-
|
|
16
|
-
// for use with run
|
|
17
|
-
const envs = []
|
|
18
|
-
function collectEnvs (type) {
|
|
19
|
-
return function (value, previous) {
|
|
20
|
-
const values = type === 'envFile'
|
|
21
|
-
? value.split(',').map(item => item.trim()).filter(Boolean)
|
|
22
|
-
: [value]
|
|
23
|
-
|
|
24
|
-
for (const item of values) {
|
|
25
|
-
envs.push({ type, value: item })
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return (previous || []).concat(values)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function collectEnvKeys (value, previous) {
|
|
33
|
-
if (previous === undefined) return value
|
|
34
|
-
if (Array.isArray(previous)) return previous.concat([value])
|
|
35
|
-
|
|
36
|
-
return [previous, value]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// global log levels
|
|
40
|
-
program
|
|
41
|
-
.usage('run -- yourcommand')
|
|
42
|
-
.option('-l, --log-level <level>', 'set log level', 'info')
|
|
43
|
-
.option('-q, --quiet', 'sets log level to error')
|
|
44
|
-
.option('-v, --verbose', 'sets log level to verbose')
|
|
45
|
-
.option('-d, --debug', 'sets log level to debug')
|
|
46
|
-
.hook('preAction', (thisCommand, actionCommand) => {
|
|
47
|
-
const options = normalizeDotenvConfigQuiet(thisCommand.opts())
|
|
48
|
-
|
|
49
|
-
setLogLevel(options)
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
// for dynamic loading of dotenvx-armor, etc
|
|
53
|
-
program
|
|
54
|
-
.argument('[command]', 'dynamic command')
|
|
55
|
-
.argument('[args...]', 'dynamic command arguments')
|
|
56
|
-
.action((command, args, cmdObj) => {
|
|
57
|
-
const rawArgs = process.argv.slice(3) // adjust the index based on where actual args start
|
|
58
|
-
executeDynamic(program, command, rawArgs)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
// cli
|
|
62
|
-
program
|
|
63
|
-
.name('dotenvx')
|
|
64
|
-
.description(packageJson.description)
|
|
65
|
-
.version(packageJson.version)
|
|
66
|
-
.allowUnknownOption()
|
|
67
|
-
|
|
68
|
-
// dotenvx run -- node index.js
|
|
69
|
-
program.command('run')
|
|
70
|
-
.description('inject env at runtime [dotenvx run -- yourcommand]')
|
|
71
|
-
.addHelpText('after', help.run)
|
|
72
|
-
.option('-e, --env <strings...>', 'environment variable(s) set as string (example: "HELLO=World")', collectEnvs('env'), [])
|
|
73
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
74
|
-
.option('-fk, --env-keys-file <path>', 'path(s) to your .env.keys file(s) (default: same path as your env file)', collectEnvKeys)
|
|
75
|
-
.option('-o, --overload', 'override existing env variables (by default, existing env vars take precedence over .env files)')
|
|
76
|
-
.option('--strict', 'process.exit(1) on any errors', false)
|
|
77
|
-
.option('--profile <name>', 'select an Envfile profile')
|
|
78
|
-
.option('--convention <name>', 'load a .env convention (available conventions: [\'nextjs\', \'flow\'])')
|
|
79
|
-
.option('--ignore <errorCodes...>', 'error code(s) to ignore (example: --ignore=MISSING_ENV_FILE)')
|
|
80
|
-
.option('--token <token>', 'set Armor ⛨ token')
|
|
81
|
-
.option('--mask [characters]', 'inject masked values, optionally setting visible characters')
|
|
82
|
-
.option('--redact', 'redact injected values except public keys (Envfile rules take precedence)', false)
|
|
83
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
84
|
-
.option('--no-native', 'disable OS secret store features')
|
|
85
|
-
.option('--no-1password', 'disable 1Password secret reference resolution')
|
|
86
|
-
.option('--no-bitwarden', 'disable Bitwarden secret reference resolution')
|
|
87
|
-
.action(function (...args) {
|
|
88
|
-
this.envs = envs
|
|
89
|
-
return require('./actions/run').apply(this, args)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
// dotenvx get
|
|
93
|
-
program.command('get')
|
|
94
|
-
.usage('[KEY] [options]')
|
|
95
|
-
.description('return a single environment variable')
|
|
96
|
-
.argument('[KEY]', 'environment variable name')
|
|
97
|
-
.option('-e, --env <strings...>', 'environment variable(s) set as string (example: "HELLO=World")', collectEnvs('env'), [])
|
|
98
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
99
|
-
.option('-fk, --env-keys-file <path>', 'path(s) to your .env.keys file(s) (default: same path as your env file)', collectEnvKeys)
|
|
100
|
-
.option('-o, --overload', 'override existing env variables (by default, existing env vars take precedence over .env files)')
|
|
101
|
-
.option('--strict', 'process.exit(1) on any errors', false)
|
|
102
|
-
.option('--profile <name>', 'select an Envfile profile')
|
|
103
|
-
.option('--convention <name>', 'load a .env convention (available conventions: [\'nextjs\', \'flow\'])')
|
|
104
|
-
.option('--ignore <errorCodes...>', 'error code(s) to ignore (example: --ignore=MISSING_ENV_FILE)')
|
|
105
|
-
.option('-a, --all', 'include all machine envs as well')
|
|
106
|
-
.option('-ik, --include-key <includeKeys...>', 'keys(s) to include in output (default: all)')
|
|
107
|
-
.option('-ek, --exclude-key <excludeKeys...>', 'keys(s) to exclude from output (default: none)')
|
|
108
|
-
.option('--mask [characters]', 'mask values, optionally setting visible characters')
|
|
109
|
-
.option('-pp, --pretty-print', 'pretty print output')
|
|
110
|
-
.option('--pp', 'pretty print output (alias)')
|
|
111
|
-
.option('--format <type>', 'format of the output (json, shell, colon, eval, eval-export)', 'json')
|
|
112
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
113
|
-
.option('--no-native', 'disable OS secret store features')
|
|
114
|
-
.option('--no-1password', 'disable 1Password secret reference resolution')
|
|
115
|
-
.option('--no-bitwarden', 'disable Bitwarden secret reference resolution')
|
|
116
|
-
.action(function (...args) {
|
|
117
|
-
this.envs = envs
|
|
118
|
-
return require('./actions/get').apply(this, args)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
// dotenvx set
|
|
122
|
-
program.command('set')
|
|
123
|
-
.usage('<KEY> [value] [options]')
|
|
124
|
-
.description('encrypt a single environment variable')
|
|
125
|
-
.option('--profile <name>', 'select an Envfile profile')
|
|
126
|
-
.addHelpText('after', help.set)
|
|
127
|
-
.allowUnknownOption()
|
|
128
|
-
.argument('KEY', 'KEY')
|
|
129
|
-
.argument('[value]', 'value')
|
|
130
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
131
|
-
.option('-fk, --env-keys-file <path>', 'path to your .env.keys file (default: same path as your env file)')
|
|
132
|
-
.option('-c, --encrypt', 'encrypt value', true)
|
|
133
|
-
.option('--plain', 'store value as plain text', false)
|
|
134
|
-
.option('--no-create', 'do not create .env file(s) when missing')
|
|
135
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
136
|
-
.option('--no-native', 'disable OS secret store features')
|
|
137
|
-
.option('--no-1password', 'disable 1Password features')
|
|
138
|
-
.option('--no-bitwarden', 'disable Bitwarden features')
|
|
139
|
-
.action(function (...args) {
|
|
140
|
-
this.envs = envs
|
|
141
|
-
return require('./actions/set').apply(this, args)
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
// dotenvx del
|
|
145
|
-
program.command('del')
|
|
146
|
-
.usage('<KEY> [options]')
|
|
147
|
-
.description('delete a single environment variable')
|
|
148
|
-
.addHelpText('after', help.del)
|
|
149
|
-
.argument('KEY', 'KEY')
|
|
150
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
151
|
-
.action(function (...args) {
|
|
152
|
-
this.envs = envs
|
|
153
|
-
return require('./actions/del').apply(this, args)
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
// dotenvx encrypt
|
|
157
|
-
function configureEncryptCommand (command) {
|
|
158
|
-
return command
|
|
159
|
-
.description('encrypt .env file(s)')
|
|
160
|
-
.option('--with <public-key>', 'encrypt with this public key; accepts a fresh file or matching existing public key')
|
|
161
|
-
.option('--profile <name>', 'select an Envfile profile')
|
|
162
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
163
|
-
.option('-fk, --env-keys-file <path>', 'path to your .env.keys file (default: same path as your env file)')
|
|
164
|
-
.option('-k, --key <keys...>', 'keys(s) to encrypt (default: all keys in file)')
|
|
165
|
-
.option('-ek, --exclude-key <excludeKeys...>', 'keys(s) to exclude from encryption (default: none)')
|
|
166
|
-
.option('--stdout', 'send to stdout')
|
|
167
|
-
.option('--token <token>', 'set Armor ⛨ token')
|
|
168
|
-
.option('--no-create', 'do not create .env file(s) when missing')
|
|
169
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
170
|
-
.option('--no-native', 'disable OS secret store features')
|
|
171
|
-
.option('--no-1password', 'disable 1Password features')
|
|
172
|
-
.option('--no-bitwarden', 'disable Bitwarden features')
|
|
173
|
-
.action(function (...args) {
|
|
174
|
-
this.envs = envs
|
|
175
|
-
return require('./actions/encrypt').apply(this, args)
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
configureEncryptCommand(program.command('encrypt'))
|
|
179
|
-
configureEncryptCommand(program.command('enc', { hidden: true })) // shorthand
|
|
180
|
-
|
|
181
|
-
// dotenvx decrypt
|
|
182
|
-
function configureDecryptCommand (command) {
|
|
183
|
-
return command
|
|
184
|
-
.description('decrypt .env file(s)')
|
|
185
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
186
|
-
.option('-fk, --env-keys-file <path>', 'path(s) to your .env.keys file(s) (default: same path as your env file)', collectEnvKeys)
|
|
187
|
-
.option('-k, --key <keys...>', 'keys(s) to decrypt (default: all keys in file)')
|
|
188
|
-
.option('-ek, --exclude-key <excludeKeys...>', 'keys(s) to exclude from decryption (default: none)')
|
|
189
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
190
|
-
.option('--no-native', 'disable OS secret store features')
|
|
191
|
-
.option('--stdout', 'send to stdout')
|
|
192
|
-
.option('--mask [characters]', 'mask stdout values, optionally setting visible characters')
|
|
193
|
-
.action(function (...args) {
|
|
194
|
-
this.envs = envs
|
|
195
|
-
return require('./actions/decrypt').apply(this, args)
|
|
196
|
-
})
|
|
197
|
-
}
|
|
198
|
-
configureDecryptCommand(program.command('decrypt'))
|
|
199
|
-
configureDecryptCommand(program.command('dec', { hidden: true })) // shorthand
|
|
200
|
-
|
|
201
|
-
// dotenvx keypair
|
|
202
|
-
program.command('keypair')
|
|
203
|
-
.usage('[KEY] [options]')
|
|
204
|
-
.description('print public/private keys for .env file(s)')
|
|
205
|
-
.argument('[KEY]', 'environment variable key name')
|
|
206
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'))
|
|
207
|
-
.option('-fk, --env-keys-file <path>', 'path(s) to your .env.keys file(s) (default: same path as your env file)', collectEnvKeys)
|
|
208
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
209
|
-
.option('--no-native', 'disable OS secret store features')
|
|
210
|
-
.option('--no-1password', 'disable 1Password features')
|
|
211
|
-
.option('--no-bitwarden', 'disable Bitwarden features')
|
|
212
|
-
.option('-pp, --pretty-print', 'pretty print output')
|
|
213
|
-
.option('--pp', 'pretty print output (alias)')
|
|
214
|
-
.option('--format <type>', 'format of the output (json, shell, colon)', 'json')
|
|
215
|
-
.action(function (...args) {
|
|
216
|
-
return require('./actions/keypair').apply(this, args)
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
// dotenvx ls
|
|
220
|
-
program.command('ls', { hidden: true })
|
|
221
|
-
.description('print all .env files in a tree structure')
|
|
222
|
-
.argument('[directory]', 'directory to list .env files from', '.')
|
|
223
|
-
.option('-f, --env-file <filenames...>', 'path(s) to your env file(s)', '.env*')
|
|
224
|
-
.option('-ef, --exclude-env-file <excludeFilenames...>', 'path(s) to exclude from your env file(s) (default: none)')
|
|
225
|
-
.option('--json', 'output a JSON array of absolute filepaths')
|
|
226
|
-
.action(function (...args) {
|
|
227
|
-
return commandAction(require('./actions/ls')).apply(this, args)
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
// dotenvx spec
|
|
231
|
-
program.command('spec', { hidden: true })
|
|
232
|
-
.description('create an Envfile')
|
|
233
|
-
.option('--stdout', 'send to stdout')
|
|
234
|
-
.option('--overwrite', 'replace existing Envfile, including custom rules, comments, and missing-file blocks')
|
|
235
|
-
.option('-f, --env-file <path>', 'file to read variable names from')
|
|
236
|
-
.action(function () {
|
|
237
|
-
return commandAction(require('./actions/init')).apply(this, arguments)
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
// dotenvx check
|
|
241
|
-
program.command('check', { hidden: true })
|
|
242
|
-
.description('check Envfile rules against .env file(s)')
|
|
243
|
-
.option('-e, --env <strings...>', 'environment variable(s) set as string (example: "HELLO=World")', collectEnvs('env'), [])
|
|
244
|
-
.option('-f, --env-file <path>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
245
|
-
.option('-fk, --env-keys-file <path>', 'path(s) to your .env.keys file(s) (default: same path as your env file)', collectEnvKeys)
|
|
246
|
-
.option('-o, --overload', 'override existing env variables (by default, existing env vars take precedence over .env files)')
|
|
247
|
-
.option('--profile <name>', 'select an Envfile profile')
|
|
248
|
-
.option('--convention <name>', 'load a .env convention (available conventions: [\'nextjs\', \'flow\'])')
|
|
249
|
-
.option('--ignore <errorCodes...>', 'error code(s) to ignore (example: --ignore=MISSING_ENV_FILE)')
|
|
250
|
-
.option('--token <token>', 'set Armor ⛨ token')
|
|
251
|
-
.option('--no-armor', 'disable Dotenvx Armor features')
|
|
252
|
-
.option('--no-native', 'disable OS secret store features')
|
|
253
|
-
.option('--no-1password', 'disable 1Password secret reference resolution')
|
|
254
|
-
.option('--no-bitwarden', 'disable Bitwarden secret reference resolution')
|
|
255
|
-
.action(function (...args) {
|
|
256
|
-
this.envs = envs
|
|
257
|
-
return commandAction(require('./actions/check')).apply(this, args)
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
// dotenvx gitignore
|
|
261
|
-
program.command('gitignore', { hidden: true })
|
|
262
|
-
.description('deprecated. use [dotenvx protect]')
|
|
263
|
-
.addHelpText('after', help.gitignore)
|
|
264
|
-
.option('--pattern <patterns...>', 'pattern(s) to gitignore', ['.env*'])
|
|
265
|
-
.action(function (...args) {
|
|
266
|
-
return require('./actions/ext/gitignore').apply(this, args)
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
// dotenvx genexample
|
|
270
|
-
program.command('genexample', { hidden: true })
|
|
271
|
-
.description('generate .env.example')
|
|
272
|
-
.argument('[directory]', 'directory to generate from', '.')
|
|
273
|
-
.option('-f, --env-file <paths...>', 'path(s) to your env file(s)', '.env')
|
|
274
|
-
.action(function (...args) {
|
|
275
|
-
return commandAction(require('./actions/ext/genexample')).apply(this, args)
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
// dotenvx precommit
|
|
279
|
-
program.command('precommit', { hidden: true })
|
|
280
|
-
.description('deprecated. use [dotenvx protect]')
|
|
281
|
-
.addHelpText('after', help.precommit)
|
|
282
|
-
.argument('[directory]', 'directory to prevent committing .env files from', '.')
|
|
283
|
-
.option('-i, --install', 'install a pre-commit hook')
|
|
284
|
-
.option('--uninstall', 'remove the dotenvx pre-commit hook')
|
|
285
|
-
.action(function (...args) {
|
|
286
|
-
return require('./actions/ext/precommit').apply(this, args)
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
// dotenvx protect
|
|
290
|
-
program.command('protect', { hidden: true })
|
|
291
|
-
.description('protect secrets and private keys from code commits')
|
|
292
|
-
.argument('[directory]', 'directory to check with --docker', '.')
|
|
293
|
-
.addOption(program.createOption('--docker', 'check env files are encrypted or dockerignored').conflicts(['gitFile', 'gitProcess']))
|
|
294
|
-
.addOption(program.createOption('--git-file <pathname>', 'check stdin contents for the given Git pathname').hideHelp())
|
|
295
|
-
.addOption(program.createOption('--git-process', 'run the Git protection filter protocol').hideHelp())
|
|
296
|
-
.action(function () {
|
|
297
|
-
return require('./actions/protect').apply(this, arguments)
|
|
298
|
-
})
|
|
299
|
-
|
|
300
|
-
// dotenvx prebuild
|
|
301
|
-
program.command('prebuild', { hidden: true })
|
|
302
|
-
.description('deprecated. use [dotenvx protect --docker]')
|
|
303
|
-
.addHelpText('after', help.prebuild)
|
|
304
|
-
.argument('[directory]', 'directory to prevent including .env files from', '.')
|
|
305
|
-
.action(function (...args) {
|
|
306
|
-
return require('./actions/ext/prebuild').apply(this, args)
|
|
307
|
-
})
|
|
308
|
-
|
|
309
|
-
// dotenvx doctor
|
|
310
|
-
program.command('doctor', { hidden: true })
|
|
311
|
-
.description('scan for dotenv loaders')
|
|
312
|
-
.argument('[directory]', 'directory to scan', '.')
|
|
313
|
-
.action(function (...args) {
|
|
314
|
-
return commandAction(require('./actions/doctor')).apply(this, args)
|
|
315
|
-
})
|
|
316
|
-
|
|
317
|
-
// dotenvx feedback
|
|
318
|
-
program.command('feedback', { hidden: true })
|
|
319
|
-
.description('send feedback to dotenvx')
|
|
320
|
-
.argument('[message]', 'feedback message')
|
|
321
|
-
.allowExcessArguments(false)
|
|
322
|
-
.option('--hostname <hostname>', 'set API hostname')
|
|
323
|
-
.action(function (...args) {
|
|
324
|
-
return commandAction(require('./actions/feedback')).apply(this, args)
|
|
325
|
-
})
|
|
326
|
-
|
|
327
|
-
// Build menu entries from the command definitions so new subcommands stay discoverable.
|
|
328
|
-
function hiddenSubcommands (name) {
|
|
329
|
-
const parent = program.commands.find(command => command.name() === name)
|
|
330
|
-
const formatter = parent.createHelp()
|
|
331
|
-
const entries = parent.commands.map(command => ({
|
|
332
|
-
term: `${name} ${formatter.subcommandTerm(command)}`,
|
|
333
|
-
description: command.description()
|
|
334
|
-
}))
|
|
335
|
-
const width = Math.max(...entries.map(entry => entry.term.length))
|
|
336
|
-
return entries.map(entry => ` ${entry.term.padEnd(width)} ${entry.description}`).join('\n')
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// dotenvx hidden (a menu of commands and subcommands)
|
|
340
|
-
program.command('hidden')
|
|
341
|
-
.allowExcessArguments(false)
|
|
342
|
-
.description('hidden features')
|
|
343
|
-
.addHelpText('after', () => `\nHidden Commands:\n update update dotenvx\n feedback [message] send feedback to dotenvx\n protect protect secrets and private keys from code commits\n ls [directory] print all .env files in a tree structure\n genexample [directory] generate .env.example\n native ⌥ move private keys in/out of your OS secret store\n 1password □ move private keys in/out of 1Password\n bitwarden □ move private keys in/out of Bitwarden\n armor ⛨ move private keys in/out of Dotenvx Armor [www.dotenvx.com/armor]\n curl ⛨ call authenticated api Dotenvx Armor [www.dotenvx.com/armor]\n\nBeta Commands:\n spec create an Envfile\n check check Envfile rules against .env file(s)\n${hiddenSubcommands('primitives')}\n\nDeprecated Commands:\n gitignore deprecated. use [dotenvx protect]\n precommit [directory] deprecated. use [dotenvx protect]\n prebuild [directory] deprecated. use [dotenvx protect --docker]\n\nRun directly: dotenvx <command>`)
|
|
344
|
-
.action(function () { this.outputHelp() })
|
|
345
|
-
|
|
346
|
-
// dotenvx update
|
|
347
|
-
program.command('update', { hidden: true })
|
|
348
|
-
.description('update dotenvx')
|
|
349
|
-
.action(function (...args) {
|
|
350
|
-
return commandAction(require('./actions/update')).apply(this, args)
|
|
351
|
-
})
|
|
352
|
-
|
|
353
|
-
// dotenvx login (compatibility alias for dotenvx armor login)
|
|
354
|
-
program.command('login', { hidden: true })
|
|
355
|
-
.description('log in to move keys off-device, share with your team, and audit access')
|
|
356
|
-
.allowUnknownOption()
|
|
357
|
-
.option('--hostname <hostname>', 'set Armor ⛨ hostname')
|
|
358
|
-
.action(function (...args) {
|
|
359
|
-
return commandAction(require('./actions/login')).apply(this, args)
|
|
360
|
-
})
|
|
361
|
-
|
|
362
|
-
// dotenvx logout (compatibility alias for dotenvx armor logout)
|
|
363
|
-
program.command('logout', { hidden: true })
|
|
364
|
-
.description('log out of connected security features')
|
|
365
|
-
.allowUnknownOption()
|
|
366
|
-
.option('--hostname <hostname>', 'set Armor ⛨ hostname')
|
|
367
|
-
.action(function (...args) {
|
|
368
|
-
return commandAction(require('./actions/logout')).apply(this, args)
|
|
369
|
-
})
|
|
370
|
-
|
|
371
|
-
// dotenvx curl
|
|
372
|
-
program.command('curl', { hidden: true })
|
|
373
|
-
.description('Dotenvx Armor API')
|
|
374
|
-
.addHelpText('after', help.curl)
|
|
375
|
-
.argument('[url]', '(run dotenvx curl --help for list of urls)')
|
|
376
|
-
.option('-X, --request <method>', 'HTTP request method')
|
|
377
|
-
.option('--data <json>', 'JSON request body')
|
|
378
|
-
.option('--token <token>', 'set token')
|
|
379
|
-
.action(function (...args) {
|
|
380
|
-
if (!this.args[0]) {
|
|
381
|
-
this.outputHelp()
|
|
382
|
-
return
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
return commandAction(require('./actions/curl')).apply(this, args)
|
|
386
|
-
})
|
|
387
|
-
|
|
388
|
-
// dotenvx help
|
|
389
|
-
program.command('help [command]')
|
|
390
|
-
.description('display help for command')
|
|
391
|
-
.action((command) => {
|
|
392
|
-
if (command) {
|
|
393
|
-
const subCommand = program.commands.find(c => c.name() === command)
|
|
394
|
-
if (subCommand) {
|
|
395
|
-
subCommand.outputHelp()
|
|
396
|
-
} else {
|
|
397
|
-
program.outputHelp()
|
|
398
|
-
}
|
|
399
|
-
} else {
|
|
400
|
-
program.outputHelp()
|
|
401
|
-
}
|
|
402
|
-
})
|
|
403
|
-
|
|
404
|
-
require('./commands/custody')(program.command('1password', { hidden: true }), '1Password', 'onepassword')
|
|
405
|
-
require('./commands/custody')(program.command('bitwarden', { hidden: true }), 'Bitwarden', 'bitwarden')
|
|
406
|
-
|
|
407
|
-
// dotenvx native
|
|
408
|
-
require('./commands/native')(program.command('native', { hidden: true }))
|
|
409
|
-
|
|
410
|
-
// dotenvx armor
|
|
411
|
-
require('./commands/armor')(program.command('armor', { hidden: true }))
|
|
412
|
-
|
|
413
|
-
// dotenvx primitives
|
|
414
|
-
require('./commands/primitives')(program.command('primitives', { hidden: true }))
|
|
415
|
-
|
|
416
|
-
// dotenvx ext
|
|
417
|
-
program.addCommand(require('./commands/ext'))
|
|
418
|
-
|
|
419
|
-
// override helpInformation to hide DEPRECATED and 'ext' commands
|
|
420
|
-
program.helpInformation = function () {
|
|
421
|
-
const originalHelp = Command.prototype.helpInformation.call(this)
|
|
422
|
-
const lines = originalHelp.split('\n')
|
|
423
|
-
|
|
424
|
-
removeDynamicHelpSection(lines)
|
|
425
|
-
removeOptionsHelpParts(lines)
|
|
426
|
-
|
|
427
|
-
// Filter out the hidden command from the help output
|
|
428
|
-
const filteredLines = lines.filter(line =>
|
|
429
|
-
!line.includes('DEPRECATED') &&
|
|
430
|
-
!line.includes('help [command]') &&
|
|
431
|
-
!line.includes('🔌 extensions')
|
|
432
|
-
)
|
|
433
|
-
|
|
434
|
-
return filteredLines.join('\n')
|
|
435
|
-
}
|
|
436
|
-
/* c8 ignore stop */
|
|
437
|
-
|
|
438
|
-
program.command('_deliver-events', { hidden: true })
|
|
439
|
-
.action(() => require('../lib/events/worker')())
|
|
440
|
-
|
|
441
|
-
require('./commands/fileOptions')(program)
|
|
442
|
-
|
|
443
|
-
program.parse(process.argv)
|
package/src/cli/help.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
const run = function () {
|
|
2
|
-
return `
|
|
3
|
-
Examples:
|
|
4
|
-
|
|
5
|
-
\`\`\`
|
|
6
|
-
$ dotenvx run -- npm run dev
|
|
7
|
-
$ dotenvx run -- flask --app index run
|
|
8
|
-
$ dotenvx run -- php artisan serve
|
|
9
|
-
$ dotenvx run -- bin/rails s
|
|
10
|
-
\`\`\`
|
|
11
|
-
|
|
12
|
-
Try it:
|
|
13
|
-
|
|
14
|
-
\`\`\`
|
|
15
|
-
$ echo "HELLO=World" > .env
|
|
16
|
-
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
17
|
-
|
|
18
|
-
$ dotenvx run -f .env -- node index.js
|
|
19
|
-
[dotenvx] injected env (1) from .env
|
|
20
|
-
Hello World
|
|
21
|
-
\`\`\`
|
|
22
|
-
`
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const precommit = function () {
|
|
26
|
-
return `
|
|
27
|
-
Examples:
|
|
28
|
-
|
|
29
|
-
\`\`\`
|
|
30
|
-
$ dotenvx precommit
|
|
31
|
-
$ dotenvx precommit --install
|
|
32
|
-
\`\`\`
|
|
33
|
-
|
|
34
|
-
Try it:
|
|
35
|
-
|
|
36
|
-
\`\`\`
|
|
37
|
-
$ dotenvx precommit
|
|
38
|
-
[dotenvx@0.45.0][precommit] success
|
|
39
|
-
\`\`\`
|
|
40
|
-
`
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const prebuild = function () {
|
|
44
|
-
return `
|
|
45
|
-
Deprecated. Use [dotenvx protect --docker].
|
|
46
|
-
|
|
47
|
-
Examples:
|
|
48
|
-
|
|
49
|
-
\`\`\`
|
|
50
|
-
$ dotenvx protect --docker
|
|
51
|
-
\`\`\`
|
|
52
|
-
|
|
53
|
-
Try it:
|
|
54
|
-
|
|
55
|
-
\`\`\`
|
|
56
|
-
$ dotenvx protect --docker apps/backend
|
|
57
|
-
\`\`\`
|
|
58
|
-
`
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const gitignore = function () {
|
|
62
|
-
return `
|
|
63
|
-
Examples:
|
|
64
|
-
|
|
65
|
-
\`\`\`
|
|
66
|
-
$ dotenvx gitignore
|
|
67
|
-
$ dotenvx gitignore --pattern .env.keys
|
|
68
|
-
\`\`\`
|
|
69
|
-
|
|
70
|
-
Try it:
|
|
71
|
-
|
|
72
|
-
\`\`\`
|
|
73
|
-
$ dotenvx gitignore
|
|
74
|
-
▣ ignored .env* (.gitignore)
|
|
75
|
-
\`\`\`
|
|
76
|
-
`
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const set = function () {
|
|
80
|
-
return `
|
|
81
|
-
Examples:
|
|
82
|
-
|
|
83
|
-
\`\`\`
|
|
84
|
-
$ dotenvx set KEY value
|
|
85
|
-
$ dotenvx set KEY "value with spaces"
|
|
86
|
-
$ dotenvx set KEY -- "---value with a dash---"
|
|
87
|
-
$ dotenvx set KEY -- "-----BEGIN OPENSSH PRIVATE KEY-----
|
|
88
|
-
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|
89
|
-
-----END OPENSSH PRIVATE KEY-----"
|
|
90
|
-
\`\`\`
|
|
91
|
-
`
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const del = function () {
|
|
95
|
-
return `
|
|
96
|
-
Examples:
|
|
97
|
-
|
|
98
|
-
\`\`\`
|
|
99
|
-
$ dotenvx del KEY
|
|
100
|
-
$ dotenvx del KEY -f .env.production
|
|
101
|
-
\`\`\`
|
|
102
|
-
`
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const curl = function () {
|
|
106
|
-
return `
|
|
107
|
-
Endpoints:
|
|
108
|
-
|
|
109
|
-
GET /api/account
|
|
110
|
-
GET /api/armor/keypairs
|
|
111
|
-
GET /api/armor/keypairs/:public_key
|
|
112
|
-
POST /api/armor/keypairs/:public_key/name
|
|
113
|
-
POST /api/armor/keypairs/:public_key/members/:member_id/grant
|
|
114
|
-
POST /api/armor/keypairs/:public_key/members/:member_id/revoke
|
|
115
|
-
POST /api/armor/keypairs/:public_key/settings/guard
|
|
116
|
-
POST /api/armor/keypairs/:public_key/settings/enclave
|
|
117
|
-
GET /api/teams
|
|
118
|
-
GET /api/teams/:team
|
|
119
|
-
GET /api/teams/:team/members
|
|
120
|
-
POST /api/teams/:team/members/:member_id/keypairs/:public_key/grant
|
|
121
|
-
POST /api/teams/:team/members/:member_id/keypairs/:public_key/revoke
|
|
122
|
-
GET /api/teams/:team/invitations
|
|
123
|
-
POST /api/teams/:team/invitations
|
|
124
|
-
POST /api/teams/:team/invitations/:id/cancel
|
|
125
|
-
GET /api/join_requests
|
|
126
|
-
POST /api/join_requests
|
|
127
|
-
POST /api/join_requests/:id/cancel
|
|
128
|
-
GET /api/teams/:team/join_requests
|
|
129
|
-
POST /api/teams/:team/join_requests/:id/accept
|
|
130
|
-
POST /api/teams/:team/join_requests/:id/decline
|
|
131
|
-
POST /api/armor/:team/settings/join_requests
|
|
132
|
-
GET /api/logs?team=:team
|
|
133
|
-
|
|
134
|
-
Examples:
|
|
135
|
-
|
|
136
|
-
dotenvx curl "https://armor.dotenvx.com/api/account"
|
|
137
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs"
|
|
138
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs?page=1&per=100"
|
|
139
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs?sort=name_asc"
|
|
140
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs?sort=public_key_desc"
|
|
141
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY"
|
|
142
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/name" --data '{"name":"Production"}'
|
|
143
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/name" --data '{"name":null}'
|
|
144
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/members/123/grant" --request POST
|
|
145
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/members/123/revoke" --request POST
|
|
146
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/guard" --data '{"value":true}'
|
|
147
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/guard" --data '{"value":false}'
|
|
148
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/enclave" --data '{"value":true}'
|
|
149
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/keypairs/PUBLIC_KEY/settings/enclave" --data '{"value":false}'
|
|
150
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams"
|
|
151
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM"
|
|
152
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/members"
|
|
153
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/members/123/keypairs/PUBLIC_KEY/grant" --request POST
|
|
154
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/members/123/keypairs/PUBLIC_KEY/revoke" --request POST
|
|
155
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/invitations"
|
|
156
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/invitations" --data '{"email":"person@example.com","role":"member"}'
|
|
157
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/invitations/123/cancel" --request POST
|
|
158
|
-
dotenvx curl "https://armor.dotenvx.com/api/join_requests"
|
|
159
|
-
dotenvx curl "https://armor.dotenvx.com/api/join_requests" --data '{"team":"TEAM"}'
|
|
160
|
-
dotenvx curl "https://armor.dotenvx.com/api/join_requests/123/cancel" --request POST
|
|
161
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/join_requests"
|
|
162
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/join_requests/123/accept" --data '{"role":"member"}'
|
|
163
|
-
dotenvx curl "https://armor.dotenvx.com/api/teams/TEAM/join_requests/123/decline" --request POST
|
|
164
|
-
dotenvx curl "https://armor.dotenvx.com/api/armor/TEAM/settings/join_requests" --data '{"value":true}'
|
|
165
|
-
dotenvx curl "https://armor.dotenvx.com/api/logs?team=TEAM"
|
|
166
|
-
dotenvx curl "https://armor.dotenvx.com/api/logs?team=TEAM&action=keypair/access&actor=USERNAME&result=success&resource=keypair/KEYPAIR_ID&page=1&per=100"
|
|
167
|
-
dotenvx curl "https://armor.dotenvx.com/api/logs?team=TEAM&actor=missing&resource=missing"
|
|
168
|
-
`
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
module.exports = {
|
|
172
|
-
run,
|
|
173
|
-
precommit,
|
|
174
|
-
prebuild,
|
|
175
|
-
gitignore,
|
|
176
|
-
set,
|
|
177
|
-
del,
|
|
178
|
-
curl
|
|
179
|
-
}
|