use ./config.nu # Publishes a message export def publish [ topic: string message: string --title: string --priority: number --tags: list --actions: list --icon: string ] { let cfg = ( config read_file cntfy ) let request_body = ({ topic: $topic title: $title message: $message tags: ( $tags | append ( hostname ) ) priority: $priority actions: $actions icon: $icon } | to json ) http put -u $cfg.username -p $cfg.password $cfg.url $request_body }