Remote file access (4/4): CLI ls, stat, cat and get subcommands
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- cli, documentation, testing
調査の方向性
まず既存のCLI終了コードの契約とCliArgumentsのパーステストを読み、次にFakeWsmanServerのカバレッジを確認します。ドキュメントの唯一の正しい情報源としてcli.mdを使用してください; 4つすべてのサブコマンドと、記載されている検証およびエンドツーエンドのケースが mvn verify site で成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Fourth and last issue of the remote file access family: expose the library features from the CLI. Depends on the three library issues: #145 (listing), #146 (reading), #147 (download).
Context
The CLI already covers the library's other capabilities (wql, command/exec/cmd/run, shell). Once the library can list and read remote files, the CLI is where that becomes genuinely useful day to day: inspecting a remote log or configuration file from a shell script, with no RDP session and no SMB share.
Proposed subcommands
# List: long format, machine-readable timestamps and sizes
winrm-java -h server -u 'DOMAIN\user' -pf pw.txt ls 'C:\inetpub\logs' --glob '*.log' --recursive --depth 3
# One path's properties
winrm-java ... stat 'C:\Windows\Temp\collect.log'
# Content to stdout
winrm-java ... cat 'C:\Windows\Temp\collect.log'
winrm-java ... cat 'D:\logs\huge.log' --offset -8192 # tail the last 8 KiB
winrm-java ... cat 'D:\logs\huge.log' --offset 1073741824 --length 65536
winrm-java ... cat 'C:\legacy\report.txt' --charset windows-1252
# Whole file to a local file, digest-verified
winrm-java ... get 'C:\Windows\Temp\collect.log' ./collect.log
Requirements
ls— default output is a fixed, parseable long format (attributes, size, ISO-8601 UTC timestamp, path), not a locale-formatted human table. Options:--glob,--recursive,--depth N,--files-only,--directories-only,--modified-after <ISO-8601>,--min-size, and--jsonfor JSON Lines output consistent with whatwqlalready emits. Entries are written as the listing streams, like the WQL rows — no buffering of the whole tree.stat— the same fields for a single path, one field per line (and--json). Exit code distinguishes "does not exist" from a genuine failure, per the existing exit-code contract.cat— writes raw bytes to stdout by default, so binary content and redirection to a file both work (... cat 'C:\x.bin' > x.binmust produce a byte-exact file: no charset round-trip, no newline translation).--charsetswitches to decoded text;--offset/--lengthmap to the ranged read, negative offset = from the end.get— thedownloadFileterminal, with the destination defaulting to the remote file's base name in the current directory when omitted. Progress reporting goes to stderr only (never stdout, which may be the content or a pipe), and only when stderr is a terminal.- Inaccessible entries reported on stderr, exit code reflects partial failure: a recursive
lsover a tree with access-denied subdirectories must not exit 0 while silently having skipped part of the tree. - Path arguments are passed through untouched to the library, which does the quoting. Document the shell-quoting the user needs locally (
'C:\path with spaces\x.log', and the trailing-backslash trap in double-quoted POSIX shells). - Diagnostics on stderr, content on stdout — the existing invariant, and the one thing that makes
cat/getscriptable. - Exit codes reuse the established CLI contract; add a documented code for "remote path not found" if the current set has no good fit.
Tests & docs
CliArgumentsparsing tests for every new subcommand and option, including the usage errors (bad--depth, malformed--modified-after,--lengthwithout--offset, unknown charset).- End-to-end CLI tests against
FakeWsmanServer:lsstreaming output ordering,--jsonshape,catbyte-exactness on stdout (including a byte sequence that would be corrupted by any text round-trip),staton a missing path → documented exit code. cli.mdis the single source of truth for the CLI manual: document the four subcommands, their options, output formats, exit codes and quoting notes there;--helpstays short and links to https://metricshub.org/winrm-java/cli.html. README gets one example line, no more.
Acceptance criteria
- The four subcommands work end to end against a real host.
winrm-java ... cat <binary file> > out.binproduces a byte-exact copy.- A recursive
lsover a partially inaccessible tree reports the skipped paths on stderr and exits non-zero. --helpstays short;cli.mddocuments everything.mvn verify sitegreen: no checkstyle/PMD/SpotBugs findings, full Javadoc,cli.mdupdated.
🤖 Generated with Claude Code
- 主要言語
- Java
- スター
- 11
- フォーク
- 4
- 平均マージ
- 5日 5時間
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MetricsHub/winrm-java のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
MetricsHub/winrm-java#147 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
MetricsHub/winrm-java#146 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
MetricsHub/winrm-java#145 ·
-
Kerberos credential delegation: allowDelegation() and CLI --allow-delegate (winrs -allowdelegate) オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
MetricsHub/winrm-java#141 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
MetricsHub/winrm-java#139 ·
MetricsHub/winrm-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
infinispan/infinispan#18150 ·
-
area/frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
opensearch-project/k-NN#3597 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100