feat: add abdm-cli IPC companion CLI#1313
Open
ID-VerNe wants to merge 3 commits into
Open
Conversation
ADD:
- ApiDownloadModel, IdRequest, IdsRequest, RemoveRequest serializable DTOs
- IntegrationHandler with 5 new methods: listDownloads, getDownloadInfo, pauseDownloads, resumeDownloads, removeDownloads
- GET /list, POST /info, POST /pause, POST /resume, POST /remove routes
- /start-headless-download returns JSON {"id": <downloadId>}
- Full IntegrationHandlerImp implementation with toApiModel() mapping and auto-categorization
FIX:
- addDownloadTask returns actual download ID via downloadManager.addDownload
- Auto-categorization via categoryManager.autoAddItemsToCategoriesBasedOnFileNames
ADD: - DesktopClient, DesktopResult for HTTP IPC to desktop app - DesktopLauncher for auto-starting the desktop app with 30s polling - PortResolver reading browserIntegrationPort from appSettings.json - CliFormatting utilities using shared SizeConverter - CliMain entry point with Clikt command tree and versionOption - 6 commands: add, list, info, pause, resume, remove - build.gradle.kts with buildConfig plugin for version sync FIX: - Ping response parsing: compare against "pong" (not "\"pong\"") - --help exits with code 0, not 64 - Null exception message shows class name instead of "null" - ANSI alignment: padEnd on plain text before applying color - JSON error messages go to stderr, not stdout - CliktError no longer prints duplicate messages - Orphan desktop process destroyed on startup timeout - DesktopLauncher scans Program Files on Windows for binary - URL scheme check tightened to http/https only - DesktopLauncher uses DISCARD redirect, not inheritIO
… keep-file fix ADD: - Shadow plugin config for abdm-cli fat JAR build - abdm-cli.bat launcher invoking bundled JRE - AddToPath.nsh and RemoveFromPath.nsh for PATH management - copyJavaExeToRuntime Gradle task (Compose jlink omits java.exe) - Registry-based binary discovery in DesktopLauncher - cli/CLI.md with usage documentation for all 6 commands CHANGE: - NSIS template: CLI file copy, optional PATH, uninstall cleanup - desktop/app/build.gradle.kts: installer deps, java.management module - gradle/libs.versions.toml: add shadow plugin version FIX: - --keep-file defaults to true, keeping completed files by default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an optional
abdm-clidesktop companion CLI for AB Download Manager.This is not a standalone download manager. The CLI acts as an IPC client for the single-instance desktop app: it reads the configured integration port from
appSettings.json, starts the desktop app in the background when needed, and sends commands to the embedded HTTP server.The CLI is always bundled with the Windows installer. Adding it to
PATHis available as an optional installer checkbox and is disabled by default.Addresses #1294.
Design alignment with #1294
This PR follows the direction discussed in #1294:
abdm-cliis an IPC client, not a standalone download manager.add,list,info,pause,resume, andremove.~/.abdm/config/appSettings.json.Architecture
When the user runs
abdm-cli <command>:abdm-cli.batinvokes the bundled JRE:~/.abdm/config/appSettings.json.ABDownloadManager.exe --background.http://127.0.0.1:{port}/<endpoint>.CLI commands
add <url>POST /start-headless-downloadlistGET /list--alland--jsoninfo <id>POST /infopause <id>...POST /pauseresume <id>...POST /resumeremove <id>...POST /removeImplementation notes
CLI packaging
cli/app.abdm-cli.jaras a fat JAR using the Shadow plugin.java.managementto the runtime image because Mordant terminal detection requires it.Windows installer integration
cli\abdm-cli.jarabdm-cli.batDesktop app discovery
DesktopLaunchercan discover the installed desktop app on Windows.Scope and follow-ups
This PR only wires the CLI into the Windows NSIS installer.
The CLI implementation is kept platform-neutral where possible, and
DesktopLauncherincludes platform-specific discovery hooks for Windows, Linux, and macOS. However, only the Windows installer path is included in this PR because the current installer plugin does not provide equivalent Linux/macOS file injection support.Linux/macOS packaging and website documentation can be handled in follow-up PRs.
Testing
Tested manually on Windows.
After installing ABDM with "Add AB Download Manager to PATH" enabled:
Also verified:
~/.abdm/config/appSettings.json.runtime\bin\java.exeis used.