跳转到主要内容
一个用于应用的远程文件管理器:无需 commit 即可列出、读取、写入、移动和删除文件。每个子命令都通过 --app 接收应用 ID;若省略,CLI 会回退到当前目录下的 squarecloud.app 配置文件,再回退到交互式选择器。
squarecloud app file list
# 列出应用根目录下的文件。
squarecloud app file list /logs --app <appID>
# 列出指定应用中某个目录下的文件。
squarecloud app file list --json
# 以 JSON 格式打印原始文件列表。
squarecloud app file read config.json --app <appID>
# 将文件内容打印到 stdout。
squarecloud app file read config.json -o ./local-config.json --app <appID>
# 将文件内容保存到本地文件,而不是打印出来。
cat ./config.json | squarecloud app file write config.json --app <appID>
# 将 stdin 写入为文件内容,若文件不存在则创建,否则覆盖。
squarecloud app file write config.json --from ./local-config.json --app <appID>
# 写入本地文件的内容,而不是从 stdin 读取。
squarecloud app file move old-name.txt new-name.txt --app <appID>
# 移动或重命名文件。别名:"mv"、"rename"。
squarecloud app file delete old-log.txt --app <appID>
# 删除文件。别名:"rm"。
delete 子命令具有破坏性:在删除文件之前,它会要求 y/N 确认。传入 -y/--yes 可跳过该提示。 使用 squarecloud app file --help 获取有关此命令的更多信息。