@lvnt/release-radar-cli 0.2.6 → 0.2.7

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/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import { readFileSync } from 'fs';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
2
5
  import { ConfigManager } from './config.js';
3
6
  import { DownloadTracker } from './tracker.js';
4
7
  import { loadVersions } from './versions.js';
@@ -6,6 +9,44 @@ import { checkAndUpdate } from './updater.js';
6
9
  import { downloadFile, updateNpmPackage } from './downloader.js';
7
10
  import { promptSetup, promptToolSelection } from './ui.js';
8
11
  import { isNpmTool } from './types.js';
12
+ function getVersion() {
13
+ const __dirname = dirname(fileURLToPath(import.meta.url));
14
+ const pkgPath = join(__dirname, '..', 'package.json');
15
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
16
+ return pkg.version;
17
+ }
18
+ function showHelp() {
19
+ const version = getVersion();
20
+ console.log(`
21
+ ${chalk.bold('release-radar-cli')} v${version}
22
+
23
+ ${chalk.bold('USAGE:')}
24
+ release-radar-cli [command] [options]
25
+
26
+ ${chalk.bold('COMMANDS:')}
27
+ ${chalk.cyan('(default)')} Interactive mode - select and download tools
28
+ ${chalk.cyan('status')} Show tool versions and download status
29
+ ${chalk.cyan('config')} Configure or reconfigure settings (Nexus URL, download dir)
30
+ ${chalk.cyan('version')} Show CLI version
31
+ ${chalk.cyan('help')} Show this help message
32
+
33
+ ${chalk.bold('OPTIONS:')}
34
+ ${chalk.cyan('-v, --version')} Show version number
35
+ ${chalk.cyan('-h, --help')} Show help
36
+ ${chalk.cyan('--skip-update')} Skip auto-update check on startup
37
+
38
+ ${chalk.bold('EXAMPLES:')}
39
+ release-radar-cli # Interactive mode
40
+ release-radar-cli status # Show all tool versions
41
+ release-radar-cli config # Reconfigure settings
42
+ release-radar-cli --version # Show version
43
+
44
+ ${chalk.bold('CONFIG LOCATION:')}
45
+ ~/.release-radar-cli/config.json
46
+
47
+ ${chalk.gray('For more info: https://github.com/lvntbkdmr/release-radar')}
48
+ `);
49
+ }
9
50
  async function showStatus() {
10
51
  const tracker = new DownloadTracker();
11
52
  const versions = loadVersions();
@@ -33,8 +74,34 @@ async function showStatus() {
33
74
  }
34
75
  async function runConfig() {
35
76
  const configManager = new ConfigManager();
36
- const config = await promptSetup();
37
- configManager.save(config);
77
+ // Check if already configured and show current values
78
+ if (configManager.isConfigured()) {
79
+ const current = configManager.load();
80
+ console.log(chalk.bold('\nCurrent configuration:'));
81
+ console.log(` Nexus URL: ${chalk.cyan(current.nexusUrl)}`);
82
+ console.log(` Download dir: ${chalk.cyan(current.downloadDir)}`);
83
+ console.log('');
84
+ const { reconfigure } = await (await import('inquirer')).default.prompt([
85
+ {
86
+ type: 'confirm',
87
+ name: 'reconfigure',
88
+ message: 'Do you want to update these settings?',
89
+ default: false,
90
+ },
91
+ ]);
92
+ if (!reconfigure) {
93
+ console.log(chalk.gray('Configuration unchanged.'));
94
+ return;
95
+ }
96
+ // Prompt with current values as defaults
97
+ const { promptReconfigure } = await import('./ui.js');
98
+ const config = await promptReconfigure(current);
99
+ configManager.save(config);
100
+ }
101
+ else {
102
+ const config = await promptSetup();
103
+ configManager.save(config);
104
+ }
38
105
  console.log(chalk.green('\nConfiguration saved!'));
39
106
  }
40
107
  async function runInteractive() {
@@ -120,9 +187,25 @@ async function runInteractive() {
120
187
  }
121
188
  }
122
189
  async function main() {
123
- const args = process.argv.slice(2).filter(arg => !arg.startsWith('--'));
190
+ const rawArgs = process.argv.slice(2);
191
+ // Handle flags first
192
+ if (rawArgs.includes('-v') || rawArgs.includes('--version')) {
193
+ console.log(getVersion());
194
+ return;
195
+ }
196
+ if (rawArgs.includes('-h') || rawArgs.includes('--help')) {
197
+ showHelp();
198
+ return;
199
+ }
200
+ const args = rawArgs.filter(arg => !arg.startsWith('--') && !arg.startsWith('-'));
124
201
  const command = args[0];
125
202
  switch (command) {
203
+ case 'version':
204
+ console.log(getVersion());
205
+ break;
206
+ case 'help':
207
+ showHelp();
208
+ break;
126
209
  case 'status':
127
210
  await showStatus();
128
211
  break;
package/dist/ui.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { VersionsJsonTool } from './types.js';
2
2
  import type { DownloadedState } from './tracker.js';
3
3
  import type { CliConfig } from './config.js';
4
4
  export declare function promptSetup(): Promise<CliConfig>;
5
+ export declare function promptReconfigure(current: CliConfig): Promise<CliConfig>;
5
6
  interface ToolChoiceBase {
6
7
  name: string;
7
8
  displayName: string;
package/dist/ui.js CHANGED
@@ -30,6 +30,35 @@ export async function promptSetup() {
30
30
  downloadDir: answers.downloadDir.replace('~', process.env.HOME || ''),
31
31
  };
32
32
  }
33
+ export async function promptReconfigure(current) {
34
+ console.log(chalk.bold('\nUpdate your settings:\n'));
35
+ const answers = await inquirer.prompt([
36
+ {
37
+ type: 'input',
38
+ name: 'nexusUrl',
39
+ message: 'Nexus proxy base URL:',
40
+ default: current.nexusUrl,
41
+ validate: (input) => {
42
+ if (!input.trim())
43
+ return 'URL is required';
44
+ if (!input.startsWith('http'))
45
+ return 'URL must start with http:// or https://';
46
+ return true;
47
+ },
48
+ },
49
+ {
50
+ type: 'input',
51
+ name: 'downloadDir',
52
+ message: 'Download directory:',
53
+ default: current.downloadDir,
54
+ validate: (input) => input.trim() ? true : 'Directory is required',
55
+ },
56
+ ]);
57
+ return {
58
+ nexusUrl: answers.nexusUrl.replace(/\/$/, ''),
59
+ downloadDir: answers.downloadDir.replace('~', process.env.HOME || ''),
60
+ };
61
+ }
33
62
  function getStatus(tool, downloaded) {
34
63
  const record = downloaded[tool.name];
35
64
  if (!record) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar-cli",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Interactive CLI for downloading tools through Nexus proxy",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -26,6 +26,12 @@
26
26
  ],
27
27
  "author": "lvnt",
28
28
  "license": "ISC",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/lvntbkdmr/release-radar.git",
32
+ "directory": "cli"
33
+ },
34
+ "homepage": "https://github.com/lvntbkdmr/release-radar#readme",
29
35
  "dependencies": {
30
36
  "chalk": "^5.3.0",
31
37
  "inquirer": "^9.2.12"
@@ -37,4 +43,4 @@
37
43
  "typescript": "^5.3.0",
38
44
  "vitest": "^1.1.0"
39
45
  }
40
- }
46
+ }
package/versions.json CHANGED
@@ -1,109 +1,21 @@
1
1
  {
2
- "generatedAt": "2026-01-25T15:09:57.248Z",
2
+ "generatedAt": "2026-01-24T10:00:00Z",
3
3
  "tools": [
4
- {
5
- "name": "Claude Code CLI",
6
- "displayName": "Claude Code CLI",
7
- "version": "2.1.19",
8
- "publishedAt": "2026-01-25T15:09:57.247Z",
9
- "downloadUrl": "{{NEXUS_URL}}/storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/2.1.19/win32-x64/claude.exe",
10
- "filename": "claude-2.1.19.exe"
11
- },
12
4
  {
13
5
  "name": "Ninja",
14
6
  "displayName": "Ninja",
15
- "version": "1.13.2",
16
- "publishedAt": "2026-01-25T15:09:57.248Z",
17
- "downloadUrl": "{{NEXUS_URL}}/github.com/ninja-build/ninja/releases/download/v1.13.2/ninja-win.zip",
18
- "filename": "ninja-1.13.2-win.zip"
7
+ "version": "1.12.0",
8
+ "publishedAt": "2026-01-20T00:00:00Z",
9
+ "downloadUrl": "{{NEXUS_URL}}/github.com/ninja-build/ninja/releases/download/v1.12.0/ninja-linux.zip",
10
+ "filename": "ninja-1.12.0-linux.zip"
19
11
  },
20
12
  {
21
13
  "name": "CMake",
22
14
  "displayName": "CMake",
23
- "version": "4.2.2",
24
- "publishedAt": "2026-01-25T15:09:57.248Z",
25
- "downloadUrl": "{{NEXUS_URL}}/github.com/Kitware/CMake/releases/download/v4.2.2/cmake-4.2.2-windows-x86_64.zip",
26
- "filename": "cmake-4.2.2-windows-x86_64.zip"
27
- },
28
- {
29
- "name": "Git",
30
- "displayName": "Git for Windows",
31
- "version": "2.52.0.windows.1",
32
- "publishedAt": "2026-01-25T15:09:57.248Z",
33
- "downloadUrl": "{{NEXUS_URL}}/github.com/git-for-windows/git/releases/download/v2.52.0.windows.1/Git-2.52.0-64-bit.exe",
34
- "filename": "Git-2.52.0-64-bit.exe"
35
- },
36
- {
37
- "name": "Clangd",
38
- "displayName": "Clangd",
39
- "version": "21.1.8",
40
- "publishedAt": "2026-01-25T15:09:57.248Z",
41
- "downloadUrl": "{{NEXUS_URL}}/github.com/clangd/clangd/releases/download/21.1.8/clangd-windows-21.1.8.zip",
42
- "filename": "clangd-windows-21.1.8.zip"
43
- },
44
- {
45
- "name": "Wezterm",
46
- "displayName": "Wezterm",
47
- "version": "20240203-110809-5046fc22",
48
- "publishedAt": "2026-01-25T15:09:57.248Z",
49
- "downloadUrl": "{{NEXUS_URL}}/github.com/wezterm/wezterm/releases/download/20240203-110809-5046fc22/WezTerm-20240203-110809-5046fc22-setup.exe",
50
- "filename": "WezTerm-20240203-110809-5046fc22-setup.exe"
51
- },
52
- {
53
- "name": "Ralphy",
54
- "displayName": "Ralphy CLI",
55
- "version": "4.5.3",
56
- "publishedAt": "2026-01-25T15:09:57.248Z",
57
- "type": "npm",
58
- "package": "ralphy-cli"
59
- },
60
- {
61
- "name": "vscode-cpptools",
62
- "displayName": "C/C++ Extension",
63
- "version": "1.29.3",
64
- "publishedAt": "2026-01-25T15:09:57.248Z",
65
- "downloadUrl": "{{NEXUS_URL}}/github.com/microsoft/vscode-cpptools/releases/download/v1.29.3/cpptools-windows-x64.vsix",
66
- "filename": "cpptools-windows-x64-1.29.3.vsix"
67
- },
68
- {
69
- "name": "vscode-clangd",
70
- "displayName": "clangd Extension",
71
- "version": "0.4.0",
72
- "publishedAt": "2026-01-25T15:09:57.248Z",
73
- "downloadUrl": "{{NEXUS_URL}}/github.com/clangd/vscode-clangd/releases/download/0.4.0/vscode-clangd-0.4.0.vsix",
74
- "filename": "vscode-clangd-0.4.0.vsix"
75
- },
76
- {
77
- "name": "CMake Tools",
78
- "displayName": "CMake Tools Extension",
79
- "version": "1.21.36",
80
- "publishedAt": "2026-01-25T15:09:57.248Z",
81
- "downloadUrl": "{{NEXUS_URL}}/github.com/microsoft/vscode-cmake-tools/releases/download/v1.21.36/cmake-tools.vsix",
82
- "filename": "cmake-tools-1.21.36.vsix"
83
- },
84
- {
85
- "name": "Roo Code",
86
- "displayName": "Roo Code Extension",
87
- "version": "3.43.0",
88
- "publishedAt": "2026-01-25T15:09:57.248Z",
89
- "downloadUrl": "{{NEXUS_URL}}/github.com/RooCodeInc/Roo-Code/releases/download/v3.43.0/roo-cline-3.43.0.vsix",
90
- "filename": "roo-cline-3.43.0.vsix"
91
- },
92
- {
93
- "name": "Atlascode",
94
- "displayName": "Atlassian Extension",
95
- "version": "4.0.17",
96
- "publishedAt": "2026-01-25T15:09:57.248Z",
97
- "downloadUrl": "{{NEXUS_URL}}/github.com/atlassian/atlascode/releases/download/v4.0.17/atlascode-4.0.17.vsix",
98
- "filename": "atlascode-4.0.17.vsix"
99
- },
100
- {
101
- "name": "Zed",
102
- "displayName": "Zed",
103
- "version": "0.220.6",
104
- "publishedAt": "2026-01-25T15:09:57.248Z",
105
- "downloadUrl": "{{NEXUS_URL}}/github.com/zed-industries/zed/releases/download/v0.220.6/Zed-x86_64.exe",
106
- "filename": "Zed-0.220.6-x86_64.exe"
15
+ "version": "3.28.1",
16
+ "publishedAt": "2026-01-18T00:00:00Z",
17
+ "downloadUrl": "{{NEXUS_URL}}/github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz",
18
+ "filename": "cmake-3.28.1-linux-x86_64.tar.gz"
107
19
  }
108
20
  ]
109
- }
21
+ }