# Case Converter Zero-dependency naming-case converter. ``` python scripts/run.py snake "Hello World" python scripts/run.py camel "hello_world" python scripts/run.py pascal "my-component-name" python scripts/run.py constant "apiBaseUrl" python scripts/run.py all "someHTTPServer" echo "first_name" | python scripts/run.py camel - ``` Styles: snake, camel, pascal, kebab, constant, title, sentence, lower, upper, dot. --- name: case-converter display_name: Case Converter description: "Convert text between snake_case, camelCase, PascalCase, kebab-case, CONSTANT_CASE, Title Case and more. Triggers: convert case, snake case, camel case, kebab case, to pascal case." --- # Case Converter Re-case identifiers and phrases between common naming conventions. ## When to use The user has a name/phrase and wants it in a different case — e.g. turning `user name` into `userName`, `user_name`, `UserName`, or `USER_NAME`. ## How to use Run `scripts/run.py <style> <text>`: - `python scripts/run.py snake "Hello World"` -> `hello_world` - `python scripts/run.py camel "hello_world"` -> `helloWorld` - `python scripts/run.py constant "myVar name"` -> `MY_VAR_NAME` - `python scripts/run.py all "someHTTPServer"` — show every style at once. Styles: snake, camel, pascal, kebab, constant, title, sentence, lower, upper, dot. Omit the text (or pass `-`) to read stdin; `--each-line` converts lines independently. ## Pitfalls - Acronyms are split heuristically: `someHTTPServer` -> `some http server`. - If your text matches an existing filename it is read as a file; pass it via stdin (`-`) or `--each-line` to avoid ambiguity. - Non-alphanumeric characters are treated purely as word separators.
Case Converter by langbot-team
Convert text between snake_case, camelCase, PascalCase, kebab-case, CONSTANT_CASE, Title Case and more.
Loading...