Batch Rename for Openclaw

A powerful script for batch renaming image datasets and their associated annotation files using flexible numbering and naming patterns.

mingo-318
v1.0.0
Mar 5, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install batch-rename

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install batch-rename using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Batch Rename?

Batch Rename is a specialized utility designed to streamline the management of computer vision datasets. It allows developers to systematically rename large collections of images and their corresponding annotation files (such as XML, JSON, or TXT) in a single operation. This ensures data consistency across the training pipeline, which is a core value of Openclaw Skills.

The tool supports sequential numbering with zero-padding, custom prefixes, and dynamic placeholders like dates or original filenames. By providing a preview mode and handling missing annotations gracefully, Batch Rename minimizes the risk of data corruption or file mismatching during the critical pre-processing phase of AI development.

Batch Rename Use Cases

  • Standardizing image filenames for machine learning model training datasets.
  • Synchronizing filename changes between raw images and their corresponding label files.
  • Adding date-based or project-specific prefixes to large media libraries.
  • Reorganizing scrambled filenames into a clean, sequential order for better dataset documentation.

How Batch Rename Works

  1. The user specifies the target directory containing images and optionally the directory for annotation files.
  2. The script scans the directories to identify and match images with their corresponding labels based on base filenames.
  3. A renaming pattern is defined using placeholders like {:04d} for zero-padded sequences or {date} for timestamps.
  4. The script generates a logical mapping of original filenames to new names based on the selected configuration.
  5. If preview mode is enabled, the user reviews the proposed changes before any filesystem operations occur.
  6. Upon confirmation, the tool renames the files on the disk, maintaining the exact link between images and annotations.

Batch Rename Setup

The Batch Rename tool is designed to work out of the box with Openclaw Skills and does not require external library dependencies. Ensure you have Python installed and the script located in your project directory.

# Verify the script is accessible
python scripts/rename.py --help

Batch Rename Data Schema & Taxonomy

The skill organizes data by mapping source files to destination patterns while preserving file extensions and directory structures.

Data Component Description Example Values
Source Files The original images to be processed image_01.jpg, raw_data.png
Annotation Files Metadata files matched by filename image_01.xml, image_01.json
Pattern Variables Dynamic tokens for naming {date}, {original}, {:04d}
Metadata Persistence How the skill tracks original names Handled via {original} token

Batch Rename Advanced Features

  • Smart Annotation Tracking: Automatically identifies and renames labels that match image filenames even across different directories.
  • Custom Sequence Control: Define specific starting numbers for incremental renaming using the --start flag.
  • Safety Safeguards: Built-in preview mode and overwrite protection (optional --force) to prevent accidental data loss.
  • Dynamic Placeholders: Combine multiple variables like current date, original name, and sequences into a single robust naming pattern.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*