2022년 8월 10일부터 현재 버전 1.0.9까지 COSCLI의 15개 버전을 모았습니다. 모든 버전은 제공사의 공식 설치 파일로 연결됩니다.
4년 동안 15개 버전 · 연평균 약 3.7회
| 버전 | 날짜 | 크기 | 파일 |
|---|---|---|---|
| 1.0.9최신 | 2026년 8월 25일 | — | 64비트 포터블 릴리스 노트COSCLI v1.0.9 迭代改动点
一、新增能力
1. 新增 stat 命令(查询对象元数据)
- 新增文件:cmd/stat.go、util/stat.go
- 功能:通过 HEAD Object 接口查询对象元数据,输出 ETag、Content-Type、Content-Length、Last-Modified、Cache-Control、Content-Disposition、Content-Encoding、Content-Language、Expires、存储类型、版本号、对象类型、CRC64,以及全部自定义元数据 x-cos-meta-*。
- 用法:
- ./coscli stat cos://bucket-1234567890/test.txt
- ./coscli stat cos://bucket-1234567890/test.txt --version-id <version-id>
- 参数:--version-id 指定查询的对象版本。
2. 自定义域名支持写入配置文件(Bucket 级 customized)
- util/types.go:Bucket 结构体新增 Customized bool 字段(yaml: customized)。
- cmd/config_add.go:新增 --customized flag,可在添加桶时持久化自定义域名标记。
- cmd/config_init.go:交互式初始化时新增询问「是否对该桶使用自定义 endpoint」。
- cmd/config_show.go:展示桶的 Customized 字段。
- util/url.go GenURL:URL 生成时 --customized 命令行参数优先,未指定则回退到配置文件中桶的 customized 字段。
3. 新增列举存储桶的 Service 域名配置(ServiceDomain)
- util/types.go:Base 结构体新增 ServiceDomain string(yaml: servicedomain)。
- util/const.go:新增默认常量 CosServiceDomain = "service.cos.myqcloud.com"。
- cmd/config_set.go:新增 --service_domain flag(@ 可清空)。
- cmd/config_init.go:初始化时新增询问默认 service 域名。
- cmd/config_show.go:展示 ServiceDomain。
- util/url.go GenBaseURL:始终显式构造 ServiceURL,不再返回 nil,避免 SDK 回退到写死的 http://service.cos.myqcloud.com。优先级:命令行 --endpoint > 配置文件 base.servicedomain > 默认 service.cos.myqcloud.com。
4. 新增代理(Proxy)支持
- util/types.go:Base 新增 Proxy string(yaml: proxy);Param 新增 Proxy string。
- cmd/config_set.go:新增 --proxy flag(@ 可清空)。
- cmd/config_show.go:展示 Proxy。
- cmd/root.go:新增全局持久化参数 --proxy,支持 http://user:pass@127.0.0.1:8080、socks5://127.0.0.1:1080 等。
- util/client.go:新增 getProxyFunc,优先级 命令行 --proxy > 配置文件 base.proxy;对 URL 校验 scheme 与 host,非法输入回退为不使用代理并打印 warning;Service 客户端与 Bucket 客户端均注入代理。
5. signurl 支持 PUT(上传预签名 URL)
- cmd/signurl.go:新增 --method / -m flag(默认 GET),支持 GET(下载)与 PUT(上传);对非 GET/PUT 的 method 报错。
- 短描述更新为 "Gets the signed URL for upload or download"。
6. restore 并发重构 + 进度显示
- util/restore_objects.go 大幅重构:
- 用 restoreCounter(sync/atomic)替代包级全局计数器 succeedNum/failedNum/errTypeNum,消除多次调用间的状态残留,保证并发安全。
- 引入 worker pool(taskCh + sync.WaitGroup):list 阶段生产 restoreTask,多个 worker 并发执行 HEAD/POST restore。
- list 与回热解耦:produceCosRestoreTasks / produceOfsRestoreTasks 只负责扫描并投递任务,回热逻辑集中在 worker。
- 新增单行刷新的进度条(restoreProgressLoop):list 未结束时按已完成数展示,list 结束后切换为百分比。
- cmd/restore.go 新增 --routines flag(默认 3,范围 1~10000),批量 restore 时的并发数。
- cmd/restore.go 单对象 restore 遇到 HTTP 409(对象已在回热中)视为提交成功,不再报错。
二、性能/并发优化
7. 分片并发线程数推导重写(util/helper.go getThreadNumByPartSize)
- 默认并发上限由硬编码 12 提升至 32(defaultMaxThreadNum),覆盖 16GB+ 大文件场景。
- 档位表扩展:新增 partNum<=2000 → 20、default → 32。
- 新增带宽感知:按单连接 8MB/s(singleConnThroughputMB)估算,限速场景下收敛线程数。
- 新增上限封顶:受 --max-thread-num 控制;并保证 >=1 且不超过分片数。
- 新增命令行参数 --max-thread-num(cmd/cp.go、cmd/sync.go,默认 32),util/types.go Operation 新增 MaxThreadNum int。
- 语义:--thread-num(>0)显式设置时覆盖自动推导并忽略 --max-thread-num;--thread-num=0 时按文件大小自动推导,上限由 --max-thread-num 控制。
- 调用点同步改造:util/upload.go、util/download.go、util/copy.go 的单文件处理传入 RateLimiting 与 MaxThreadNum。
8. 重试逻辑去叠加(util/helper.go isSDKHandledError)
- SDK(cos-go-sdk-v5)已对 5xx 响应做 HTTP 级重试(默认 10 次),应用层(默认 5 次)叠加会放大到最坏 66 次。
- 新增 isSDKHandledError:识别 5xx 结构化错误后,upload/download/copy 不再叠加应用层重试,直接放弃并在 process.log 标注 skip coscli-retry。
- 网络错误(body 为 io.Reader 无法重放)仍由应用层兜底重试。 |
| 1.0.8 | 2026년 2월 4일 | — | 64비트 포터블 릴리스 노트修改内容:
1. cp 命令
- 优化分块上传文件传输进度
2. sync 命令
- 优化分块上传文件传输进度
- 修复进程日志 bug,当--process-log 参数设置为 false 时,不再输出进程日志
- 修复--snapshot-path 历史未使用此参数上传的文件不生成快照信息 bug
3. ls 命令
修改参数:
- --limit:当设置为-1 时,可以拉取所有 cos 文件,不限制数量
4. signurl 命令
新增参数:
- --simple-output:启用简易输出模式,默认值为 false。当设置为 true 时,仅输出签名 URL,简化返回结果。 |
| 1.0.7 | 2025년 9월 10일 | — | 64비트 포터블 릴리스 노트一、新增命令
1. object-tagging 命令
功能:管理对象标签
参数:
- --method
:操作类型(必选)
- put:设置对象标签
- add:添加对象标签
- get:获取对象标签
- delete:删除对象标签
- --version-id:操作对象的特定版本
示例:
# 设置对象标签
./coscli object-tagging --method put cos://examplebucket/exampleobject tag1#test1 tag2#test2
# 添加对象标签
./coscli object-tagging --method add cos://examplebucket/exampleobject tag3#test3
# 获取对象标签
./coscli object-tagging --method get cos://examplebucket/exampleobject
# 删除所有对象标签
./coscli object-tagging --method delete cos://examplebucket/exampleobject
# 删除指定对象标签
./coscli object-tagging --method delete cos://examplebucket/exampleobject tag1#test1 tag2#test2
2. object-acl 命令
功能:管理对象 ACL
参数:
- --method
:操作类型(必选)
- put:设置对象 ACL
- get:获取对象 ACL
- --version-id:对象版本号
- --acl:预设 ACL(如 default, private, public-read)
- --grant-read:赋予读取权限
- --grant-read-acp:赋予读取 ACL 权限
- --grant-write-acp:赋予写入 ACL 权限
- --grant-full-control:赋予完全控制权限
示例:
# 设置对象 ACL
./coscli object-acl --method put cos://examplebucket/exampleobject --grant-read="id=\"100000000013\",id=\"100000000012\""
# 获取对象 ACL
./coscli object-acl --method get cos://examplebucket/exampleobject
3. bucket-acl 命令
功能:管理存储桶 ACL
参数:
- --method
:操作类型(必选)
- put:设置存储桶 ACL
- get:获取存储桶 ACL
- --acl:预设 ACL(如 private, public-read)
- --grant-read:赋予读取权限
- --grant-write:赋予写入权限
- --grant-read-acp:赋予读取 ACL 权限
- --grant-write-acp:赋予写入 ACL 权限
- --grant-full-control:赋予完全控制权限
示例:
# 设置存储桶 ACL
./coscli bucket-acl --method put cos://examplebucket --grant-read="id=\"100000000013\",id=\"100000000012\""
# 获取存储桶 ACL
./coscli bucket-acl --method get cos://examplebucket
4. bucket-policy 命令
功能:管理存储桶策略
参数:
- --method
:操作类型(必选)
- put:设置存储桶策略
- get:获取存储桶策略
- delete:删除存储桶策略
- --policy:存储桶策略(JSON 格式或直接指定文件路径,如/data/policy.txt 需要指定为 file:///data/policy.txt)
示例:
# 设置存储桶策略
./coscli bucket-policy --method put cos://examplebucket --policy="{\"Statement\":[...]}"
# 获取存储桶策略
./coscli bucket-policy --method get cos://examplebucket
# 删除存储桶策略
./coscli bucket-policy --method delete cos://examplebucket
5. bucket-encryption 命令
功能:管理存储桶加密策略
参数:
- --method
:操作类型(必选)
- put:设置加密策略
- get:获取加密策略
- delete:删除加密策略
- --sse-algorithm:加密算法(AES256, SM4, KMS)
- --kms-master-key-id:KMS 主密钥 ID
- --kms-algorithm:KMS 加密算法(AES256, SM4)(目前 gosdk 暂不支持这个参数,先跳过)
示例:
# 设置存储桶加密
./coscli bucket-encryption --method put cos://examplebucket --sse-algorithm AES256
# 获取存储桶加密策略
./coscli bucket-encryption --method get cos://examplebucket
# 删除存储桶加密策略
./coscli bucket-encryption --method delete cos://examplebucket
6. inventory 命令
功能:管理存储桶清单
参数:
- --method
:操作类型(必选)
- put:设置存储桶清单
- get:获取存储桶清单
- delete:删除存储桶清单
- list:列出所有存储桶清单
- post:发起一次性清单
- --task-id:清单任务 ID
- --configuration:清单配置(JSON 格式、XML 格式或直接指定文件路径,如/data/configuration.txt 需要指定为 file:///data/configuration.txt)
示例:
# 设置存储桶清单
./coscli inventory --method put cos://test6 --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"
# 获取存储桶清单
./coscli inventory --method get cos://test6 --task-id list4
# 删除存储桶清单
./coscli inventory --method delete cos://test6 --task-id list4
# 列出所有存储桶清单
./coscli inventory --method list cos://test6
# 发起一次性清单
./coscli inventory --method post cos://test6 --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"
二、修改命令
1. 通用参数
新增参数:
- --disable-log:禁用 coscli.log 日志记录(默认 false)
- --bucket-type:指定桶类型(COS/OFS)
2. cp 命令
新增参数:
- --process-log:记录传输日志(默认 true)
- --process-log-path:指定传输日志路径(默认在执行当前路径下 coscli_output 下)
- --skip-dir:跳过文件夹上传(等 sdk 修复)
- --acl:对象 ACL 属性
- --grant-read:赋予读取权限
- --grant-read-acp:赋予读取 ACL 权限
- --grant-write-acp:赋予写入 ACL 权限
- --grant-full-control:赋予完全控制权限
- --tags:对象标签集合,最多可设置 10 个标签(例如,--tags="Key1=Value1&Key2=Value2")
- --forbid-overwrite:禁止覆盖同名对象
- --encryption-type:服务端加密方式(SSE-COS/SSE-C)
- --server-side-encryption:SSE-COS 加密算法
- --sse-customer-algo:SSE-C 加密算法
- --sse-customer-key:用户自定义密钥
- --sse-customer-key-md5:密钥 MD5 值
- --check-point:是否开启断点续传,默认 ture,开启断点续传
修改参数:
- --disable-checksum:默认值改为 true(只校验分块 CRC64)
3. sync 命令
新增参数 |
| 1.0.6 | 2025년 3월 20일 | — | 64비트 포터블 릴리스 노트修复单文件删除时加-f 参数删除不成功问题 |
| 1.0.5 | 2025년 3월 17일 | — | 64비트 포터블 릴리스 노트改动点:
1. 支持严格签名模式
Modification point:
1. Support strict signature mode |
| 1.0.4 | 2025년 2월 25일 | — | 64비트 포터블 릴리스 노트修改命令:
1. ls
- 新增参数:--all-versions ,列举对象的所有版本,仅当 bucket 开启版本控制后可用。列出历史版本参数增加显示字段 VersionId, IsLatest, Delete Marker
- 限频重试策略优化,当触发限频时,默认进行重试,retry-num 参数不再生效
2. du
- 新增参数:--all-versions 统计对象的所有版本数据,仅当 bucket 开启版本控制后可用。统计信息增加显示 DeleteMarker 数量
3. lspart
- 新增参数:--upload-id
- 当传入 upload-id 时,需指定具体文件,仅展示 upload-id 对应的文件碎片信息
- 未传入 upload-id 时,展示指定 prefix 下正在进行中的分块上传任务
4. abort
- 增加参数:--fail-output 及--fail-output-path 错误日志相关参数,与 cp 及 sync 命令的相关参数作用相同,用来记录清理过程中失败的信息
- 性能优化
5. rb
- 增加参数:--fail-output 及--fail-output-path 错误日志相关参数,与 cp 及 sync 命令的相关参数作用相同,用来记录清理过程中失败的信息
- 输出信息优化
6. rm
- 批量删除每批次删除对象数改为 1000(之前是 100)
- 输出信息优化
- 新增参数:--all-versions
- 仅支持在已开启版本控制的 Bucket 内使用,且仅在传入--recursive(-r)参数时可用,遍历删除所有版本对象
- 新增参数:--version-id
- 仅支持在已开启版本控制的 Bucket 内使用,且仅在未传入--recursive(-r)参数时可用,删除指定 object 的指定版本
7. cp
- 新增参数:--version-id 下载指定版本的文件,仅支持在已开启版本控制的 Bucket 内使用
- 新增参数:--move 仅 COS 路径间拷贝可用(其他会报错),会在文件成功拷贝到目标路径后,删除源文件
- 上传筛选本地文件名逻辑修改,改为筛选命令传入的路径+文件名
- 错误重试策略优化,默认进行 5xx 错误重试,指定错误重试次数和间隔后,会进行部分 4xx 重试
- copy 时支持修改文件存储类型
- 增加传输开始控制台输出及传输结束输出,并记录至 coscli.log
- 使用参数--part-size=0 开启自适应分块大小
8. sync
- 上传筛选本地文件名逻辑修改,改为筛选命令传入的路径+文件名
- 错误重试策略优化,默认进行 5xx 错误重试,指定错误重试次数和间隔后,会进行部分 4xx 重试
- 增加传输开始控制台输出及传输结束输出,并记录至 coscli.log
- --part-size=0 开启自适应分块大小
9. restore
- 增加支持 maz 归档存储类型取回和深度归档存储取回
- 输出提示信息优化
- 错误信息记录优化,调用 API 失败会记录错误日志到 coscli_output
- 可靠性优化,增加默认限频重试
- 可用性优化,增加 409 StatusCode(已触发回热)直接跳过
10. mb
- 新增参数:--maz(-m)默认为 false,为 true 时即为创建多 az 的存储桶
11. config set
- 新增参数:--disable_encryption 默认为 false,为 true 时即为不加密配置文件中的秘钥相关信息
12. config init
- 新增交互式配置 Input Disable Encryption 仅当传 true 时,取消加密配置文件中的秘钥相关信息
新增命令:
1. bucket-versioning
- 使用示例:./coscli bucket-versioning --method [method] cos://<bucket-name> versioning
- 开启版本控制:./coscli bucket-versioning --method put cos://examplebucket Enabled
- 暂停版本控制:./coscli bucket-versioning --method put cos://examplebucket Suspended
Command Modifications:
1. ls
- Added parameter: --all-versions, lists all versions of an object, available only when bucket versioning is enabled. Added fields for historical versions: VersionId, IsLatest, Delete Marker.
- Optimized rate limiting retry strategy, default retries when rate limit is triggered, retry-num parameter is no longer in effect.
2. du
- Added parameter: --all-versions, calculates data of all object versions, available only when bucket versioning is enabled. Added information to display the count of DeleteMarkers.
3. lspart
- Added parameter: --upload-id
- When upload-id is specified, the specific file must be indicated, and displays the parts information of the file corresponding to the upload-id.
- When upload-id is not specified, displays ongoing multipart upload tasks under the specified prefix.
4. abort
- Added parameters: --fail-output and --fail-output-path for error log, same function as related parameters in cp and sync commands, used to log failed information during cleanup.
- Performance optimization.
5. rb
- Added parameters: --fail-output and --fail-output-path for error log, same function as related parameters in cp and sync commands, used to log failed information during cleanup.
- Output information optimization.
6. rm
- Changed batch delete count to 1000 objects per batch (previously 100).
- Output information optimization.
- Added parameter: --all-versions
- Only works in versioning-enabled buckets and only available when --recursive (-r) parameter is passed, recursively deletes all versions of objects.
- Added parameter: --version-id
- Only works in versioning-enabled buckets and only available when --recursive (-r) parameter is not passed, deletes a specified version of the specified object.
7. cp
- Added parameter: --version-id, downloads the specified version of the file, only available in versioning-enabled buckets.
- Added parameter: --move, only available for copying between COS paths (otherwise will report an error), deletes the source file after successfully copying to the target path.
- Modified local filename filtering logic to filter based on the comm |
| 1.0.3 | 2024년 11월 27일 | — | 64비트 포터블 릴리스 노트修改点: 1.优化传输性能 2.修复 lsdu 列出部分文件异常的问题
Changes:
1. Optimize transmission performance
2. Fix the issue where lsdu lists some files abnormally |
| 1.0.2 | 2024년 10월 21일 | — | 64비트 포터블 릴리스 노트更新内容:
1. cp 及 sync 命令增加--disable-checksum 选项,默认为 false,校验整个文件的 crc64,为 true 时仅校验分片 crc64
2. 兼容 ofs 融合桶 api(ls cp sync rm 等命令)
3. 新增创建/获取 symlink 命令,可针对特定 object 创建软链,并通过软链快速获取 key 值
4. 新增 cat 命令,可查看 object 内容,建议 1MB 以内小文件使用
5. 新增 lsdu 命令,可列出当前目录所有文件及文件夹内容,并统计每个文件夹的文件数及总大小
6. 新增--log-path 全局选项,自定义 coscli.log 文件位置。可指定文件夹或具体文件(文件需以.log 结尾)如:/data/ 或 /data/cosli.log
7. 错误返回优化
Update contents:
1. Add the --disable-checksum option to the cp and sync commands. By default, it is set to false, which means the entire file's crc64 is verified. If set to true, only the fragment's crc64 is verified.
2. Compatible with OFS fusion bucket API (commands like ls, cp, sync, rm, etc.).
3. Add new commands to create/get symlink. You can create a symlink for a specific object and quickly obtain the key value through the symlink.
4. Add a new cat command to view object content. It is recommended to use it for small files under 1MB.
5. Add a new lsdu command to list all files and folders in the current directory, and count the number of files and the total size of each folder.
6. Add a global --log-path option to customize the location of the coscli.log file. You can specify a directory or a specific file (the file must end with .log), e.g., /data/ or /data/coscli.log.
7. Optimize error returns. |
| 1.0.1 | 2024년 8월 30일 | — | 64비트 포터블 릴리스 노트Fix the issue where the 'rm' command's use of include and exclude parameters is ineffective |
| 0.20.0-beta | 2024년 3월 15일 | — | 64비트 포터블 릴리스 노트Fix the compatibility bug with Chinese characters in the list. Add retry logic for downloads. |
| 0.19.0-beta | 2024년 1월 3일 | — | 64비트 포터블 릴리스 노트coscli supports domain switching, sync function optimization, and ls bucket supports specifying domain |
| 0.18.0-beta | 2023년 12월 6일 | — | 64비트 포터블 릴리스 노트Add an option to skip setting the config file parameter |
| 0.17.0-beta | 2023년 12월 4일 | — | 64비트 포터블 릴리스 노트coscli initialization does not force the generation of a config file |
| 0.13.0-beta | 2023년 1월 16일 | — | 64비트 포터블 릴리스 노트1. signurl bug fixed
2. cp format update
3. restore -r bug fixed |
| 0.12.0-beta | 2022년 8월 10일 | — | 64비트 포터블 릴리스 노트1. add --snapshot-path to accelerate sync file
2. add --meta to set file header
3. ignore irregular local file |