feat(cli): 支持远端文件列表 / add remote file listing - #484
Open
Jinghao-coding wants to merge 1 commit into
Open
Conversation
Jinghao-coding
force-pushed
the
codex/issue-479-file-list
branch
from
July 28, 2026 14:34
6be9ef7 to
2d7d36a
Compare
Jinghao-coding
force-pushed
the
codex/issue-479-file-list
branch
from
July 30, 2026 07:25
2d7d36a to
83120db
Compare
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.
中文
说明
为普通用户新增
crater file ls [remote-path],用于浏览user、public和当前account的远端文件空间。实现内容
file名词命令及file ls。GET /api/ss/files[/<path>]。..、反斜杠和控制字符。#、%等字符。null规范化为[]。sys。验证
go test ./cmd ./internal/api -count=1make snapshot-update,已人工检查新增/变化 goldenmake pre-commit-checkmake buildgo vet ./cmd ./internal/api./crater file --help./crater file ls 'user/../public' --json --no-interactive,确认本地拒绝越界路径并返回退出码 2httptest精确验证根/嵌套路由、逐段 URL 编码、空列表和 API 错误保留真实 storage service 未在本机 8088 入口提供,因此未把真实服务联调结果冒充为通过;HTTP 协议和命令行为由确定性的单元/快照测试覆盖。
测试截图
Closes #479
English
Summary
Adds
crater file ls [remote-path]for ordinary users to browse remote files inuser,public, and the currentaccountstorage spaces.Changes
filenoun andfile lscommand.GET /api/ss/files[/<path>]...segment, backslash, and control character.#, and%are preserved.[].sys.Validation
go test ./cmd ./internal/api -count=1make snapshot-update, followed by manual golden reviewmake pre-commit-checkmake buildgo vet ./cmd ./internal/api./crater file --helpexecution./crater file ls 'user/../public' --json --no-interactiveexecution, confirming local traversal rejection and exit code 2httptestcoverage for root/nested routes, segment encoding, empty lists, and API error preservationThe real storage service is not exposed through the local port 8088, so this PR does not claim a live storage integration result. HTTP contracts and command behavior are covered by deterministic unit and snapshot tests.
Test screenshot