← 返回
未分类

Validator Tool

Validate data formats including JSON, email, URL, file paths, IP addresses, and phone numbers with detailed error reporting and batch processing.
验证数据格式,包括 JSON、邮箱、URL、文件路径、IP 地址和电话号码,提供详细的错误报告和批量处理。
dinghaibin dinghaibin 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 260
下载
💾 0
安装
1
版本
#latest

概述

Validator Tool — Multi-Format Data Validation

Validate, lint, and report errors across common data formats. Designed for input sanitization pipelines, CI checks, and API request validation.

Quick Start

# Validate a JSON string
validator-tool --json '{"name":"Alice","age":30}'

# Validate an email address
validator-tool --email "user@example.com"

# Validate a URL
validator-tool --url "https://example.com/path?q=1"

Usage

validator-tool [TYPE] [INPUT] [OPTIONS]

Types:
  --json      Validate JSON syntax and optional schema
  --email     Validate email format (RFC 5321/5322)
  --url       Validate URL format and scheme
  --path      Validate file/directory path (exists, readable, writable)
  --ip        Validate IPv4 or IPv6 address
  --phone     Validate phone number format (E.164 or regional)

Options:
  --schema FILE   JSON Schema file for --json validation
  --strict        Strict mode (reject warnings as errors)
  --batch FILE    Validate multiple inputs from a file (one per line)
  --json-output   Output results as JSON
  --verbose       Show detailed error reasons

Examples

# Validate JSON with schema
validator-tool --json '{"id":1,"name":"Test"}' --schema schema.json

# Batch validate emails from file
validator-tool --email --batch emails.txt --json-output

# Validate an IP address
validator-tool --ip "192.168.1.1"

# Check if a file path exists and is writable
validator-tool --path "/tmp/log.txt" --strict

Features

  • Multiple formats: JSON, email, URL, path, IP, phone
  • JSON Schema support: Validate against draft-07 schemas
  • Batch mode: Process hundreds of inputs from a file
  • Exit codes: 0 = all valid, 1 = any invalid, 2 = error
  • Machine-readable: --json-output for pipeline integration
  • Strict mode: Surface warnings as errors
  • i18n emails: Supports internationalized email addresses

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-11 04:59 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,951
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 76 📥 182,433
it-ops-security

Whoami Tool Check

dinghaibin
身份验证工具 — 根据预期角色验证当前用户,检查sudo权限,审计用户权限。扩展whoami用于安全...
★ 0 📥 414