oclif: The Open CLI Framework
  • Getting Started
  • API Reference
  • Blog
  • GitHub

›How to

Getting Started

  • Introduction
  • Features
  • FAQs
  • Generator Commands

Architecture

  • Command Execution
  • Plugin Loading

API Reference

  • Commands
  • Command Arguments
  • Command Flags
  • Configuration
  • Topics
  • Topic Separators
  • Hooks
  • Plugins
  • Help Classes
  • Error Handling
  • JSON

How to

  • Release
  • Testing
  • Running Commands Programmatically
  • Aliases
  • Custom Base Class
  • Prompting
  • Spinner
  • Table
  • Notifications
  • Debugging
  • Flexible Taxonomy
  • Global Flags
  • Single Command CLI
  • ESM

Also See

  • Examples
  • External Links
  • Related Repositories
  • How We Work
  • Feedback
Edit

Notifications

Use node-notifier for cross-platform OS notifications.

Example:

import {Command} from '@oclif/core'
import * as notifier from 'node-notifier'

export class MyCommand extends Command {
  async run() {
    notifier.notify({
      title: 'My notification',
      message: 'Hello!'
    })
  }
}

Demo:

notification demo

node-notifier is capable of much more such as adding images, sounds, and even buttons and user input.

Last updated on 2/22/2023
← TableDebugging →
Made with 💜 by Salesforce — MIT License