A Rust CLI tool that converts escaped strings embedded in YAML ConfigMaps into properly formatted multi-line strings using YAML's pipe (|) syntax.
Install directly from crates.io using cargo:
cargo install rsp-cli- Clone the repository:
git clone <repository-url>
cd rsp- Build the project:
# Install from source
cargo install --path .- The binary will be available at
target/release/rsp
- Rust 1.70+ (uses Rust 2024 edition)
- Cargo package manager
Process a YAML ConfigMap file and output to stdout:
rsp peel input.yamlProcess a file and save to output file:
rsp peel input.yaml -o output.yamlProcess a file from pipe:
cat input.yaml |rsp peelRSP 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"
}RSP automatically processes string values for keys ending with:
.yamlor.yml.json.toml
Run the comprehensive test suite:
# Run all tests
cargo test
# Run specific test categories
cargo test --test peeler_tests # Core functionality
cargo test --test cli_tests # CLI integration
cargo test --test edge_cases_tests # Edge cases and error handlingThe 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
This project is open source. Please check the repository for license information.
We welcome contributions! Please follow these guidelines:
-
Testing: Run the full test suite before submitting changes:
cargo test --all --verbose -
Code Quality: Ensure your code passes all checks:
cargo check cargo clippy
-
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
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.