DEV Community

Cover image for πŸš€ I built a CLI to send Firebase push notifications in one command
Anton Samoylov
Anton Samoylov

Posted on

πŸš€ I built a CLI to send Firebase push notifications in one command

Sending Firebase push notifications should be simple.

But in reality, it usually means:

  • setting up Firebase Admin SDK
  • writing boilerplate code
  • managing credentials
  • rebuilding scripts again and again

So I built a tool to fix that.


⚑ Meet FCM CLI

A lightweight CLI to send Firebase Cloud Messaging (FCM) notifications directly from your terminal, CI/CD pipelines, or backend scripts.

fcm -t TOKEN -n '{"title":"Hi","body":"Hello"}'
Enter fullscreen mode Exit fullscreen mode

That’s it.


πŸ’‘ Why I built it

As a developer, I kept running into the same problems:

  • I just wanted to test a push notification quickly
  • I didn’t want to write a full Firebase script
  • CI/CD pipelines needed a simple way to send notifications
  • Existing tools felt heavy or overcomplicated

So I created something:

  • simple
  • fast
  • developer-friendly

πŸ”₯ Features

  • πŸš€ Send notifications in seconds
  • ⚑ Works in CI/CD pipelines
  • πŸ“¦ Single binary (no dependencies)
  • 🧩 YAML config + profiles
  • πŸ” .env support
  • πŸ“„ Batch sending (--tokens-file)
  • 🎯 Supports token, topic, and conditions
  • πŸ” Retry with exponential backoff
  • πŸ€– Structured JSON output for automation
  • 🌐 Works from any language through CLI execution

🧩 YAML config (game changer)

Instead of writing scripts, you can define everything in fcm.yaml:

notification:
  title: Hello
  body: World

profiles:
  prod:
    topic: production
    notification:
      title: Deploy
      body: New version released
Enter fullscreen mode Exit fullscreen mode

Run:

fcm --config fcm.yaml --profile prod
Enter fullscreen mode Exit fullscreen mode

⚑ Batch sending

fcm --tokens-file tokens.txt -n '{"title":"Hello","body":"Batch"}'
Enter fullscreen mode Exit fullscreen mode

🧠 Use cases

  • Testing push notifications
  • CI/CD automation
  • Backend scripts
  • Debugging Firebase messaging
  • Bulk notifications

🎯 Goal

Make push notifications:

  • simpler
  • faster
  • less painful

πŸ“¦ Installation

curl -fsSL https://raw.githubusercontent.com/interdev7/fcm-cli/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

or:

brew tap interdev7/fcm
brew install fcm
Enter fullscreen mode Exit fullscreen mode

❀️ Open Source

The project is fully open-source.

If it saves you time or helps your workflow β€” consider supporting it.


πŸ”— GitHub

πŸ‘‰ https://github.com/interdev7/fcm-cli


πŸ’¬ Feedback

Would love to hear what you think πŸ‘‡

Top comments (0)