cdd-cli 4.0.0 → 4.2.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.
Files changed (135) hide show
  1. package/README.es.md +60 -26
  2. package/README.md +60 -26
  3. package/dist/App.js +1 -0
  4. package/dist/components/ContainerCreationPrompt.js +14 -0
  5. package/dist/components/PromptField.js +13 -6
  6. package/dist/components/TextField.js +54 -0
  7. package/dist/components/UsageMenu.js +1 -1
  8. package/dist/helpers/appState.js +26 -0
  9. package/dist/helpers/dockerService/serviceComponents/containerExec.js +211 -0
  10. package/dist/helpers/textEditing.js +293 -0
  11. package/dist/hooks/creation/useContainerCreation.js +132 -15
  12. package/dist/hooks/useContainerCommandRouter.js +12 -2
  13. package/dist/hooks/useControls.js +21 -26
  14. package/dist/hooks/useShellMode.js +101 -0
  15. package/dist/index.js +3 -1
  16. package/package.json +4 -1
  17. package/.atl/skill-registry.md +0 -30
  18. package/.editorconfig +0 -12
  19. package/.eslintrc.json +0 -30
  20. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  21. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
  22. package/.github/PULL_REQUEST_TEMPLATE/pull_request.md +0 -14
  23. package/.github/workflows/ci.yml +0 -32
  24. package/.github/workflows/docs.yml +0 -42
  25. package/.prettierignore +0 -4
  26. package/.prettierrc +0 -8
  27. package/.~lock.ROADMAP.md# +0 -1
  28. package/CHANGELOG.md +0 -216
  29. package/CODE_OF_CONDUCT.md +0 -12
  30. package/CONTRIBUTING.md +0 -35
  31. package/ROADMAP.md +0 -647
  32. package/SECURITY.md +0 -5
  33. package/__mocks__/ink.cjs +0 -17
  34. package/_config.yml +0 -13
  35. package/babel.config.cjs +0 -23
  36. package/coverage/clover.xml +0 -575
  37. package/coverage/coverage-final.json +0 -17
  38. package/coverage/lcov-report/ContainerCreationPrompt.jsx.html +0 -400
  39. package/coverage/lcov-report/ControlsHUD.jsx.html +0 -256
  40. package/coverage/lcov-report/base.css +0 -224
  41. package/coverage/lcov-report/block-navigation.js +0 -87
  42. package/coverage/lcov-report/components/ContainerCreationPrompt.jsx.html +0 -394
  43. package/coverage/lcov-report/components/PromptField.jsx.html +0 -229
  44. package/coverage/lcov-report/components/SuggestionPanel.jsx.html +0 -268
  45. package/coverage/lcov-report/components/index.html +0 -146
  46. package/coverage/lcov-report/favicon.png +0 -0
  47. package/coverage/lcov-report/helpers/constants.js.html +0 -352
  48. package/coverage/lcov-report/helpers/containerOptionsBuilder.js.html +0 -244
  49. package/coverage/lcov-report/helpers/dockerHubService.js.html +0 -310
  50. package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerActions.js.html +0 -931
  51. package/coverage/lcov-report/helpers/dockerService/serviceComponents/containerList.js.html +0 -307
  52. package/coverage/lcov-report/helpers/dockerService/serviceComponents/index.html +0 -131
  53. package/coverage/lcov-report/helpers/imageNameUtils.js.html +0 -181
  54. package/coverage/lcov-report/helpers/index.html +0 -206
  55. package/coverage/lcov-report/helpers/logger.js.html +0 -424
  56. package/coverage/lcov-report/helpers/safeCall.js.html +0 -139
  57. package/coverage/lcov-report/helpers/validationHelpers.js.html +0 -346
  58. package/coverage/lcov-report/hooks/creation/index.html +0 -146
  59. package/coverage/lcov-report/hooks/creation/useContainerActions.js.html +0 -313
  60. package/coverage/lcov-report/hooks/creation/useContainerCreation.js.html +0 -982
  61. package/coverage/lcov-report/hooks/creation/useLogsViewer.js.html +0 -238
  62. package/coverage/lcov-report/hooks/debug/index.html +0 -116
  63. package/coverage/lcov-report/hooks/debug/useDebugLogs.js.html +0 -187
  64. package/coverage/lcov-report/hooks/index.html +0 -161
  65. package/coverage/lcov-report/hooks/navigation/index.html +0 -116
  66. package/coverage/lcov-report/hooks/navigation/useContainerSelection.js.html +0 -169
  67. package/coverage/lcov-report/hooks/useContainerCommandRouter.js.html +0 -454
  68. package/coverage/lcov-report/hooks/useControls.js.html +0 -868
  69. package/coverage/lcov-report/hooks/useEraseConfirmation.js.html +0 -202
  70. package/coverage/lcov-report/hooks/useExitHandler.js.html +0 -292
  71. package/coverage/lcov-report/index.html +0 -176
  72. package/coverage/lcov-report/prettify.css +0 -1
  73. package/coverage/lcov-report/prettify.js +0 -2
  74. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  75. package/coverage/lcov-report/sorter.js +0 -210
  76. package/coverage/lcov.info +0 -1163
  77. package/fix-imports.cjs +0 -54
  78. package/jest.config.cjs +0 -14
  79. package/src/App.jsx +0 -102
  80. package/src/components/ContainerCreationPrompt.jsx +0 -107
  81. package/src/components/ContainerList.jsx +0 -32
  82. package/src/components/ContainerRow.jsx +0 -84
  83. package/src/components/ContainerSection.jsx +0 -24
  84. package/src/components/ControlsHUD.jsx +0 -66
  85. package/src/components/Footer.jsx +0 -15
  86. package/src/components/Header.jsx +0 -41
  87. package/src/components/LogViewer.jsx +0 -36
  88. package/src/components/MessageFeedback.jsx +0 -25
  89. package/src/components/PromptField.jsx +0 -48
  90. package/src/components/StatsBar.jsx +0 -70
  91. package/src/components/SuggestionPanel.jsx +0 -61
  92. package/src/components/UsageMenu.jsx +0 -52
  93. package/src/helpers/appInfo.js +0 -23
  94. package/src/helpers/constants.js +0 -89
  95. package/src/helpers/containerOptionsBuilder.js +0 -53
  96. package/src/helpers/dockerHubService.js +0 -75
  97. package/src/helpers/dockerService/dockerService.js +0 -28
  98. package/src/helpers/dockerService/serviceComponents/containerActions.js +0 -282
  99. package/src/helpers/dockerService/serviceComponents/containerList.js +0 -74
  100. package/src/helpers/dockerService/serviceComponents/containerLogs.js +0 -60
  101. package/src/helpers/dockerService/serviceComponents/containerStats.js +0 -69
  102. package/src/helpers/dockerService/serviceComponents/imageUtils.js +0 -32
  103. package/src/helpers/exitWithMessage.js +0 -32
  104. package/src/helpers/imageNameUtils.js +0 -32
  105. package/src/helpers/logger.js +0 -112
  106. package/src/helpers/safeCall.js +0 -18
  107. package/src/helpers/validationHelpers.js +0 -87
  108. package/src/hooks/creation/useContainerActions.js +0 -89
  109. package/src/hooks/creation/useContainerCreation.js +0 -377
  110. package/src/hooks/creation/useLogsViewer.js +0 -51
  111. package/src/hooks/debug/useDebugLogs.js +0 -34
  112. package/src/hooks/navigation/useContainerSelection.js +0 -28
  113. package/src/hooks/useContainerCommandRouter.js +0 -123
  114. package/src/hooks/useContainerStats.js +0 -44
  115. package/src/hooks/useContainers.js +0 -26
  116. package/src/hooks/useControls.js +0 -263
  117. package/src/hooks/useEraseConfirmation.js +0 -39
  118. package/src/hooks/useExitHandler.js +0 -69
  119. package/src/index.js +0 -20
  120. package/test/ContainerCreationPrompt.dom.test.js +0 -313
  121. package/test/ControlsHUD.dom.test.js +0 -125
  122. package/test/SuggestionPanel.dom.test.js +0 -83
  123. package/test/constants.test.js +0 -41
  124. package/test/containerActions.test.js +0 -229
  125. package/test/containerList.test.js +0 -79
  126. package/test/containerOptionsBuilder.test.js +0 -36
  127. package/test/dockerHubService.test.js +0 -213
  128. package/test/jest.setup.js +0 -7
  129. package/test/logger.test.js +0 -58
  130. package/test/resolveImageTag.test.js +0 -26
  131. package/test/safeCall.test.js +0 -25
  132. package/test/useContainerCreation.dom.test.js +0 -567
  133. package/test/useContainerCreationHub.dom.test.js +0 -184
  134. package/test/useControls.dom.test.js +0 -519
  135. package/test/validationHelpers.test.js +0 -111
