Skip to main content

barkcli

一个基于 BarkNotificator 的命令行工具,支持通过命令行发送推送通知到 Bark 应用。

安装

从realese页下载:

pip install barkcli-.*.tar.gz

或从源码目录运行:

pip install .

使用方法

设置 Token

你可以通过环境变量 BARK_TOKEN 设置设备 token:

export BARK_TOKEN=your_device_token

也可以通过 --token 参数传入。

命令格式

支持位置参数和具名参数:

位置参数(按顺序)

bark "Title" "Message content" "https://icon.url" "https://target.url" "category" "alarm.caf"

具名参数

bark --title "Hello" --content "World" \
     --icon_url "https://..." \
     --target_url "https://..." \
     --category "group1" \
     --ringtone "alarm.caf"

参数说明

  • title: 推送标题
  • content: 推送内容
  • icon_url: 图标 URL
  • target_url: 点击跳转 URL
  • category: Bark 分类(用于分组显示)
  • ringtone: 铃声名称(如:alarm.caf, bell.caf)

打包成压缩文件

在修正后的 barkcli 项目目录下执行:

python setup.py sdist

会在 dist/ 目录生成一个新的 barkcli-x.x.x.tar.gz 文件

重新安装到系统

pip install --force-reinstall dist/barkcli-*.tar.gz

Metadata

Release files for barkcli 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for barkcli 1.0.5
File Size Uploaded
barkcli-1.0.5.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for barkcli 1.0.5
File Interpreter ABI Platform
barkcli-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / barkcli-1.0.5.tar.gz

Download URL barkcli-1.0.5.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ee009d203897dfe36b3a776f1edad6a751cd0a774eb8b7fd19c978ac850a254
BLAKE2b-256 checksum
How to use checksums
878742238669e38d300c39ac326fc7b1739cabbf3f8be1310d37723abda8c120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.1

Release files / barkcli-1.0.5-py3-none-any.whl

Download URL barkcli-1.0.5-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4934f78ff105ea404ad474120d2c44fe08a8ba12bc0a84e3636b21200402d5f3
BLAKE2b-256 checksum
How to use checksums
8a5de650f320c98093751da9e03203251410699b08449db4e21597783fb667b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.1

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page