@mirta/cli 0.4.7 → 0.4.9
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 +8 -4
- package/README.ru.md +7 -4
- package/dist/deploy.mjs +24 -18
- package/dist/index.mjs +33 -11
- package/locales/en-US.json +1 -0
- package/locales/ru-RU.json +1 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ These global options are available for all commands:
|
|
|
51
51
|
- `--help` (`-h`) — displays help on available commands and options.
|
|
52
52
|
- `--version` (`-v`) — prints `@mirta/cli` version.
|
|
53
53
|
- `--locale <loc>` — sets the interface language (`en`, `ru`).
|
|
54
|
+
- `--debug` — enables debug mode with detailed logging output.
|
|
54
55
|
|
|
55
56
|
### `pnpm mirta release`
|
|
56
57
|
|
|
@@ -84,7 +85,7 @@ The process is divided into stages:
|
|
|
84
85
|
|
|
85
86
|
#### Supported Options
|
|
86
87
|
|
|
87
|
-
- `--dry-run`
|
|
88
|
+
- `--dry-run` — simulation mode, shows changes without applying them.
|
|
88
89
|
- `--preid` `<id>` — custom prerelease identifier (`alpha.0`, `beta.1`).
|
|
89
90
|
- `--skip-prompts` — skips interactive prompts, uses defaults.
|
|
90
91
|
- `--skip-git` — skips commit and tag creation.
|
|
@@ -219,7 +220,7 @@ In CI, `--provenance` is added to attest package origin.
|
|
|
219
220
|
|
|
220
221
|
#### Supported Options
|
|
221
222
|
|
|
222
|
-
- `--dry-run`
|
|
223
|
+
- `--dry-run` — simulation mode.
|
|
223
224
|
- `--skip-build` — skips running `pnpm run build`.
|
|
224
225
|
- `--skip-git` — disables git checks (equivalent to `--no-git-checks` in `pnpm publish`).
|
|
225
226
|
|
|
@@ -237,9 +238,10 @@ Synchronizes files with Wiren Board controllers via `rsync` over SSH.
|
|
|
237
238
|
- Authentication:
|
|
238
239
|
- Uses an isolated `ssh-agent`.
|
|
239
240
|
- Supports PKCS#11 (Rutoken) and SSH keys.
|
|
240
|
-
- `ttl` —
|
|
241
|
-
-
|
|
241
|
+
- `ttl` — passphrase/PIN lifetime in ssh-agent (e.g., `1h`).
|
|
242
|
+
- Password authentication is supported but does not use ssh-agent and has no TTL support.
|
|
242
243
|
- Symbolic links are not transferred — should be created on the controller manually.
|
|
244
|
+
- `--dry-run` mode: shows changes without applying.
|
|
243
245
|
|
|
244
246
|
</details>
|
|
245
247
|
|
|
@@ -249,6 +251,8 @@ Synchronizes files with Wiren Board controllers via `rsync` over SSH.
|
|
|
249
251
|
- `--profile`, `-p <name>` — deployment profile (default: `default`).
|
|
250
252
|
- `--to <conn>` — override connection string.
|
|
251
253
|
- `--dry-run` — simulate synchronization.
|
|
254
|
+
- `--insecure` — disables security warnings.
|
|
255
|
+
|
|
252
256
|
Parameter `--to` accepts:
|
|
253
257
|
- Connection name from `mirta.config.json`,
|
|
254
258
|
- Connection string starting with `ssh://`.
|
package/README.ru.md
CHANGED
|
@@ -57,6 +57,7 @@ pnpm mirta deploy
|
|
|
57
57
|
- `--help` (`-h`) — отображает справку по доступным командам и параметрам.
|
|
58
58
|
- `--version` (`-v`) — выводит версию `@mirta/cli`.
|
|
59
59
|
- `--locale <loc>` — задаёт язык интерфейса (`en`, `ru`).
|
|
60
|
+
- `--debug` — включает режим отладки с подробным выводом логов.
|
|
60
61
|
|
|
61
62
|
### `pnpm mirta release`
|
|
62
63
|
|
|
@@ -90,7 +91,7 @@ pnpm mirta deploy
|
|
|
90
91
|
|
|
91
92
|
#### Поддерживаемые опции
|
|
92
93
|
|
|
93
|
-
`--dry-run`
|
|
94
|
+
`--dry-run` — симуляция без применения изменений.
|
|
94
95
|
|
|
95
96
|
`--preid` `<id>` — кастомный префикс преверсии (`alpha.0`, `beta.1`).
|
|
96
97
|
|
|
@@ -230,7 +231,7 @@ pnpm mirta release prerelease --preid alpha
|
|
|
230
231
|
|
|
231
232
|
#### Поддерживаемые опции
|
|
232
233
|
|
|
233
|
-
- `--dry-run`
|
|
234
|
+
- `--dry-run` — симуляция.
|
|
234
235
|
- `--skip-build` — пропускает `pnpm run build`.
|
|
235
236
|
- `--skip-git` — отключает git-проверки (аналог `--no-git-checks` в `pnpm publish`).
|
|
236
237
|
|
|
@@ -247,8 +248,9 @@ pnpm mirta release prerelease --preid alpha
|
|
|
247
248
|
- Поддержка WSL2: на Windows команды выполняются внутри WSL.
|
|
248
249
|
- Аутентификация:
|
|
249
250
|
- Через изолированный `ssh-agent`.
|
|
250
|
-
- Поддержка PKCS#11 (Rutoken) и SSH
|
|
251
|
-
- `ttl` — время жизни
|
|
251
|
+
- Поддержка PKCS#11 (Rutoken) и SSH-ключей (с парольной фразой или без неё).
|
|
252
|
+
- `ttl` — время жизни парольной фразы/PIN в ssh-agent (например, `1h`).
|
|
253
|
+
- Парольная аутентификация поддерживается, но не использует ssh-agent и не поддерживает TTL.
|
|
252
254
|
- Режим `--dry-run`: показывает изменения без применения.
|
|
253
255
|
- Симлинки не передаются.
|
|
254
256
|
|
|
@@ -260,6 +262,7 @@ pnpm mirta release prerelease --preid alpha
|
|
|
260
262
|
- `--profile`, `-p <name>` — профиль деплоя (по умолчанию: `default`).
|
|
261
263
|
- `--to <conn>` — переопределение подключения.
|
|
262
264
|
- `--dry-run` — симуляция синхронизации.
|
|
265
|
+
- `--insecure` — отключает предупреждения безопасности.
|
|
263
266
|
|
|
264
267
|
Параметр `--to` принимает:
|
|
265
268
|
- Название подключения из файла конфигурации `mirta.config.json`,
|
package/dist/deploy.mjs
CHANGED
|
@@ -368,6 +368,9 @@ const options = ({
|
|
|
368
368
|
'to': {
|
|
369
369
|
type: 'string',
|
|
370
370
|
},
|
|
371
|
+
'insecure': {
|
|
372
|
+
type: 'boolean',
|
|
373
|
+
},
|
|
371
374
|
// Deprecated. Use 'dry-run' instead
|
|
372
375
|
'dry': {
|
|
373
376
|
type: 'boolean',
|
|
@@ -849,27 +852,23 @@ async function authenticateAsync(connection) {
|
|
|
849
852
|
* @since 0.4.0
|
|
850
853
|
*
|
|
851
854
|
**/
|
|
852
|
-
async function hasRemoteGroupAsync(group, connection) {
|
|
855
|
+
async function hasRemoteGroupAsync(group, connection, isPasswordAuth) {
|
|
853
856
|
const { hostname, username, port } = connection;
|
|
854
857
|
const args = [];
|
|
855
858
|
if (port)
|
|
856
859
|
args.push('-p', String(port));
|
|
857
860
|
args.push(`${username}@${hostname}`, `getent group ${group} > /dev/null 2>&1`);
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
catch (e) {
|
|
870
|
-
logger.warn(e instanceof Error ? e.message : String(e));
|
|
871
|
-
return false;
|
|
872
|
-
}
|
|
861
|
+
const result = await runCommandAsync.inUnixShell(connection.wsl)('ssh', args, {
|
|
862
|
+
env: {
|
|
863
|
+
SSH_AUTH_SOCK,
|
|
864
|
+
},
|
|
865
|
+
stdio: isPasswordAuth
|
|
866
|
+
? STDIO_INTERACTIVE
|
|
867
|
+
: STDIO_CAPTURE_ERRORS,
|
|
868
|
+
doneCodes: [0, 2],
|
|
869
|
+
cancelCodes: [130],
|
|
870
|
+
});
|
|
871
|
+
return result.code === 0;
|
|
873
872
|
}
|
|
874
873
|
|
|
875
874
|
/**
|
|
@@ -1011,14 +1010,21 @@ async function runAsync(args) {
|
|
|
1011
1010
|
}));
|
|
1012
1011
|
// Аутентификация через ssh-agent (PKCS#11 или ключ).
|
|
1013
1012
|
await authenticateAsync(connection);
|
|
1013
|
+
const isPasswordAuth = !connection.key && !connection.pkcs11;
|
|
1014
|
+
const allowInsecure = argv.insecure;
|
|
1015
|
+
if (isPasswordAuth && !allowInsecure)
|
|
1016
|
+
logger.warn([
|
|
1017
|
+
t('connection.useKeyAuth') + '\n',
|
|
1018
|
+
'https://wiki.wirenboard.com/wiki/SSH\n',
|
|
1019
|
+
]);
|
|
1014
1020
|
if (!profile.toGroup) {
|
|
1015
1021
|
// Если группа не указана явно,
|
|
1016
1022
|
// то проверяем наличие рекомендуемой группы.
|
|
1017
|
-
const isGroupExists = await hasRemoteGroupAsync(RECOMMENDED_GROUP, connection);
|
|
1023
|
+
const isGroupExists = await hasRemoteGroupAsync(RECOMMENDED_GROUP, connection, isPasswordAuth);
|
|
1018
1024
|
if (isGroupExists) {
|
|
1019
1025
|
profile.toGroup = RECOMMENDED_GROUP;
|
|
1020
1026
|
}
|
|
1021
|
-
else {
|
|
1027
|
+
else if (!allowInsecure) {
|
|
1022
1028
|
// Если группы на контроллере нет,
|
|
1023
1029
|
// то выводим рекомендацию использовать отдельную группу.
|
|
1024
1030
|
logger.warn(t('deploy.useDedicatedGroup', { group: RECOMMENDED_GROUP }));
|
package/dist/index.mjs
CHANGED
|
@@ -616,7 +616,7 @@ async function assertWorkflowResultAsync(repository, name) {
|
|
|
616
616
|
|
|
617
617
|
const { dim, yellow } = chalk;
|
|
618
618
|
const helpMessageEn = `\
|
|
619
|
-
Performs operations over
|
|
619
|
+
Performs operations over projects powered by the Mirta Framework.
|
|
620
620
|
|
|
621
621
|
${yellow('Usage:')}
|
|
622
622
|
mirta [command] [options...]
|
|
@@ -626,16 +626,20 @@ ${yellow('Global flags:')}
|
|
|
626
626
|
${dim('Displays help information about available commands and options.')}
|
|
627
627
|
--version, -v
|
|
628
628
|
${dim('Prints the version of this CLI utility.')}
|
|
629
|
+
--dry-run
|
|
630
|
+
${dim('Runs the command in simulation mode. Does not apply changes.')}
|
|
631
|
+
--debug
|
|
632
|
+
${dim('Enables debug mode with detailed logging output.')}
|
|
629
633
|
|
|
630
634
|
${yellow('Commands:')}
|
|
631
635
|
release
|
|
632
636
|
${dim('Increase package versions following semantic versioning rules.')}
|
|
633
637
|
publish
|
|
634
638
|
${dim('Builds and publishes packages to npm registry.')}
|
|
639
|
+
deploy
|
|
640
|
+
${dim('Deploy project files to Wiren Board controller.')}
|
|
635
641
|
|
|
636
642
|
${yellow(`Options for 'release':`)}
|
|
637
|
-
--dry-run, --dry
|
|
638
|
-
${dim('Runs the command in simulation mode. Shows what would change but does not apply modifications.')}
|
|
639
643
|
--preid <id>
|
|
640
644
|
${dim('Sets a custom pre-release identifier (e.g., `alpha`, `beta.1`, `rc`).')}
|
|
641
645
|
--skip-prompts
|
|
@@ -644,15 +648,23 @@ ${yellow(`Options for 'release':`)}
|
|
|
644
648
|
${dim('Disables creating a commit and tag. Git changes remain uncommitted.')}
|
|
645
649
|
|
|
646
650
|
${yellow(`Options for 'publish':`)}
|
|
647
|
-
--dry-run, --dry
|
|
648
|
-
${dim('Runs in simulation mode. Shows what would happen, but does not publish')}
|
|
649
651
|
--skip-build
|
|
650
652
|
${dim('Skips running `pnpm run build` before publishing.')}
|
|
651
653
|
--skip-git
|
|
652
654
|
${dim('Disables git state checks (equivalent to `--no-git-checks` in `pnpm publish`).')}
|
|
655
|
+
|
|
656
|
+
${yellow(`Options for 'deploy':`)}
|
|
657
|
+
--profile <name>, -p
|
|
658
|
+
${dim('Use specified deploy profile.')}
|
|
659
|
+
--to <connection>
|
|
660
|
+
${dim('Override connection string from profile.')}
|
|
661
|
+
--config <path>, -c
|
|
662
|
+
${dim('Use custom configuration file.')}
|
|
663
|
+
--insecure
|
|
664
|
+
${dim('Disable security warnings.')}
|
|
653
665
|
`;
|
|
654
666
|
const helpMessageRu = `\
|
|
655
|
-
Выполняет операции над
|
|
667
|
+
Выполняет операции над проектами, работающими на базе фреймворка Mirta.
|
|
656
668
|
|
|
657
669
|
${yellow('Использование:')}
|
|
658
670
|
mirta [command] [options...]
|
|
@@ -668,24 +680,34 @@ ${yellow('Общие флаги:')}
|
|
|
668
680
|
${dim('Отображает справку по доступным командам и параметрам.')}
|
|
669
681
|
--version, -v
|
|
670
682
|
${dim('Выводит версию данной утилиты.')}
|
|
683
|
+
--dry-run
|
|
684
|
+
${dim('Режим симуляции. Показывает изменения, но не применяет их.')}
|
|
685
|
+
--debug
|
|
686
|
+
${dim('Включает режим отладки с подробным выводом логов.')}
|
|
671
687
|
|
|
672
688
|
${yellow(`Опции для 'release':`)}
|
|
673
|
-
--dry-run, --dry
|
|
674
|
-
${dim('Запускает команду в режиме симуляции. Показывает изменения, но не применяет их.')}
|
|
675
689
|
--preid <id>
|
|
676
|
-
${dim('Задаёт кастомный префикс
|
|
690
|
+
${dim('Задаёт кастомный префикс преверсии (например, `alpha`, `beta.1`, `rc`).')}
|
|
677
691
|
--skip-prompts
|
|
678
692
|
${dim('Пропускает интерактивные запросы. Используются значения по умолчанию.')}
|
|
679
693
|
--skip-git
|
|
680
694
|
${dim('Не создаёт коммит и тег. Git-изменения остаются в рабочей директории.')}
|
|
681
695
|
|
|
682
696
|
${yellow(`Опции для 'publish':`)}
|
|
683
|
-
--dry-run, --dry
|
|
684
|
-
${dim('Запускает команду в режиме симуляции. Показывает изменения, но не применяет их.')}
|
|
685
697
|
--skip-build
|
|
686
698
|
${dim('Пропускает выполнение `pnpm run build` перед публикацией')}
|
|
687
699
|
--skip-git
|
|
688
700
|
${dim('Отключает проверки git-состояния (аналог `--no-git-checks` в `pnpm publish`)')}
|
|
701
|
+
|
|
702
|
+
${yellow(`Опции для 'deploy':`)}
|
|
703
|
+
--profile <name>, -p
|
|
704
|
+
${dim('Использовать указанный профиль деплоя.')}
|
|
705
|
+
--to <connection>
|
|
706
|
+
${dim('Переопределить строку подключения из профиля.')}
|
|
707
|
+
--config <path>, -c
|
|
708
|
+
${dim('Использовать кастомный файл конфигурации.')}
|
|
709
|
+
--insecure
|
|
710
|
+
${dim('Отключить предупреждения безопасности.')}
|
|
689
711
|
`;
|
|
690
712
|
const getHelpMessage = () => getLocale() === 'ru-RU'
|
|
691
713
|
? helpMessageRu
|
package/locales/en-US.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"step.canceled": "Operation canceled",
|
|
17
17
|
"connection.emptyParameterSkipped": "Empty connection parameter '{key}' skipped",
|
|
18
18
|
"connection.ttlSkipped": "TTL parameter skipped — no pkcs11 or key specified",
|
|
19
|
+
"connection.useKeyAuth": "Use key-based authentication for better security",
|
|
19
20
|
"package.templateOutsideRoot": "Template '{template}' is outside the root directory",
|
|
20
21
|
"release.versionUpdated": "Version updated to {newVersion}",
|
|
21
22
|
"release.versionReverting": "Release canceled. Reverting version...",
|
package/locales/ru-RU.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"step.canceled": "Операция отменена",
|
|
17
17
|
"connection.emptyParameterSkipped": "Пустой параметр подключения '{key}' пропущен",
|
|
18
18
|
"connection.ttlSkipped": "Параметр TTL пропущен — не указаны PKCS#11 или ключ",
|
|
19
|
+
"connection.useKeyAuth": "Используйте подключение к SSH по ключу для повышения безопасности",
|
|
19
20
|
"package.templateOutsideRoot": "Пропуск шаблона {template} — вне корневой директории",
|
|
20
21
|
"release.versionUpdated": "Версия обновлена до {newVersion}",
|
|
21
22
|
"release.versionReverting": "Релиз отменён. Откат версии...",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirta/cli",
|
|
3
3
|
"description": "🛠️ Mirta Framework - the CLI",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.9",
|
|
5
5
|
"license": "Unlicense",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"prompts": "^2.4.2",
|
|
52
52
|
"semver": "^7.7.3",
|
|
53
53
|
"jsonc-parser": "^3.3.1",
|
|
54
|
-
"@mirta/basics": "0.4.
|
|
55
|
-
"@mirta/
|
|
56
|
-
"@mirta/
|
|
57
|
-
"@mirta/
|
|
58
|
-
"@mirta/
|
|
59
|
-
"@mirta/workspace": "0.4.
|
|
54
|
+
"@mirta/basics": "0.4.9",
|
|
55
|
+
"@mirta/package": "0.4.9",
|
|
56
|
+
"@mirta/i18n": "0.4.9",
|
|
57
|
+
"@mirta/staged-args": "0.4.9",
|
|
58
|
+
"@mirta/env-loader": "0.4.9",
|
|
59
|
+
"@mirta/workspace": "0.4.9"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/semver": "^7.7.1"
|