@@ -0,0 +1,101 @@
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
3
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
4
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5
+ import React from 'react';
6
+ import { render } from 'ink';
7
+ import { execInteractive, detectShell } from '../helpers/dockerService/serviceComponents/containerExec.js';
8
+ import { getInkApp, setInkApp } from '../helpers/appState.js';
9
+ import App from '../App.js';
10
+ import { logger } from '../helpers/logger.js';
11
+
12
+ /**
13
+ * Open an interactive shell inside a Docker container.
14
+ * Unmounts Ink, spawns `docker exec -it`, and re-renders the app on exit.
15
+ *
16
+ * @param {Object} container - Container object from Docker
17
+ * @returns {Promise<void>}
18
+ */
19
+ function openShell(_x) {
20
+ return _openShell.apply(this, arguments);
21
+ }
22
+ /**
23
+ * Hook that provides the shell mode API.
24
+ * In practice, the heavy lifting (unmount/spawn/remount) is handled by
25
+ * `openShell` outside the React tree. This hook just exposes a stable
26
+ * reference for useControls.
27
+ *
28
+ * @returns {{ openShell: Function }}
29
+ */
30
+ function _openShell() {
31
+ _openShell = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(container) {
32
+ var isRunning, containerId, containerName, inkApp, shell, newApp, _t;
33
+ return _regenerator().w(function (_context) {
34
+ while (1) switch (_context.p = _context.n) {
35
+ case 0:
36
+ if (container) {
37
+ _context.n = 1;
38
+ break;
39
+ }
40
+ return _context.a(2);
41
+ case 1:
42
+ isRunning = container.state === 'running' || container.status === 'running';
43
+ if (isRunning) {
44
+ _context.n = 2;
45
+ break;
46
+ }
47
+ logger.warn('Cannot open shell: container %s is not running', container.name);
48
+ return _context.a(2);
49
+ case 2:
50
+ containerId = container.id;
51
+ containerName = container.name || containerId.slice(0, 12); // Unmount Ink to release the terminal
52
+ inkApp = getInkApp();
53
+ if (inkApp && typeof inkApp.unmount === 'function') {
54
+ inkApp.unmount();
55
+ }
56
+
57
+ // Clear the screen for a clean shell experience
58
+ if (process.stdout && process.stdout.isTTY) {
59
+ process.stdout.write("\x1Bc");
60
+ }
61
+ _context.p = 3;
62
+ _context.n = 4;
63
+ return detectShell(containerId);
64
+ case 4:
65
+ shell = _context.v;
66
+ process.stdout.write("\x1B[36m[shell]\x1B[0m Opening ".concat(shell, " in ").concat(containerName, " (").concat(containerId.slice(0, 12), ")...\r\n"));
67
+ process.stdout.write('\x1b[33mType "exit" or press Ctrl+D to return to CDD.\x1b[0m\r\n\r\n');
68
+ _context.n = 5;
69
+ return execInteractive(containerId, {
70
+ shell: shell
71
+ });
72
+ case 5:
73
+ _context.n = 7;
74
+ break;
75
+ case 6:
76
+ _context.p = 6;
77
+ _t = _context.v;
78
+ process.stdout.write("\x1B[31m[shell] Error: ".concat(_t.message, "\x1B[0m\r\n"));
79
+ logger.error('Shell mode error', _t);
80
+ case 7:
81
+ _context.n = 8;
82
+ return new Promise(function (r) {
83
+ return setTimeout(r, 100);
84
+ });
85
+ case 8:
86
+ // Re-render the app
87
+ console.clear();
88
+ newApp = render(/*#__PURE__*/React.createElement(App, null));
89
+ setInkApp(newApp);
90
+ case 9:
91
+ return _context.a(2);
92
+ }
93
+ }, _callee, null, [[3, 6]]);
94
+ }));
95
+ return _openShell.apply(this, arguments);
96
+ }
97
+ export function useShellMode() {
98
+ return {
99
+ openShell: openShell
100
+ };
101
+ }
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ import React from 'react';
11
11
  import { render } from 'ink';
