Skip to main content

Nano-SD 关机小助手 - 基于 nanobot 二次开发,企业微信加班记录与自动关机

Project description

Nano-SD 🐱‍💻

基于 nanobot 二次开发的下班关机小助手

通过企业微信交互,识别下班意图后自动记录加班时间、更新金山文档加班表,并执行关机确认流程。

核心功能

  • 🤖 意图识别:通过 LLM 识别"我下班了"/"关机"等下班意图
  • 时间取整:按规则取整下班时间(<15→:00, 15-44→:30, >=45→next hour)
  • 📝 加班记录:自动追加到金山文档加班表
  • 💻 关机确认:60 秒倒计时,支持取消
  • 🔧 交互式配置:首次运行自动提示填配置,无需手动编辑 JSON
  • 🚀 开机自启:一键设置后台静默运行

安装

pip install Nano-SD

快速开始

1. 首次运行(自动配置)

nanosd gateway

首次运行会自动提示输入:

  • LLM API Key(支持第三方中转站)
  • 企业微信 Bot ID / Secret
  • KDocs 文档 ID(加班表)

配置完成后会保存到 ~/.nanobot/config.json

2. 启动网关

nanosd gateway

3. 设置开机自启(可选)

nanosd autostart enable

Windows 下使用 pythonw.exe 无窗口静默运行。

命令列表

命令 说明
nanosd gateway 启动网关(首次运行会自动配置)
nanosd autostart enable 设置开机自启
nanosd autostart disable 取消开机自启
nanosd autostart status 查看自启状态
nanosd onboard 初始化 workspace

触发词

在企业微信中发送以下任意消息即可触发关机助手:

  • 我下班了
  • 下班
  • 走了
  • 关机
  • 今天到此为止

配置说明

配置文件位于 ~/.nanobot/config.json,主要字段:

{
  "agents": {
    "defaults": {
      "model": "deepseek-v4-flash",
      "provider": "auto"
    }
  },
  "providers": {
    "custom": {
      "apiKey": "your-api-key",
      "apiBase": "https://tokendance.space/gateway/v1"
    }
  },
  "channels": {
    "wecom": {
      "enabled": true,
      "botId": "your-bot-id",
      "secret": "your-secret",
      "allowFrom": ["*"]
    }
  }
}

环境变量

变量名 说明 必填
KDOCS_DOCUMENT_ID 加班表文档 ID

技术说明

  • 基于:nanobot v0.2.1(MIT 协议)
  • 原作者:Xubin Ren 和 nanobot contributors
  • 二次开发:关机小助手功能

开源协议

MIT License

Copyright (c) 2025-present Xubin Ren and the nanobot contributors

Nano-SD 基于 nanobot 二次开发,保留原作者版权声明。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nano_sd-0.2.4.tar.gz (984.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nano_sd-0.2.4-py3-none-any.whl (511.0 kB view details)

Uploaded Python 3

File details

Details for the file nano_sd-0.2.4.tar.gz.

File metadata

  • Download URL: nano_sd-0.2.4.tar.gz
  • Upload date:
  • Size: 984.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nano_sd-0.2.4.tar.gz
Algorithm Hash digest
SHA256 100e5fe5ea3b3ab2fa336e976253e879ed72ef1abd81e4bb313c75eb761ce9ef
MD5 90dd96d59a31ebcd572b71f8613c6f9a
BLAKE2b-256 5d34f1cc22a0077ccc4e2b5c76686a4f75b4de1fa989f635daeb2a1f756a9951

See more details on using hashes here.

File details

Details for the file nano_sd-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: nano_sd-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 511.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nano_sd-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 24d33b6d7b2866c77f6fcac0e4c35ec21f42ef1a6b7eb8fde236d4257a60dad4
MD5 ac6c0c12865c1cef663e097c7be72b48
BLAKE2b-256 a6b4338138e83374a7ced2637a10a3a470f34a37949b30d6c338d71d4108b9ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page