Volcengine tosutil Skill
This Skill is designed for the
command-line tool of Volcengine Object Storage TOS. It converts user intent into safe, executable, and verifiable
operation workflows.
Goal in One Sentence
Convert a request to “perform an operation on TOS” into a
command that
previews only by default and, when execution is required, outputs
structured JSON results + reproducible evidence + diagnostic recommendations.
Inputs and Outputs
- Input: target command (such as ) + minimum necessary parameters (such as addresses, local paths, and recursive flags) + optional common parameters (
endpoint/region/credentials/conf
).
- Output: a unified JSON protocol () containing (a redacted, reproducible command), an execution summary, and plus upon failure.
Default Behavior (Lower User Cost + Safety)
- By default, only generate a command preview and do not execute it ( must be explicitly provided to execute).
- Destructive commands (such as ) do not execute by default: (or in legacy mode) must be explicitly provided before they actually run.
- Output is redacted by default: AK/SK/Token are never echoed.
When to Use
Invoke this Skill when the user requests any of the following scenarios:
- Initialize or update TOS configuration using
- Create buckets, list buckets/objects, or query object properties
- Upload, download, copy, or batch-delete objects
- Calculate object capacity or set object metadata
- Analyze issues such as , connectivity failures, or command argument errors
- Generate execution plans for advanced commands such as , , , , and
Documented Fact Baseline
Based on the
documentation set, the following facts can be confirmed:
- is a command-line tool for accessing and managing Volcengine Object Storage TOS. It is suitable for batch data processing between local systems and TOS, script integration, and small- and medium-scale data migration.
- Core commands include , , , , , , , , , , and .
- Auxiliary commands include , , , , , , , , , , , and .
- Initialization configuration supports permanent keys, STS temporary credentials, and anonymous access.
- During initialization, use a TOS protocol domain rather than an S3 protocol domain.
- includes a secondary confirmation by default; recursive and batch deletions require an explicit risk assessment.
- may take a long time when processing millions of objects, so prefer splitting calculations by directory.
Download and Installation
supports Windows, Linux, and macOS. Before using this Skill, it is recommended to download the appropriate version based on the current operating system and chip architecture and set the execute permission.
Official Download Recommendations
- Linux amd64: supports direct binary download and execution
- macOS amd64 (Intel): supports direct binary download and execution
- macOS arm64 (Apple M-series chips): supports direct binary download and execution
- Windows 64-bit: download
- Official checksum files are also provided. It is recommended to verify the binary's integrity after downloading it
- The latest version of mainly targets Windows, macOS, and Linux amd systems
Installation Commands
Linux:
bash
wget https://m645b3e1bb36e-mrap.mrap.accesspoint.tos-global.volces.com/linux/amd64/tosutil
chmod a+x tosutil
sudo mv tosutil /usr/local/bin
macOS Intel:
bash
wget https://m645b3e1bb36e-mrap.mrap.accesspoint.tos-global.volces.com/darwin/amd64/tosutil
chmod a+x tosutil
sudo mv tosutil /usr/local/bin
macOS Apple Silicon:
bash
wget https://m645b3e1bb36e-mrap.mrap.accesspoint.tos-global.volces.com/darwin/arm64/tosutil
chmod a+x tosutil
sudo mv tosutil /usr/local/bin
Windows:
bash
wget https://m645b3e1bb36e-mrap.mrap.accesspoint.tos-global.volces.com/windows/tosutil -O tosutil.exe
Installation Notes
- macOS may block unverified developer applications by default. If the system blocks on first execution, allow it in the system security settings
- After downloading on Linux / macOS, you usually need to run
- If you want to run directly from any directory, move the binary to a directory included in , such as
- If the binary has not been added to , invoke it using an absolute path, for example
/absolute/path/to/tosutil version
- When the binary is not included in , this Skill recommends explicitly specifying its location through
--tosutil-binary <absolute-path>
to avoid tool-not-found errors
Verification After Installation
If it has been added to
:
bash
tosutil version
tosutil config
tosutil ls
If it has not been added to
:
bash
/absolute/path/to/tosutil version
/absolute/path/to/tosutil config
/absolute/path/to/tosutil ls
Recommendations:
- First use to verify that the binary is executable
- Then use to confirm the configuration file path
- Finally use to verify credentials, region, and network connectivity
If
has been added to
, this Skill can be invoked as follows (the path is relative to the Skill root directory):
bash
python3 scripts/main.py \
ls \
--preflight
If
has not been added to
, this Skill can be invoked as follows:
bash
python3 scripts/main.py \
ls \
--tosutil-binary /absolute/path/to/tosutil \
--preflight
Working Principles
- First determine whether the goal is a “read operation” or a “write/delete operation.”
- Prefer generating the minimum viable command and avoid combining too many dangerous parameters at once.
- For batch upload, download, or copy tasks, confirm concurrency and multipart thresholds before execution.
- For deletion tasks, provide pre-check steps and rollback guidance by default; do not bypass confirmation.
- When encountering an advanced command whose parameters are not fully confirmed, validate them with and never invent parameters.
- For non-interactive deletion, use , not . When cleaning deployment artifacts, prefer deleting constrained prefixes, for example
tosutil rm tos://bucket/prefix/ -r -f
, to avoid leaving test artifacts behind or accidentally deleting unrelated objects.
Standard Process
1. Scenario Recognition
Classify the user request into one of the following scenarios:
- Initialization configuration:
- Bucket operations: , ,
- Object transfer:
- Object deletion:
- Object metadata:
- Capacity statistics:
- Troubleshooting: , , , , , , ,
2. Preflight Checks
Execute or suggest the following checks:
bash
tosutil version
tosutil config
tosutil ls
Key checks:
- Whether the tool is installed and executable
- Whether uses a TOS protocol domain
- Whether matches the target bucket's region
- Whether or is present and has sufficient permissions
- Whether the output contains , , or
A connection attempt failed
3. Parameter Normalization
Before generating a command, organize the following parameters:
- Resource address: local path, , or
- Credential mode: permanent keys, STS, or anonymous access
- Common parameters: , , , , ,
- Bucket type:
- Batch task concurrency:
- Multipart concurrency or multipart task control: , ,
- Result output directory:
4. Command Generation
Automatically select the command mode based on the resource type:
- Local -> TOS: upload
- TOS -> local: download
- TOS -> TOS: object copy
- Single object: single-task mode
- Directory or prefix: recursive mode
- Large file: switch to a multipart task according to the threshold
5. Output Validation
Parse the following signals in the execution result:
- Success indicators: , , ,
- Permission issue:
- Network issue:
A connection attempt failed
- Argument issue: command help output, missing required arguments, or invalid path format
- Cleanup recommendation: consider when a resumable transfer fails
Command Mapping
Initialization Configuration
Permanent keys (recommended):
bash
tosutil config -i <ak> -k <sk> -e <endpoint> -re <region>
and
can be found in “Appendix: Regions and Access Domains.” Prefer the private endpoint; if the private endpoint is unavailable, use the public endpoint.
STS:
bash
tosutil config -i <ak> -k <sk> -t <token> -e <endpoint> -re <region>
Anonymous access:
bash
tosutil config -i= -k= -t= -e <endpoint> -re <region>
Common Bucket and Object Commands
bash
tosutil ls
tosutil mb tos://bucketname
tosutil cp /local/file.txt tos://bucketname/file.txt
tosutil cp tos://bucketname/file.txt /local/file.txt
tosutil rm tos://bucketname/file.txt
tosutil du tos://bucketname
tosutil setmeta tos://bucketname/object.png -meta aaa:bbb#ccc:ddd
Security Strategy
- Before deleting an object, determine whether the target is a single object, directory prefix, or bucket-level deletion.
- For , , batch metadata updates, batch copies, and similar operations, first output an impact-scope description.
- If the user only asks to “generate commands,” do not execute them directly by default.
- If a high-risk command must be executed, first suggest listing the target objects or performing a -style validation. If the command does not support , perform a read-only check first.
Integration Implementation Recommendations
This Skill should be implemented primarily as a “local CLI wrapper layer” rather than by “directly calling the TOS HTTP API,” because the main body of the documentation provides the
command interface.
Script Entry (Recommended Subcommand Mode)
Command preview without execution:
bash
python3 scripts/main.py ls --cloud-url tos://bucketname
Execute and return a structured result:
bash
python3 scripts/main.py ls --cloud-url tos://bucketname --preflight --run
High-risk deletion with explicit confirmation:
bash
python3 scripts/main.py rm --cloud-url tos://bucketname/prefix/ --recursive --run --yes
Legacy entry-point compatibility:
bash
python3 scripts/main.py --command ls --cloud-url tos://bucketname
Recommended directory structure:
text
volcengine-tosutil/
├── SKILL.md
├── references/
│ └── doc-survey.md
└── scripts/
├── main.py
├── models.py
├── result_handler.py
└── tosutil_service.py
Recommended core classes:
- / : encapsulate permanent keys, STS, anonymous mode, and common parameters
- : parse local paths and resources
- : encapsulate the command name, argument list, risk level, and whether the operation is destructive
- : execute commands consistently and collect exit codes, standard output, and standard error
- : parse results, map errors, and organize structured output fields
- : build commands, run preflight checks, execute operations, redact sensitive data, and validate common parameters
Key Rules
Configuration Rules
- writes to a local configuration file, which by default resides at under the user's home directory
- can only point to an existing configuration file path; it does not automatically create a new file
- Prefer explicitly specifying to avoid cross-region mistakes
Transfer Rules
- should infer upload, download, or cloud-to-cloud copy based on the source and destination address types
- Actual concurrency for batch tasks should be evaluated using both and multipart concurrency parameters; do not blindly increase it
- For large files and batch tasks, explicitly set thresholds, concurrency, and output directories to facilitate troubleshooting
Statistics Rules
- Do not recursively scan the entire bucket by default with when there are massive numbers of objects
- If bucket versioning is enabled, version-related parameters may be added as needed and the statistics scope may be split
Metadata Rules
- supports both single-object and batch-prefix modes
- Batch mode must explicitly use , and the maximum concurrency must be limited
Troubleshooting Tips
Permission Issues
- If the result contains , first check whether the AK/SK or STS credentials have expired and whether the target bucket/object permissions are sufficient
Network Issues
- If the result contains
A connection attempt failed
, first check the network, proxy, firewall, and
Argument Issues
- If the parameters of an advanced command are uncertain, first execute
Cleanup Issues
- After a resumable transfer or abnormal interruption, consider using to clean up record files and attempt cloud-side cleanup
Best Practices
- When first taking over an environment, run the , , and check sequence
- Initialization must use a TOS protocol domain
- Anonymous access only applies to public-read or public-write scenarios
- Split statistics for millions of objects by directory
- Start with conservative concurrency for batch tasks and tune it gradually
- Keep secondary confirmation and impact-scope explanations for high-risk commands
Interaction Templates
When the User Wants to Upload a File
- Confirm the local path, target bucket, and target object name
- Determine whether recursive upload is required
- Check the configuration and connectivity
- Generate the command
- Return success criteria and troubleshooting points
When the User Wants to Delete a Directory
- First confirm the target prefix
- First suggest to verify the impact scope
- Then generate
- If the user confirms forced deletion, consider
When the User Wants to Troubleshoot an Access Failure
- Check
- Check
- Run
- Categorize the diagnosis based on , connection failure, or argument error
Testing Requirements
- Use documented examples as command-construction test samples
- Use example outputs as parser snapshot samples
- Add unit tests for scenarios including , network failures, empty configuration, anonymous access, and recursive deletion
- Add integration tests for all three directions of : upload, download, and cloud-to-cloud copy
- Add boundary tests for the batch parameters of , , and
Limitations
- This Skill prioritizes the core commands documented in the most detail: , , , , , , , , , and
- Advanced commands such as , , , , , and use an extended adaptation mode
- If the parameters of an advanced command are not fully documented in the current reference materials, they must be confirmed through or supplemental documentation before execution
<br />
Appendix: Regions and Access Domains
- Region: indicates the physical location of the TOS data center.
- Endpoint: indicates the domain name through which TOS provides external services.
| Region Name | Region ID | Endpoint (Private/Public) | S3 Endpoint (Private/Public) |
|---|
| China North 2 (Beijing) | cn-beijing | Private: tos-cn-beijing.ivolces.com; Public: tos-cn-beijing.volces.com | Private: tos-s3-cn-beijing.ivolces.com; Public: tos-s3-cn-beijing.volces.com |
| China South 1 (Guangzhou) | cn-guangzhou | Private: tos-cn-guangzhou.ivolces.com; Public: tos-cn-guangzhou.volces.com | Private: tos-s3-cn-guangzhou.ivolces.com; Public: tos-s3-cn-guangzhou.volces.com |
| China East 2 (Shanghai) | cn-shanghai | Private: tos-cn-shanghai.ivolces.com; Public: tos-cn-shanghai.volces.com | Private: tos-s3-cn-shanghai.ivolces.com; Public: tos-s3-cn-shanghai.volces.com |
| Hong Kong, China | cn-hongkong | Private: tos-cn-hongkong.ivolces.com; Public: tos-cn-hongkong.volces.com | Private: tos-s3-cn-hongkong.ivolces.com; Public: tos-s3-cn-hongkong.volces.com |
| Asia Pacific Southeast (Johor) | ap-southeast-1 | Private: tos-ap-southeast-1.ivolces.com; Public: tos-ap-southeast-1.volces.com | Private: tos-s3-ap-southeast-1.ivolces.com; Public: tos-s3-ap-southeast-1.volces.com |
| Asia Pacific Southeast (Jakarta) | ap-southeast-3 | Private: tos-ap-southeast-3.ivolces.com; Public: tos-ap-southeast-3.volces.com | Private: tos-s3-ap-southeast-3.ivolces.com; Public: tos-s3-ap-southeast-3.volces.com |