Featured image for TWIL blog post showcasing a command-line tip with Prettified Prettier Alias to enhance code formatting efficiency.

Welcome to TWIL, our weekly tech scribe that encapsulates the essence of continuous learning in the software domain. This installment sees Katie enhancing our command-line efficiency with her Prettified Prettier Alias, where the tidying of code across various file types is a single command. She elevates the use of tools like Prettier, paving the way for a smoother development workflow that's both productive and precise.

Prettified prettier alias

prettify()
{
    if [ "$#" -eq 0 ]; then
        prettier -l '**/*.{vue,js,css,html}' | xargs prettier -w
    else
        prettier -l '**/*.{vue,js,css,html}' | grep "$1" | xargs prettier -w
    fi
}

Instead of a flow something like:

$ prettier --check '**/*.{vue,js,css,html}'
> Checking formatting...
> [warn] src/components/WhateverFile.vue
> [warn] src/views/AnotherFile.vue
> [warn] Code style issues found in the above file. Forgot to run Prettier?

$ prettier -w src/components/WhateverFile.vue
> src/components/WhateverFile.vue 367ms
$ prettier -w src/views/AnotherFile.vue
> src/views/AnotherFile.vue 340ms

…which can be tedious for multiple files (but I still prefer over blanket updating all possible files with unregulated -w usage), now I can:

$ prettify
> src/components/WhateverFile.vue 367ms
> src/views/AnotherFile.vue 340ms

…or even just target specific directories/files(/whatever grep-able condition I want):

$ prettify src/components
> src/components/WhateverFile.vue 367ms

I prefer this approach because it allows me to see which files are changing, and/or to only target specific files or directories (e.g., if I’m committing a bunch of changes in smaller batches but still want to review the prettier diffs for learning purposes).

  • Bash
  • Shell
  • Tools
Katie Linero's profile picture
Katie Linero

Senior Software Engineer

Related Posts

Illustration of a small, determined knight in weathered medieval armor and a bucket helmet, wearing a tattered red cape, striding across barren cracked earth with sword drawn, surrounded by a swirling cloud of scattered wooden alphabet letters representing Token Guard, a GitHub Action that monitors and guards against token context bloat in AI coding agent workflows by counting the tokens in LLM instruction files committed to repositories."
February 10, 2026 • Frank Valcarcel

Token Guard: Keeping Your Agent Context Lean in CI

Token Guard is a GitHub Action that counts tokens in your agent context files and enforces limits in CI. Here’s why we check agent context into our repos, and why keeping it lean matters for team collaboration.

AWS logo centered over dark blue stylized map of Europe with concentric radar-style rings emanating from Germany, representing the AWS European Sovereign Cloud infrastructure launch for EU data sovereignty and GDPR compliance
January 26, 2026 • Frank Valcarcel

AWS Launches European Sovereign Cloud

AWS launched a physically separate cloud infrastructure in Europe with EU-only governance, zero US dependencies, and over 90 services. Here is what organizations in healthcare, finance, and government need to know about the sovereign cloud and how to evaluate it for their compliance strategy.

Let's work together

Tell us about your project and how Cuttlesoft can help. Schedule a consultation with one of our experts today.

Contact Us