Case Conversion CLI
A fast and simple CLI tool for converting text between different case formats.
Features
- Convert text to various case formats (camelCase, PascalCase, snake_case, kebab-case, etc.)
- Go-specific case conversions
- Supports both command-line arguments and stdin input (pipes)
- Built with Go using Cobra CLI framework and ettle/strcase library
Installation
Using Go Install
go install github.com/danielmesquitta/caseconv@latest
Usage
Basic Syntax
# Using command line arguments
caseconv <command> "your text here"
# Using pipes (stdin)
echo "your text here" | caseconv <command>
Available Commands
| Command |
Description |
Example Input |
Example Output |
camel |
Convert to camelCase |
"hello world" |
"helloWorld" |
pascal |
Convert to PascalCase |
"hello world" |
"HelloWorld" |
snake |
Convert to snake_case |
"HelloWorld" |
"hello_world" |
kebab |
Convert to kebab-case |
"HelloWorld" |
"hello-world" |
uppersnake |
Convert to UPPER_SNAKE_CASE |
"hello world" |
"HELLO_WORLD" |
upperkebab |
Convert to UPPER-KEBAB-CASE |
"hello world" |
"HELLO-WORLD" |
lowercase |
Convert to lowercase |
"Hello World" |
"hello world" |
uppercase |
Convert to UPPERCASE |
"Hello World" |
"HELLO WORLD" |
Go-Specific Commands
These commands provide Go-specific handling for identifiers and special cases:
| Command |
Description |
Use Case |
Example Input |
Example Output |
gocamel |
Go-style camelCase |
Go variable names |
user id |
userID |
gopascal |
Go-style PascalCase |
Go type/function names |
user id |
UserID |
Examples
Command Line Arguments
# Convert to camelCase
$ caseconv camel "hello world example"
helloWorldExample
# Convert to PascalCase
$ caseconv pascal "hello world example"
HelloWorldExample
# Convert to snake_case
$ caseconv snake "HelloWorldExample"
hello_world_example
# Convert to kebab-case
$ caseconv kebab "HelloWorldExample"
hello-world-example
# Convert to UPPER_SNAKE_CASE
$ caseconv uppersnake "hello world example"
HELLO_WORLD_EXAMPLE
Using Pipes
# From echo
$ echo "hello world example" | caseconv camel
helloWorldExample
# From file
$ cat file.txt | caseconv snake
# Chain with other commands
$ curl -s api.example.com/data | jq -r '.name' | caseconv pascal
Multiple Words
# Multiple words as arguments
$ caseconv camel hello world example
helloWorldExample
# Quoted string (recommended)
$ caseconv camel "hello world example"
helloWorldExample
Batch Processing
# Convert multiple strings
$ echo -e "hello world\nfoo bar\nbaz qux" | while read line; do caseconv pascal "$line"; done
HelloWorld
FooBar
BazQux
Help
Get help for any command:
# General help
$ caseconv --help
# Help for specific command
$ caseconv camel --help
Dependencies
License
This project is licensed under the terms specified in the LICENSE file.