You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a command-line interface for running WQL queries and remote commands, and update pom.xml so every build also produces a self-contained executable JAR.
The existing regular library JAR must remain unchanged/available. The executable should be an additional artifact, for example:
--username, -u — username, including forms such as DOMAIN\user or HOST\localuser.
Credential options
--password, -p — password supplied directly.
--password-file, -pf — read the password from a file.
--password and --password-file must be mutually exclusive. Passwords must never be printed in diagnostics, usage errors, or logs. The password-file behavior must be documented, including treatment of its final CR/LF. Clear mutable password buffers when practical.
Direct --password use should carry a documentation warning that command-line arguments can be visible to other local processes; --password-file is preferred for automation.
Authentication options
--ntlm — use NTLM authentication.
--kerberos — use Kerberos authentication.
Document the default when neither is supplied (currently NTLM). If both flags are accepted for fallback, define and test their ordering; otherwise report a clear mutual-exclusion error.
Transport and timeout options
--https — use HTTPS instead of HTTP.
--https-permissive, — allow self-signed certificates (you can modify the option name if you find something more accurate and descriptive)
--port, -P — target port.
--timeout, -t — operation timeout in milliseconds.
-p was requested for both password and port, which is ambiguous. Reserve lowercase -p for password and use uppercase -P for port. The default port should follow the transport: 5985 for HTTP and 5986 for HTTPS.
Treat every remaining argument after command|cmd|exec|run as part of the remote command line, preserving spaces and quoting as predictably as possible.
Forward remote stdout to local stdout and remote stderr to local stderr.
Goal
Add a command-line interface for running WQL queries and remote commands, and update
pom.xmlso every build also produces a self-contained executable JAR.The existing regular library JAR must remain unchanged/available. The executable should be an additional artifact, for example:
invoked with:
cmd,exec, andrunmust be aliases forcommand.CLI syntax
Required connection options
--hostname,-h— target hostname or IP address.--username,-u— username, including forms such asDOMAIN\userorHOST\localuser.Credential options
--password,-p— password supplied directly.--password-file,-pf— read the password from a file.--passwordand--password-filemust be mutually exclusive. Passwords must never be printed in diagnostics, usage errors, or logs. The password-file behavior must be documented, including treatment of its final CR/LF. Clear mutable password buffers when practical.Direct
--passworduse should carry a documentation warning that command-line arguments can be visible to other local processes;--password-fileis preferred for automation.Authentication options
--ntlm— use NTLM authentication.--kerberos— use Kerberos authentication.Document the default when neither is supplied (currently NTLM). If both flags are accepted for fallback, define and test their ordering; otherwise report a clear mutual-exclusion error.
Transport and timeout options
--https— use HTTPS instead of HTTP.--https-permissive, — allow self-signed certificates (you can modify the option name if you find something more accurate and descriptive)--port,-P— target port.--timeout,-t— operation timeout in milliseconds.-pwas requested for both password and port, which is ambiguous. Reserve lowercase-pfor password and use uppercase-Pfor port. The default port should follow the transport: 5985 for HTTP and 5986 for HTTPS.Command behavior
WQL
wqlsubcommand.Command execution
command|cmd|exec|runas part of the remote command line, preserving spaces and quoting as predictably as possible.Executable JAR
Update
pom.xmlto produce an attached standalone executable artifact, preferably withmaven-shade-plugin:standaloneclassifier rather than replacing the main artifact;Main-Classto the CLI entry point;No CXF-specific packaging is required; the CLI targets the lightweight client only.
Exit codes
Define and document stable exit behavior, including at least:
0: successful WQL query or remote command with exit code 0;Acceptance criteria
mvn packageproduces both the normal library JAR and an executable standalone JAR.java -jar ...-standalone.jar --helpprints usage and exits successfully.--versionprints the project version.-pfor password and-Pfor port.wqlexecutes WQL and emits results to stdout.command,cmd,exec, andrunexecute remote commands and forward stdout/stderr appropriately.