Skip to main content

AtlasRun

一个简单的命令行任务队列管理工具,可以按顺序执行命令。

特性

  • 使用简单的命令行接口
  • 命令按顺序排队执行
  • 每个命令都有唯一编号
  • 自动等待前一个命令完成后再执行下一个
  • 使用SQLite存储命令队列
  • 支持指定工作目录
  • 自动创建临时bash脚本
  • 进程监控和状态管理
  • 任务历史记录和清理

安装

从源码安装

# 克隆仓库
git clone <repository-url>
cd atlasrun

# 安装依赖
pip install -r requirements.txt

# 安装开发模式
pip install -e .

依赖要求

  • Python 3.7+
  • click (命令行界面库)

使用方法

基本用法

添加命令到队列:

arun "your command here"

例如:

arun "sleep 10"
arun "echo hello world"
arun "python script.py"

第二个命令会等第一个命令完成后才开始执行。

指定工作目录

arun --dir /path/to/directory "your command"
# 或者
arun -d /path/to/directory "your command"

查看队列状态

arun --status
# 或者
arun -s

列出所有任务

arun --list
# 或者
arun -l

查看任务详情

arun --info <task_id>
# 或者
arun -i <task_id>

清理旧任务

arun --cleanup 7  # 清理7天前的已完成任务
# 或者
arun -c 7

工作原理

  1. 任务添加: 当您运行 arun "command" 时,命令会被添加到SQLite数据库中,状态为 pending

  2. 队列检查: 系统检查是否有其他任务正在运行

  3. 任务执行: 如果没有运行中的任务,系统会:

    • 创建临时bash脚本在 ~/.atlasrun/TEMP_script/ 目录
    • 切换到指定的工作目录
    • 使用 nohup 启动命令
    • 记录PID和开始时间
  4. 等待机制: 如果有其他任务在运行,新任务会等待,直到所有运行中的任务完成

  5. 状态更新: 任务完成后,状态会更新为 completed 或 failed

文件结构

~/.atlasrun/
├── tasks.db          # SQLite数据库文件
└── TEMP_script/     # 临时脚本目录
    └── task_*.sh    # 临时bash脚本

数据库结构

任务表包含以下字段:

  • id: 任务唯一标识符
  • command: 要执行的命令
  • working_dir: 工作目录
  • status: 任务状态 (pending/running/completed/failed)
  • pid: 进程ID
  • created_at: 创建时间
  • started_at: 开始时间
  • completed_at: 完成时间
  • exit_code: 退出码

开发

  1. 克隆仓库
  2. 安装依赖:pip install -r requirements.txt
  3. 安装开发模式:pip install -e .
  4. 运行测试:python test_atlasrun.py

许可证

Apache License 2.0

贡献

欢迎提交Issue和Pull Request!

Metadata

Release files for atlasrun 0.1.0

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

Source distribution (sdist)

Source distribution for atlasrun 0.1.0
File Size Uploaded Provenance Actions
atlasrun-0.1.0.tar.gz 19.3 kB Without provenance Details for atlasrun-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 39.9 kB

Release files / atlasrun-0.1.0.tar.gz

Download URL atlasrun-0.1.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0f6d1c0cb7949312bb1aa8fe1086b275df57866ec453787c05da04e2c136bb09
BLAKE2b-256 checksum
How to use checksums
7d17d25d3b6ea58b6fb130f3a65fdd6157ffd25bbcdef52c1164df4bca84f8cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / atlasrun-0.1.0-py3-none-any.whl

Download URL atlasrun-0.1.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c4c65fe4c0bbc62eddbdc56c75cbb52f931a90057b9db75c33cc259701d385e
BLAKE2b-256 checksum
How to use checksums
634da93f30bef2cc0e8d8f056f276469b09c0bdf96c639ee3bca7ad289a26e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Security for atlasrun 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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