Skip to main content

A powerful framework for managing long-running AI Agent tasks

Project description

LRA - Long-Running Agent Tool

一个强大的长时 AI Agent 任务管理框架

基于 Anthropic 论文 Effective Harnesses for Long-Running Agents 的最佳实践实现。

PyPI version License: MIT Python

English | 中文


中文

安装

pip install long-run-agent

安装后,运行初始化:

python3 -m long_run_agent

这会启动交互式安装向导:

  • 🌐 语言选择(中文/英文)- 方向键切换,回车确认
  • 🔧 自动配置 PATH 环境变量
  • ✅ 配置完成后立即可用 lra 命令
  • 🤖 显示 AI Agent 引导提示词

💡 提示:如果提示 command not found,请运行 source ~/.zshrc 或重新打开终端。


🤖 给 AI Agent 使用(30秒上手)

第一步:初始化项目

cd /path/to/your/project
lra project create --name "我的项目"

第二步:告诉 AI Agent

每次开始工作,先读取 .long-run-agent/feature_list.json 了解项目进度和待开发功能。完成后更新对应 Feature 的状态。

就这样!AI Agent 会自动拥有跨会话的项目记忆。


快速命令

lra version                           # 查看版本
lra project create --name "我的项目"   # 初始化项目
lra feature create "登录功能" -p P0    # 创建功能
lra feature list                      # 功能列表
lra feature status <id> --set completed  # 标记完成
lra stats                             # 项目统计

解决的问题

挑战 LRA 如何解决
上下文窗口限制 状态持久化,AI 随时可读
过早完成 状态流转强制验证
一次性做太多 Feature 粒度拆分
状态追踪困难 lra feature list 一目了然
需求文档混乱 标准模板 + 自动校验

核心功能

  • 🔄 自动升级 - 版本检测 + 数据迁移
  • 📋 7 状态管理 - pending → completed 完整流转
  • 📝 需求文档 - 标准模板 + 完整性校验
  • 📊 代码变更记录 - 按 Feature 分文件存储
  • 📜 操作审计 - 完整操作日志追溯
  • 🔀 Git 集成 - Commit/Branch 自动关联

CLI 命令速查

# 初始化
lra init                    # 安装向导
lra version                 # 版本信息

# 项目
lra project create --name <name>
lra project list

# Feature
lra feature create <title> [--priority P0|P1|P2]
lra feature list
lra feature status <id> [--set <status>]

# 需求文档
lra spec create <feature_id>
lra spec validate <feature_id>
lra spec list

# 记录
lra records --feature <id>
lra records --file <path>

# 其他
lra stats / logs / code check / git / statuses

与 AI Agent 协作示例

# 告诉 AI Agent:

请读取 .long-run-agent/feature_list.json,告诉我:
1. 当前有哪些 pending 状态的功能
2. 哪些是 P0 优先级
3. 继续开发哪个功能

完成后更新状态:lra feature status <id> --set completed

环境要求

依赖 版本
Python ≥ 3.8
Git ≥ 2.0(可选)

链接


English

Installation

pip install long-run-agent

After installation, run the setup:

python3 -m long_run_agent

This will:

  • 🌐 Let you choose language (Chinese/English)
  • 🔧 Auto-configure PATH environment variable
  • ✅ After setup, lra command is ready to use
  • 🤖 Display AI Agent guidance prompt

💡 Tip: If you see command not found, run source ~/.zshrc or restart your terminal.


🤖 For AI Agents (30 seconds)

Step 1: Initialize Project

cd /path/to/your/project
lra project create --name "My Project"

Step 2: Tell Your AI Agent

At the start of each session, read .long-run-agent/feature_list.json to understand current progress and pending features. Update Feature status when done.

That's it! Your AI Agent now has cross-session project memory.


Quick Commands

lra version                            # Show version
lra project create --name "My Project" # Initialize project
lra feature create "Login" -p P0       # Create feature
lra feature list                       # List features
lra feature status <id> --set completed
lra stats                              # Project statistics

Core Features

  • 🔄 Auto-upgrade - Version detection + data migration
  • 📋 7-state management - pending → completed workflow
  • 📝 Requirements docs - Templates + validation
  • 📊 Code change records - Per-feature storage
  • 📜 Operation audit - Complete logs
  • 🔀 Git integration - Commit/Branch tracking

CLI Reference

# Init
lra init / version

# Project
lra project create --name <name>
lra project list

# Feature
lra feature create <title> [--priority P0|P1|P2]
lra feature list / status <id>

# Spec
lra spec create / validate / list

# Records
lra records --feature <id> / --file <path>

# Utils
lra stats / logs / code check / git / statuses

Requirements

Dependency Version
Python ≥ 3.8
Git ≥ 2.0 (optional)

Links


Made with ❤️ for AI Agent Developers

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

long_run_agent-2.0.5.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

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

long_run_agent-2.0.5-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file long_run_agent-2.0.5.tar.gz.

File metadata

  • Download URL: long_run_agent-2.0.5.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for long_run_agent-2.0.5.tar.gz
Algorithm Hash digest
SHA256 f53ef953b3f9563ae4aaea5c015afccea1fa920c92cf8280ac379b8fdd2de028
MD5 ba59c03bceb614e2979f8b71388883b6
BLAKE2b-256 32bd31f4275ca7607b1b70605038215f7717845f07fd0f7e0bc76fb4e45f14d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for long_run_agent-2.0.5.tar.gz:

Publisher: publish.yml on hotjp/long-run-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file long_run_agent-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: long_run_agent-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for long_run_agent-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a6e5392126f8524a636105e80e6bcb13bd7ce23dd42ae6872b93422270d09ca
MD5 48bc9a45756cea129521d9d10139c123
BLAKE2b-256 efcba040c8142537b3bbec7a32a45a5ead04d8a39be680edfa58b0faa39e5864

See more details on using hashes here.

Provenance

The following attestation bundles were made for long_run_agent-2.0.5-py3-none-any.whl:

Publisher: publish.yml on hotjp/long-run-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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