mediashare/marathon

此软件包最新版本(1.2.6)的许可信息不可用。

Marathon 是一个用 PHP 和 Symfony 编写的命令行工具,可以帮助您高效地管理项目中的任务时间。

1.2.6 2024-09-30 14:52 UTC

README

Marathon GitHub Release Marathon GitHub pull requests

介绍

Marathon 是一个用 PHP 和 Symfony 编写的命令行工具,可以帮助您高效地 管理项目中的任务时间。它通过提交历史记录提供维护项目相关活动的全面解决方案。

特性

  • 提交:轻松将时间条目与项目提交关联起来,以维护开发过程中采取行动的详细历史记录。
  • 高效的时间管理:通过无缝集成到版本控制系统,简化您的工作流程。专注于开发,同时准确记录每个任务花费的时间。
  • Symfony 框架:建立在强大的 Symfony 框架之上,确保您的项目管理需求在可靠性、可扩展性和易于维护方面。

安装

Composer

基本

composer require mediashare/marathon
./vendor/mediashare/marathon/bin/marathon <command>

全局

composer global require mediashare/marathon
marathon <command>

Docker

Dockerfile

git clone https://github.com/Mediashare/marathon
cd marathon
docker build -t marathon .
docker run -it marathon <command>

二进制

curl --output marathon https://raw.githubusercontent.com/Mediashare/marathon/main/marathon
chmod 755 marathon
sudo cp marathon /usr/local/bin/marathon
marathon <command>

用法

以下是一些使用 Marathon 的示例

  • 要检查您在一个项目上的时间,您可以为项目的每个阶段创建一个任务。
  • 要检查您在重复任务上的时间,您可以为任务创建一个开始日期和结束日期。
  • 要检查您与客户或供应商在任务上的时间,您可以将此信息添加到任务中。

命令

  marathon task:list                        Displaying the tasks list
  marathon task:start <?task-id>            Starting step of task
  marathon task:stop <?task-id>             Stoping step of task
  marathon task:status <?task-id>           Displaying status of task
  marathon task:archive <task-id>           Archiving the task by ID
  marathon task:delete <task-id>            Deleting the task by ID

  marathon commit:create <?commit-message>  Creating new commit into task
  marathon commit:edit <commit-id>          Editing the commit from task
  marathon commit:delete <commit-id>        Deleting the commit from task
  
  marathon git:gitignore                    Adding .marathon rule into .gitgnore
  marathon version:upgrade                  Upgrading to latest version of Marathon

任务工作流程

创建任务

marathon task:start # Start a task without specifying a name.
marathon task:start 123 # Start a task with the specified ID (e.g., ID 123).
marathon task:start --name "Feature Implementation" # Start a task and set the name to "Feature Implementation".
marathon task:start --new # Start a completely new task without specifying a name.
marathon task:start --duration 2h # Start a task and sets the duration of the current step to 2 hours.
marathon task:start --remaining 4h # Start a task and sets the remaining time of the task to 4 hours.
marathon task:start 456 --new --name "New feature" --duration 30min # Start a completely new task with the ID 456 and sets the duration of the current step to 30 minutes.

创建提交

marathon commit:create # Create a new commit without specifying a message.
marathon commit:create "Initial commit" # Create a new commit for the current task with the specified message.
marathon commit:create -E # Open default editor for write a message and commit.
marathon commit:create "This is a very long commit message describing the changes made in this commit. It covers multiple lines and provides detailed information about the updates." # Create a new commit with a long and detailed commit message.
marathon commit:create "Your commit message" --duration 1h # Create a new commit with a message and sets its duration to 1 hour.
marathon commit:create "Test update older task with ID 123 or create it" --task-id 123 # Create a new commit for the task specified by the ID.
marathon commit:create "Rollback" --duration "-1hour" # Create a new commit with a message and sets its duration to rollback (negative duration).

编辑提交

marathon commit:edit <commit-id> --message "Updated message" --duration 30min # Edit the message and duration of a specific commit.
marathon commit:edit 456 -E # Open default editor for edit a message for commit ID 456.
marathon commit:edit 456 --duration 1h # Edit the commit with ID 456 and updates its duration to 1 hour.
marathon commit:edit 300 --task-id 123 --message "Update commit with ID 300 from task ID 123" # Edit the last commit from the task specified by the ID.

删除提交

marathon commit:delete <commit-id> # Delete the commit with ID from the current task.
marathon commit:delete 456 # Delete the commit with ID 123 from the task specified by the ID 111 and save it into the configuration.
marathon commit:delete 300 --task-id 123 # Delete the commit with ID 300 from the task specified by the ID 123.

显示任务状态

marathon task:status # Display the status of the current task.
marathon task:status 123 # Display the status of the task with ID 123.

停止任务步骤

marathon task:stop # Stop the current step of the task with the default duration.
marathon task:stop <?task-id> # Stop the task step with task ID.
marathon task:stop 123 --duration 1h # Stop the task step with ID 123 and updates its duration to 1 hour.

归档或删除任务

marathon task:archive <task-id> # Archive the task with ID without stopping the current step.
marathon task:archive 123 # Archive the task with ID 123.

# or delete the task

marathon task:delete <task-id> # Delete the task with ID.
marathon task:delete 123 # Delete the task with ID 123.

归档或删除当前任务。

显示任务列表

marathon task:list # Display the list of tasks.

其他命令

将 Marathon 规则添加到 .gitignore

marathon git:gitignore # Add the .marathon rule to your project .gitignore file.

升级 Marathon 到最新版本

marathon version:upgrade # Upgrade Marathon to the latest version.

配置选项

Marathon 提供了几个配置选项,您可以使用给定的参数自定义配置文件。

  • --config-path:指定 JSON 配置文件的路径。
  • --config-datetime-format:设置显示的日期格式。
  • --config-datetime-zone:设置使用的 UTC 时区。
  • --config-task-dir:设置包含任务文件的目录路径。
marathon task:start --config-path=/path/to/config/file --config-datetime-format="d/m/Y H:i:s" --config-datetime-zone="Europe/London" --config-task-dir=/path/to/tasks/directory

请尽情探索并充分利用 Marathon,以简化您的项目管理工作流程!

贡献

Marathon 是一个开源项目。您可以通过提交错误修复、改进或新功能来为项目做出贡献。

要为项目做出贡献,您可以按照以下说明操作

  • 克隆 marathon GitHub 仓库
  • 为您的贡献创建一个分支
  • 进行您的更改
  • 使用 bin/phpunit 测试您的更改
  • 使用 box compile 构建您的 bin
  • 提交拉取请求

使用 Box 构建bin

Box 安装

Box2 用于从 PHP 项目生成二进制文件。 PHP >=8.1 是必需的。

composer global require humbug/box
box

Box 用法

composer install --no-scripts --no-autoloader
composer dump-autoload --optimize
box compile

结论

Marathon 是一个简单而有效的工具,可以帮助您更好地管理时间。如果您正在寻找一个免费的开源时间追踪器,Marathon 是一个好的选择。