Use native macOS screencapture command to capture full-screen content.
Screenshot command
mkdir -p screenshots && screencapture -x screenshots/screenshot-$(date +%Y-%m-%d-%H%M%S).png
-x parameter disables the screenshot sound effect. The screenshot is saved to the screenshots/ directory under the project root directory.
Notes
- On first use, macOS may need to grant the terminal screen recording permission (System Settings > Privacy & Security > Screen Recording)