Git has a --porcelain flag for “easy-to-parse” formatted outputs

Example

git status

On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   README.md

git status --porcelain

A  README.md