mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-29 01:56:37 +08:00
* feat(cli): add unified Commander CLI for QingLong 2.x * fix(cli): publish via npm and address security review feedback * ci(cli): package npm artifacts and remove evaluation collateral * test(cli): use a fixed shell fixture for log retention * refactor(cli): separate remote npm client from panel tools * feat(cli): cover active panel OpenAPI resources * docs(cli): unify authentication and skill guidance * refactor(cli): isolate internal commands and generate Commander help * refactor(cli): organize remote and internal modules by responsibility * ci(cli): publish verified npm archives from master * fix(cli): publish under the whyour npm scope * ci: use npm trusted publishing for both packages * docs: introduce the published CLI on the project homepage * fix(cli): preserve server log truncation and correct login hints * fix(cli): accept dashboard record request bodies * fix(cli): preserve stdin for local task execution * fix(cli): resolve task executables after changing directory * fix(cli): preserve shell function tasks and sanitize test failures * fix(cli): preserve shell hook state and resolve workdir after hooks * fix(cli): preserve cleanup across shared shell task timeouts * fix(cli): isolate shell control descriptors and reap timed-out descendants
139 lines
6.2 KiB
Markdown
139 lines
6.2 KiB
Markdown
<div align="center">
|
||
<img width="100" src="https://user-images.githubusercontent.com/22700758/191449379-f9f56204-0e31-4a16-be5a-331f52696a73.png">
|
||
|
||
<h1 align="center">青龙</h1>
|
||
|
||
简体中文 | [English](./README-en.md)
|
||
|
||
支持 Python3、JavaScript、Shell、Typescript 的定时任务管理平台
|
||
|
||
Timed task management platform supporting Python3, JavaScript, Shell, Typescript
|
||
|
||
[![npm version][npm-version-image]][npm-version-url] [![docker pulls][docker-pulls-image]][docker-pulls-url] [![docker stars][docker-stars-image]][docker-stars-url] [![docker image size][docker-image-size-image]][docker-image-size-url]
|
||
|
||
[npm-version-image]: https://img.shields.io/npm/v/@whyour/qinglong?style=flat
|
||
[npm-version-url]: https://www.npmjs.com/package/@whyour/qinglong?activeTab=readme
|
||
[docker-pulls-image]: https://img.shields.io/docker/pulls/whyour/qinglong?style=flat
|
||
[docker-pulls-url]: https://hub.docker.com/r/whyour/qinglong
|
||
[docker-stars-image]: https://img.shields.io/docker/stars/whyour/qinglong?style=flat
|
||
[docker-stars-url]: https://hub.docker.com/r/whyour/qinglong
|
||
[docker-image-size-image]: https://img.shields.io/docker/image-size/whyour/qinglong?style=flat
|
||
[docker-image-size-url]: https://hub.docker.com/r/whyour/qinglong
|
||
|
||
[Demo](http://demo.qinglong.online:4433/) / [Issues](https://github.com/whyour/qinglong/issues) / [Telegram Channel](https://t.me/jiao_long) / [Buy Me a Coffee](https://www.buymeacoffee.com/qinglong)
|
||
|
||
[演示](http://demo.qinglong.online:4433/) / [反馈](https://github.com/whyour/qinglong/issues) / [Telegram 频道](https://t.me/jiao_long) / [打赏开发者](https://user-images.githubusercontent.com/22700758/244744295-29cd0cd1-c8bb-4ea1-adf6-29bd390ad4dd.jpg)
|
||
</div>
|
||
|
||

|
||
|
||
## 功能
|
||
|
||
- 支持多种脚本语言(python3、javaScript、shell、typescript)
|
||
- 支持在线管理脚本、环境变量、配置文件
|
||
- 支持在线查看任务日志
|
||
- 支持秒级任务设置
|
||
- 支持系统级通知
|
||
- 支持暗黑模式
|
||
- 支持手机端操作
|
||
- 支持通过 [远程 CLI 与 Agent Skill](#远程-cli-与-agent-skill) 管理面板
|
||
|
||
## 版本
|
||
|
||
### docker
|
||
|
||
`latest` 镜像是基于 `alpine` 构建,`debian` 镜像是基于 `debian-slim` 构建。如果需要使用 `alpine` 不支持的依赖,建议使用 `debian` 镜像
|
||
|
||
**⚠️ 重要提示**: 如果您需要以**非 root 用户**运行 Docker,请使用 `debian` 镜像。Alpine 的 `crond` 需要 root 权限。
|
||
|
||
```bash
|
||
docker pull whyour/qinglong:latest
|
||
docker pull whyour/qinglong:debian
|
||
```
|
||
|
||
使用 `debian` 镜像以非 root 用户运行时,需指定 `--user qinglong`:
|
||
|
||
```bash
|
||
docker run -d \
|
||
-v /path/to/ql/data:/ql/data \
|
||
-p 5700:5700 \
|
||
--user qinglong \
|
||
--name qinglong \
|
||
whyour/qinglong:debian
|
||
```
|
||
|
||
### npm
|
||
|
||
npm 版本支持 `debian/ubuntu/alpine` 系统,需要自行安装 `node/npm/python3/pip3/pnpm`
|
||
|
||
```bash
|
||
npm i @whyour/qinglong
|
||
```
|
||
|
||
## 部署
|
||
|
||
[查看文档](https://qinglong.online/guide/getting-started/installation-guide)
|
||
|
||
## 内置 API
|
||
|
||
[查看文档](https://qinglong.online/guide/user-guide/built-in-api)
|
||
|
||
## 内置命令
|
||
|
||
[查看文档](https://qinglong.online/guide/user-guide/basic-explanation)
|
||
|
||
## 远程 CLI 与 Agent Skill
|
||
|
||
使用独立 npm 包 [@whyour/qinglong-cli](https://www.npmjs.com/package/@whyour/qinglong-cli),可以从本机终端或自动化流程管理远程青龙面板。支持任务与订阅的创建、修改、运行和日志查看,以及应用、环境变量、脚本、配置、依赖等 OpenAPI 资源;JSON 输出便于脚本和 AI Agent 使用。
|
||
|
||
需要 Node.js >=22.12,推荐 Node.js 24。安装后使用 `ql` 命令:
|
||
|
||
```bash
|
||
npm install -g @whyour/qinglong-cli
|
||
ql login --url https://ql.example.com
|
||
ql auth status --json
|
||
ql task list --json
|
||
ql subscription list --json
|
||
ql --help
|
||
```
|
||
|
||
在面板「系统设置 → 应用设置」创建应用并授予所需权限,登录时按提示输入 Client ID/Secret;也支持通过 `QL_URL` 和 `QL_ACCESS_TOKEN` 使用已有令牌。各命令支持 `--help`,`QL_LANG=en` 可切换英文帮助。
|
||
|
||
npm CLI 用于远程管理。面板内置 `ql` 同样使用这个命令名,已有面板的机器请使用独立安装目录,避免覆盖内置命令。本机脚本执行和运维见 [面板内部工具](cli/LOCAL.md)。
|
||
|
||
[CLI 中文说明](cli/README.md) · [English guide](cli/README.en.md) · [完整命令参考](cli/skills/qinglong-cli/references/openapi.md)
|
||
|
||
包内附带 [远程管理 Skill](cli/skills/qinglong-cli/SKILL.md),涵盖认证、命令选择和操作结果检查,可供 AI Agent 使用。本机执行与运维另见 [内部 Skill](cli/skills/qinglong-local/SKILL.md)。
|
||
|
||
## 开发
|
||
|
||
```bash
|
||
git clone https://github.com/whyour/qinglong.git
|
||
cd qinglong
|
||
cp .env.example .env
|
||
# 推荐使用 pnpm https://pnpm.io/zh/installation
|
||
npm install -g pnpm@8.3.1
|
||
pnpm install
|
||
pnpm start
|
||
```
|
||
|
||
打开你的浏览器,访问 <http://127.0.0.1:5700>
|
||
|
||
## 链接
|
||
|
||
- [nevinee](https://gitee.com/evine)
|
||
- [crontab-ui](https://github.com/alseambusher/crontab-ui)
|
||
- [Ant Design](https://ant.design)
|
||
- [Ant Design Pro](https://pro.ant.design/)
|
||
- [Umijs](https://umijs.org)
|
||
- [darkreader](https://github.com/darkreader/darkreader)
|
||
- [admin-server](https://github.com/sunpu007/admin-server)
|
||
|
||
## 名称来源
|
||
|
||
青龙,又名苍龙,在中国传统文化中是四象之一、[天之四灵](https://zh.wikipedia.org/wiki/%E5%A4%A9%E4%B9%8B%E5%9B%9B%E7%81%B5)之一,根据五行学说,它是代表东方的灵兽,为青色的龙,五行属木,代表的季节是春季,八卦主震。苍龙与应龙一样,都是身具羽翼。《张果星宗》称“又有辅翼,方为真龙”。
|
||
|
||
《后汉书·律历志下》记载:日周于天,一寒一暑,四时备成,万物毕改,摄提迁次,青龙移辰,谓之岁。
|
||
|
||
在中国[二十八宿](https://zh.wikipedia.org/wiki/%E4%BA%8C%E5%8D%81%E5%85%AB%E5%AE%BF)中,青龙是东方七宿(角、亢、氐、房、心、尾、箕)的总称。 在早期星宿信仰中,祂是最尊贵的天神。 但被道教信仰吸纳入其神系后,神格大跌,道教将其称为“孟章”,在不同的道经中有“帝君”、“圣将”、“神将”和“捕鬼将”等称呼,与白虎监兵神君一起,是道教的护卫天神。
|