Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

norman

CLI tool for testing mobile push notifications via FCM and APNs — with reusable JSON message templates.

Send real push notifications to devices from terminal: pick a template, pass a device token, done.

Status: FCM sending is fully functional. APNs support is work in progress (template routing exists, delivery is stubbed).

Requirements

Installation

git clone https://github.com/CuttyRobot/norman.git
cd norman
go build -o norman .

Optionally move the binary somewhere on PATH:

mv norman /usr/local/bin/

Setup

Before sending anything, point the CLI at your credentials:

norman setup

An interactive form will ask to:

  1. Choose a root directory to search from (defaults to the current directory).
  2. Pick FCM credentials file (Firebase service account JSON).
  3. Pick APN credentials file (optional for now — APNs delivery is in development).

The paths are saved to a config file in your user config directory:

  • macOS: ~/Library/Application Support/kratos/config.yaml
  • Linux: ~/.config/kratos/config.yaml

Check the current configuration at any time:

norman info

Usage

Create a template

norman add

Walks through an interactive form (provider type, title, body, platform options) and saves the result as a JSON template. Templates are named by provider prefix: fcm.<name>.json or apn.<name>.json — the prefix decides how the message is routed on send.

Templates also can be written by hands.

{
  "displayName": "hello-world",
  "platforms": ["android", "ios"],
  "android": {
    "priority": "high",
    "notification": {
      "channelId": "com.online.test"
    }
  },
  "notification": {
    "title": "Hello World",
    "body": "Hello World"
  }
}

Save it as e.g. fcm.hello-world.json in working directory.

Send a notification

# Fully interactive: choose a template from the current directory, then enter a token
norman send

# Template chosen, prompt only for the device token
norman send fcm.hello-world

# One-shot: template + device token
norman send fcm.hello-world <device-token>

Other commands

norman version
norman

Command reference

Command Description
norman setup Interactive configuration: pick FCM / APN credential files
norman info Show current configuration
norman add Create a new message template interactively
norman send [template] [token] Send a push notification (arguments optional — missing ones are prompted)
norman version Print version

Roadmap

  • APNs delivery
  • templates list command
  • Template clone / edit commands
  • Sending to a file with a list of tokens

About

CLI tool for testing mobile push notifications via FCM and APNs — with reusable message templates, device aliases and profiles

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages