RSP (Raw String Peeler)
A Rust CLI tool that converts escaped strings embedded in YAML ConfigMaps into properly formatted multi-line strings using YAML's pipe (|) syntax.
Table of Contents
Installation
From Source
- Clone the repository:
- Build the project:
# Install from source
- The binary will be available at
target/release/rsp
Prerequisites
- Rust 1.70+ (uses Rust 2024 edition)
- Cargo package manager
Get Started
Basic Usage
Process a YAML ConfigMap file and output to stdout:
Process a file and save to output file:
Process a file from pipe:
|
What it does
RSP transforms hard-to-read escaped strings in Kubernetes ConfigMaps into human-readable format:
Before:
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
data:
config.json: "{\"hello\":\"test\",\n \"foo\":\"bar\"\n}"
After:
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
data:
config.json: |
{"hello":"test",
"foo":"bar"
}
Supported file types
RSP automatically processes string values for keys ending with:
.yamlor.yml.json.toml
Testing
Run the comprehensive test suite:
# Run all tests
# Run specific test categories
CI/CD
The project uses GitHub Actions for continuous integration:
- Build: Compiles the project
- Test: Runs all test suites
- Lint: Checks formatting (rustfmt) and code quality (clippy)
- Audit: Scans for security vulnerabilities
License
This project is open source. Please check the repository for license information.
Contribution
We welcome contributions! Please follow these guidelines:
-
Testing: Run the full test suite before submitting changes:
-
Code Quality: Ensure your code passes all checks:
-
Documentation: Update documentation for any new features or changes
-
Commit Messages: Use clear, descriptive commit messages
-
Pull Requests:
- Create feature branches from the main branch
- Include tests for new functionality
- Ensure all CI checks pass
Project Structure
src/main.rs- Main CLI entry pointsrc/cli.rs- Command-line interfacesrc/peeler.rs- Core YAML processing logicsrc/error.rs- Error handlingtests/- Comprehensive test suitespecs/README.md- Detailed specifications
For more detailed development information, see CLAUDE.md in the project root.