12
12
  import App from './App.js';
13
13
  import { logger } from './helpers/logger.js';
14
+ import { setInkApp } from './helpers/appState.js';
14
15
  process.on('uncaughtException', function (err) {
15
16
  return logger.error('Uncaught exception', err);
16
17
  });
@@ -18,4 +19,5 @@ process.on('unhandledRejection', function (reason) {
18
19
  return logger.error('Unhandled rejection', reason);
19
20
  });
20
21
  console.clear();
21
- render(/*#__PURE__*/React.createElement(App, null));
22
+ var inkApp = render(/*#__PURE__*/React.createElement(App, null));
23
+ setInkApp(inkApp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdd-cli",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "CLI Docker Dashboard",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,6 +16,9 @@
16
16
  "author": "",
17
17
  "license": "ISC",
18
18
  "type": "module",
19
+ "files": [
20
+ "dist"
21
+ ],
19
22
  "dependencies": {
20
23
  "chalk": "^5.6.2",
21
24
  "dockerode": "^4.0.9",
@@ -1,30 +0,0 @@
1
- # Skill Registry — CDD
2
-
3
- Generated: 2026-04-25
4
-
5
- ## User Skills (from ~/.config/opencode/skills/)
6
-
7
- | Skill | Trigger |
8
- |-------|---------|
9
- | branch-pr | Creating a pull request, opening a PR, or preparing changes for review |
10
- | go-testing | Writing Go tests, using teatest, or adding test coverage |
11
- | issue-creation | Creating a GitHub issue, reporting a bug, or requesting a feature |
12
- | judgment-day | "judgment day", "review adversarial", "dual review", "juzgar", "que lo juzguen" |
13
- | reporter | Creating a sprint report, updating CHANGELOG, or documenting completed work |
14
- | sdd-apply | Orchestrator launches to implement one or more tasks from a change |
15
- | sdd-archive | Orchestrator launches to archive a change after implementation and verification |
16
- | sdd-design | Orchestrator launches to write or update the technical design for a change |
17
- | sdd-explore | Orchestrator launches to think through a feature, investigate the codebase, or clarify requirements |
18
- | sdd-propose | Orchestrator launches to create or update a proposal for a change |
19
- | sdd-spec | Orchestrator launches to write or update specs for a change |
20
- | sdd-tasks | Orchestrator launches to create or update the task breakdown for a change |
21
- | sdd-verify | Orchestrator launches to verify a completed change |
22
- | skill-creator | Creating a new skill, adding agent instructions, or documenting patterns for AI |
23
- | skill-registry | "update skills", "skill registry", "actualizar skills", "update registry" |
24
-
25
- ## Project Conventions
26
-
27
- - No project-level AGENTS.md / CLAUDE.md / .cursorrules found
28
- - ESLint config: `.eslintrc.json` (eslint:recommended + plugin:react/recommended)
29
- - No Prettier config detected — formatting via Babel only
30
- - No TypeScript (plain JS/JSX with Babel)
package/.editorconfig DELETED
@@ -1,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
package/.eslintrc.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "node": true,
5
- "es2021": true,
6
- "jest": true
7
- },
8
- "extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
9
- "parserOptions": {
10
- "ecmaVersion": 2021,
11
- "sourceType": "module",
12
- "ecmaFeatures": { "jsx": true }
13
- },
14
- "rules": {
15
- "no-unsafe-optional-chaining": "error",
16
- "react/react-in-jsx-scope": "off",
17
- "no-console": "off",
18
- "react/prop-types": "warn",
19
- "no-unused-vars": [
20
- "warn",
21
- {
22
- "argsIgnorePattern": "^_",
23
- "varsIgnorePattern": "^(?:_|React)$"
24
- }
25
- ]
26
- },
27
- "settings": {
28
- "react": { "version": "detect" }
29
- }
30
- }
@@ -1,30 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: bug
6
- assignees: ''
7
- ---
8
-
9
- **Describe the bug**
10
- A clear and concise description of what the bug is.
11
-
12
- **To Reproduce**
13
- Steps to reproduce the behavior:
14
- 1. Go to '...'
15
- 2. Run '...'
16
- 3. See error
17
-
18
- **Expected behavior**
19
- A clear and concise description of what you expected to happen.
20
-
21
- **Screenshots or logs**
22
- If applicable, add screenshots or logs to help explain your problem.
23
-
24
- **Environment (please complete the following information):**
25
- - OS: (e.g. Ubuntu 22.04)
26
- - Node version: (e.g. 18.x)
27
- - cdd-cli version: (e.g. 3.1.0)
28
-
29
- **Additional context**
30
- Add any other context about the problem here.
@@ -1,19 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: enhancement
6
- assignees: ''
7
- ---
8
-
9
- **Is your feature request related to a problem? Please describe.**
10
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11
-
12
- **Describe the solution you'd like**
13
- A clear and concise description of what you want to happen.
14
-
15
- **Describe alternatives you've considered**
16
- A clear and concise description of any alternative solutions or features you've considered.
17
-
18
- **Additional context**
19
- Add any other context or screenshots about the feature request here.
@@ -1,14 +0,0 @@
1
- <!-- Please replace the placeholders and remove this comment -->
2
- ## Summary
3
-
4
- What does this PR change and why?
5
-
6
- ## Checklist
7
-
8
- - [ ] I have read the contributing guidelines
9
- - [ ] Tests added / updated
10
- - [ ] Documentation updated
11
-
12
- ## Related issues
13
-
14
- Closes: # (issue)
@@ -1,32 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
-
9
- jobs:
10
- test-and-build:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Checkout repository
14
- uses: actions/checkout@v4
15
-
16
- - name: Setup Node.js
17
- uses: actions/setup-node@v4
18
- with:
19
- node-version: '18'
20
- cache: 'npm'
21
-
22
- - name: Install dependencies
23
- run: npm ci
24
-
25
- - name: Lint
26
- run: npm run lint
27
-
28
- - name: Run tests
29
- run: npm test
30
-
31
- - name: Build
32
- run: npm run build
@@ -1,42 +0,0 @@
1
- name: Build and deploy docs
2
-
3
- on:
4
- workflow_run:
5
- workflows: ["CI"]
6
- types:
7
- - completed
8
- branches:
9
- - main
10
-
11
- jobs:
12
- build-and-deploy:
13
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
14
- runs-on: ubuntu-latest
15
- permissions:
16
- contents: write
17
- pages: write
18
- id-token: write
19
-
20
- steps:
21
- - name: Checkout repository
22
- uses: actions/checkout@v4
23
-
24
- - name: Setup Node.js
25
- uses: actions/setup-node@v4
26
- with:
27
- node-version: '18'
28
-
29
- - name: Install dependencies
30
- run: npm ci
31
-
32
- - name: Build docs
33
- run: npm run docs
34
-
35
- - name: Ensure .nojekyll
36
- run: mkdir -p docs && touch docs/.nojekyll
37
-
38
- - name: Deploy to GitHub Pages (push to gh-pages)
39
- uses: peaceiris/actions-gh-pages@v3
40
- with:
41
- github_token: ${{ secrets.GITHUB_TOKEN }}
42
- publish_dir: ./docs
package/.prettierignore DELETED
@@ -1,4 +0,0 @@
1
- node_modules/
2
- dist/
3
- coverage/
4
- *.cjs
package/.prettierrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "semi": true,
3
- "singleQuote": true,
4
- "trailingComma": "es5",
5
- "printWidth": 80,
6
- "tabWidth": 2,
7
- "arrowParens": "always"
8
- }
@@ -1 +0,0 @@
1
- ,caertos,Cocheroc,28.04.2026 21:42,/home/caertos/.local/share/onlyoffice;
package/CHANGELOG.md DELETED
@@ -1,216 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
-
7
- ## [Unreleased]
8
- - Nothing yet.
9
-
10
- ## [4.0.0] - 2026-04-28
11
-
12
- ### 🎉 Major release — Guided creation wizard
13
-
14
- This release transforms CDD from a monitoring dashboard into a fully guided container creation experience. The wizard now knows what images need, searches Docker Hub live, and automates the tedious parts.
15
-
16
- ### Added
17
- - **Interactive creation wizard** (`C` to open):
18
- - 20 curated image profiles with offline autocomplete (↑↓ to navigate, Enter to select)
19
- - `[Tab]` on image field searches Docker Hub live — race-condition safe (AbortController + requestId)
20
- - `[searching Docker Hub...]` loading indicator in suggestion panel
21
- - Hub results replace static suggestions; typing reverts to local list instantly
22
- - `[Tab]` on env vars field inserts next suggested `KEY=VALUE` from the image profile
23
- - Context-sensitive controls HUD — shows available keys at every step
24
- - **Smart default tags** — no more `:latest` failures:
25
- - `postgres:17-alpine`, `redis:7-alpine`, `nginx:1.27-alpine`, `mysql:8.0`, and 16 more
26
- - `resolveImageTag()` pure helper — preserves explicit user tags, applies profile default otherwise
27
- - **Required env vars included in suggestions** — `MYSQL_ROOT_PASSWORD`, `POSTGRES_PASSWORD`, `SA_PASSWORD`, etc. are now the first entries Tab inserts, so required fields are never missed
28
- - **Bilingual README** — English (`README.md`) and Spanish (`README.es.md`)
29
-
30
- ### Fixed
31
- - Images like `postgres`, `mysql`, `mariadb` no longer fail with 404 due to missing `:latest` tag
32
- - Required env vars were never suggested by Tab autocomplete — now always appear first
33
-
34
- ## [3.2.5] - 2026-04-27
35
-
36
- ### Added
37
- - Context-sensitive controls HUD in the creation wizard: shows available keys per step
38
- - Step 0: `[Tab] Search Hub · [↑↓] Browse · [Enter] Confirm · [Esc] Cancel`
39
- - Step 0 with suggestions: `[↑↓] Navigate · [Enter] Select · [Esc] Cancel`
40
- - Steps 1–3: `[Enter] Continue · [Esc] Cancel`
41
- - `ControlsHUD` component with pure `getHints(step, hasSuggestions, isSearchingHub)` function
42
-
43
- ## [3.2.4] - 2026-04-27
44
-
45
- ### Fixed
46
- - Images no longer default to `:latest` — each profile now ships a correct stable tag (e.g. `postgres:17-alpine`, `redis:7-alpine`, `nginx:1.27-alpine`)
47
- - Selecting an image suggestion or confirming step 0 auto-appends the correct tag when none is typed
48
-
49
- ### Added
50
- - `resolveImageTag(imageName)` pure helper — preserves explicit user tags, appends profile default otherwise
51
-
52
- ## [3.2.3] - 2026-04-27
53
-
54
- ### Added
55
- - Docker Hub live search: pressing Tab on image name field searches Docker Hub in real time
56
- - `searchDockerHub()` helper with AbortSignal.timeout(5000), race-condition guard (AbortController + requestId)
57
- - `formatHubResult()` formatter: `nginx [★ official] [1B+ pulls]`
58
- - `isSearchingHub` loading state with `[searching Docker Hub...]` indicator in SuggestionPanel
59
- - Hub results replace static suggestions; typing reverts immediately to static list
60
-
61
- ## [3.2.2] - 2026-04-27
62
-
63
- ### Added
64
-
65
- - Interactive suggestion panel in container creation wizard (step 0) — shows filtered image suggestions below the input as the user types, navigable with ↑↓ and selectable with Enter
66
- - `IMAGE_PROFILES` expanded from 6 to 20 curated images (nginx, node, python, postgres, mysql, mongo, redis, kafka, elasticsearch, minio, wordpress, and more) each with `requiredEnv`, `defaultPort`, and `suggestedEnv`
67
- - `SuggestionPanel` component (`src/components/SuggestionPanel.jsx`) — offline, non-overlay panel with scrollable window and focused-row highlight
68
- - Contextual env var hints in step 3 — when a known image is selected, suggested variables (e.g. `POSTGRES_USER`, `POSTGRES_DB`) are shown as guidance
69
- - `updateImageInput()`, `moveSuggestionSelection()`, `applyFocusedSuggestion()` functions in `useContainerCreation` hook for autocomplete state management
70
- - Ink mock infrastructure (`__mocks__/ink.cjs`) with `triggerInput` helper for reliable keyboard routing tests
71
-
72
- ### Changed
73
-
74
- - `useControls.js` keyboard routing — ↑↓ and Enter are conditionally intercepted for suggestion navigation only on step 0 when suggestions are visible; all other steps preserve existing behavior
75
- - `ContainerCreationPrompt.jsx` — renders `SuggestionPanel` below the image input field on step 0
76
-
77
- ## [3.2.1] - 2026-04-27
78
-
79
- ### Changed
80
-
81
- - Unified `normalizeImageName` into a single `src/helpers/imageNameUtils.js` module; removed duplicate definitions from `validationHelpers.js` and `containerActions.js`.
82
- - Added Prettier and EditorConfig for automatic code formatting enforcement; 37 source files reformatted to consistent style (single quotes, 2-space indent, trailing commas ES5).
83
- - Added `eslint-config-prettier` to disable ESLint rules that conflict with Prettier.
84
- - Added `format` and `format:check` npm scripts.
85
-
86
- ### Fixed
87
-
88
- - Missing `.jsx` extension on `import App from './App'` in `src/index.js` (ESM correctness).
89
-
90
- ## [3.2.0] - 2026-04-25
91
-
92
- ### Added
93
-
94
- - `IMAGE_PROFILES` map in `src/helpers/constants.js` — defines `requiredEnv` and `defaultPort` per image type (mysql, mariadb, postgres, mongo, mssql, redis).
95
- - `DB_IMAGES` constant exported from `src/helpers/constants.js`.
96
- - Contextual validation in wizard: if image matches a known profile, required env vars are enforced before creation.
97
- - Auto-assigned port feedback: after successful container creation, the success message shows which ports were mapped (e.g. `Ports: 3306→3306/tcp`).
98
- - Image name normalization: tags and registry prefixes are stripped before profile lookup (`mysql:8`, `docker.io/library/postgres:16` → `mysql`, `postgres`).
99
- - New test files: `test/containerOptionsBuilder.test.js`, `test/useControls.dom.test.js`.
100
-
101
- ### Fixed
102
-
103
- - `validateEnvVars()` was never called in the container creation wizard step 3 — now connected and blocks on invalid input.
104
- - Env var parsing split on all `=` characters — fixed to split only on the first `=`, preserving values like `JWT=abc=def`.
105
- - `dbImages` was hardcoded in `useControls.js` — now imports `DB_IMAGES` from constants.
106
-
107
- ## [3.1.9] - 2026-04-11
108
-
109
- ### Changed
110
-
111
- - CI: added lint step to the test-and-build job; docs deploy now waits for CI to pass successfully via `workflow_run` trigger.
112
-
113
- ## [3.1.8] - 2026-04-11
114
-
115
- ### Refactored
116
-
117
- - Removed dead code: `actionHelpers`, `useLogsStream`, and esbuild-related artifacts that were no longer in use.
118
- - Consolidated Babel configuration into a single env-aware file, eliminating duplicate/split config files.
119
- - Decomposed `useControls` god hook into focused single-responsibility hooks, each owning one concern.
120
- - Extracted `useContainerStats` hook from `ContainerRow` to separate data-fetching from rendering.
121
- - Set Jest default environment to `node`; `jsdom` is now opt-in per test file, reducing unnecessary DOM overhead.
122
-
123
- ### Changed
124
-
125
- - Removed generated JSDoc output from the repository; added the generated docs directory to `.gitignore`.
126
- - Enabled `react/prop-types` ESLint rule project-wide and resolved all resulting warnings.
127
- - Rewrote `README.md` and `CONTRIBUTING.md`: consolidated overlapping content, removed duplication, and updated both for accuracy.
128
- - Various `docs(style)` and `docs` commits between v3.1.5 and the refactor wave: dark theme, sticky nav, landing page rewrite, CSS consolidation, and English translation for the JSDoc home (GitHub Pages site).
129
-
130
- ## [3.1.5] - 2025-10-18
131
- _Note: I'm sorry about the issues you've run into; this is a brand-new app and I'm still learning, but I'm moving as quickly as I can to deliver a quality experience._
132
-
133
- ### Added
134
-
135
- - `safeCall` utility to safely invoke optional callbacks and avoid uncaught errors from consumer callbacks.
136
- - PropTypes added to core React components for runtime prop validation (ContainerRow, ContainerList, LogViewer, StatsBar, ContainerCreationPrompt, PromptField, MessageFeedback, Header, ContainerSection).
137
-
138
- ### Changed
139
-
140
- - Container creation now inspects image `EXPOSE` declarations and auto-binds ports when the user leaves the ports step empty, reusing the next free host port to avoid conflicts (e.g. second `nginx` gets `81:80`).
141
- - CLI clears the terminal when starting and again after exiting with `q` for a cleaner shell experience.
142
- - Replaced direct optional callback invocations and stream destruction calls with `safeCall` in several modules (`containerLogs`, `useLogsStream`, `useLogsViewer`, `useContainerCreation`, `useContainerActions`, `LogViewer`).
143
- - ESLint config updated to include `jest` env and allow keeping `import React` for build compatibility.
144
- - Extracted common magic numbers into `src/helpers/constants.js` and replaced hardcoded values across the codebase:
145
- - `REFRESH_INTERVALS.CONTAINER_LIST` (3000)
146
- - `REFRESH_INTERVALS.CONTAINER_STATS` (1500)
147
- - `MESSAGE_TIMEOUTS.SHORT` (2000) and `MESSAGE_TIMEOUTS.DEFAULT` (3000)
148
- - `EXIT_DELAY` (500)
149
- - `TIMEOUTS.CONTAINER_OP` (30000) and `TIMEOUTS.PULL_IMAGE` (300000)
150
- - Files updated to use constants: `useContainers`, `ContainerRow`, `actionHelpers`, `useControls`, `exitWithMessage`, `containerActions`.
151
-
152
- ### Fixed
153
-
154
- - Added unit tests for `safeCall` and adjusted several components to silence lint warnings (unused variables).
155
- - Clamp `StatsBar` CPU/memory percentages to avoid negative repeat errors when streaming container stats (also refreshed component JSDoc to note the clamping).
156
-
157
- ### Testing
158
-
159
- - Added additional unit tests for Docker service functions and hooks. All tests pass locally (5 suites, 26 tests).
160
- - Removed generated `dist/` artifacts and deleted obsolete test files that referenced incompatible test helpers.
161
-
162
- Incoming fixes and smaller tests / docs updates
163
-
164
- ## [3.1.4] - 2025-10-17
165
-
166
- ### Changed
167
-
168
- - Documentation cleanup: translate `FIXES_APPLIED.md` to English, remove Spanish duplicate and references to internal audit doc.
169
- - No functional code changes.
170
-
171
- ## [3.1.3] - 2025-10-17
172
-
173
- ### Fixed
174
-
175
- - Addressed critical security and stability issues identified in internal audit.
176
- - Improved Docker service components robustness (`containerActions`, `containerList`, `containerLogs`, `containerStats`).
177
- - Strengthened validation helpers and extended unit tests.
178
-
179
- ### Added
180
-
181
- - Documentation: `FIXES_APPLIED.md` summarizing analysis and mitigations.
182
-
183
- ### Changed
184
-
185
- - Minor code refactors and clarifications across components and hooks.
186
-
187
- ## [3.1.2] - 2025-10-16
188
-
189
- ### Changed
190
-
191
- - Docs cleanup: remove Spanish inline comments; add English JSDoc across source files.
192
-
193
- ## [3.1.0] - 2025-10-16
194
-
195
- ### Added
196
-
197
- - Modularized hooks: `useContainerCreation`, `useContainerActions`, `useLogsViewer`.
198
- - Validation helpers and unit tests for port validation.
199
- - CI workflow (GitHub Actions) and README improvements.
200
-
201
- ### Changed
202
-
203
- - Container creation UX: English feedback messages, mandatory/validated port input, DB image warnings.
204
- - Added erase action (key `E`) with confirmation to delete containers.
205
- - Normalized source imports to include explicit `.js`/`.jsx` extensions for ESM compatibility.
206
-
207
- ### Fixed
208
-
209
- - Various runtime & build issues after modularization (import fixes, exposing container action functions, creation flow wiring).
210
-
211
- ## [3.1.1] - 2025-10-16
212
-
213
- ### Fixed
214
-
215
- - Minor docs typo fixes and README global install note added.
216
-
@@ -1,12 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- This project follows the Contributor Covenant Code of Conduct. By participating, you agree to abide by its terms.
4
-
5
- Please see https://www.contributor-covenant.org/ for the full text.
6
- ## Code of Conduct
7
-
8
- This project follows the [Contributor Covenant](https://www.contributor-covenant.org/).
9
-
10
- Be respectful, inclusive, and kind. Harassment, discrimination, or abusive language will not be tolerated.
11
-
12
- If you experience or witness unacceptable behavior, please contact the maintainers.
package/CONTRIBUTING.md DELETED
@@ -1,35 +0,0 @@
1
- # Contributing to CDD-CLI
2
-
3
- Thanks for your interest in contributing! Here are the guidelines to make collaboration smooth.
4
-
5
- ## Getting started
6
-
7
- 1. Fork the repo and create a branch for your feature or fix:
8
-
9
- ```bash
10
- git checkout -b feat/my-feature
11
- ```
12
-
13
- 2. Install dependencies and verify everything works before making changes:
14
-
15
- ```bash
16
- npm install
17
- npm test
18
- npm run build
19
- ```
20
-
21
- ## Guidelines
22
-
23
- - Keep changes small and focused — one concern per PR.
24
- - Write tests for any new behavior and ensure existing tests pass (`npm test`).
25
- - Run `npm run build` and verify the CLI starts (`node dist/index.js`) before opening a PR.
26
- - Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages.
27
- - For large or design-changing contributions, open an issue first to discuss the approach.
28
-
29
- ## Opening a Pull Request
30
-
31
- - Describe the motivation and what changed.
32
- - Link any related issues.
33
- - Tag reviewers if applicable.
34
-
35
- We appreciate clear, well-tested contributions.