Skip to content

[FEATURE]: Add shfmt formatter for shell scripts #6203

@anntnzrb

Description

@anntnzrb

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Add built-in support for shfmt as a formatter for shell scripts.

Why is this needed?

  • OpenCode has bash-language-server for LSP but no shell formatter
  • shfmt is the de facto standard shell formatter (like gofmt for Go)
  • Follows existing formatter patterns

Proposed implementation

  • Extensions: .sh, .bash (NOT .zsh - shfmt doesn't support Zsh)
  • Command: shfmt -w $FILE
  • Detection: Binary check via Bun.which("shfmt")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions