FlowCLI

Logo

A fast, minimal CLI project task manager for efficient task and project management

View the Project on GitHub AY2526S1-CS2113-W13-2/tp

Yang Zhenzhao - Project Portfolio Page

Overview

FlowCLI is a CLI application for managing tasks and projects with keyboard-driven workflows. It supports inline commands and interactive mode for users. Users can track priorities, deadlines and statuses, filter and sort instantly, then export to TXT files.

I designed and implemented the core command processing infrastructure, project/task management systems, data persistence, and status display features.

Summary of Contributions

Code Contributed

RepoSense Link

Enhancements Implemented

1. Command Processing Infrastructure

Designed and implemented the core framework using Command pattern for parsing and executing user commands. Built CommandHandler, CommandParser, and ArgumentParser to enable clean separation of concerns and support both inline and interactive modes. This extensible architecture allows easy addition of new commands.

2. Core Data Models (Project and Task Management)

Implemented fundamental classes (Project, ProjectList, Task, TaskList) forming the data management backbone with encapsulation, validation, and comprehensive exception handling.

3. Status Display System

Built visual progress tracking with completion percentages, ASCII progress bars, and context-aware motivational messages. Uses ProjectStatusAnalyzer following single-responsibility principles.

4. Data Persistence System

Implemented automatic save/load with atomic write operations (temp file + rename), data validation, special character escaping, corruption detection with backup, and retry logic. Handles edge cases: first-time runs, empty data, corrupted files, filesystem errors.

5. Exception Handling & Application Lifecycle

Created custom exception classes for meaningful error messages and implemented main application class coordinating all components.

Contributions to the User Guide

Data Persistence section • Common Workflows section • Troubleshooting section • Tips and Best Practices section • Export file format example

Contributions to the Developer Guide

Command Processing Infrastructure (architecture + sequence diagram) • Status Display System (class diagram + execution flow) • Common Classes section • Data Storage (implementation details + class diagram + data format)

Contributions to Team-Based Tasks

Set up project architecture and package structure • Designed command processing infrastructure for team use • Established code review standards • Configured GitHub Pages with _config.yml • Added documentation branding (cover images, logo)

Review/Mentoring Contributions

Established foundational architecture and coding patterns as reference implementation for the team.

Contributions Beyond the Project Team

Bug reports submitted during PE-D


Contributions to the Developer Guide (Extracts)

Command Processing Infrastructure

The command processing infrastructure forms the backbone of FlowCLI’s architecture, enabling efficient parsing and execution of user commands. This system consists of three main components:

Architecture Overview:

  1. CommandHandler: Coordinates the command execution loop, managing the application’s main control flow
  2. CommandParser: Analyzes user input and creates appropriate Command objects based on the input string
  3. ArgumentParser: Provides utility methods for extracting flags and arguments from command strings

Design Rationale:

The infrastructure follows the Command pattern, where each command encapsulates its own execution logic. This design:

Sequence Diagram:

The following sequence diagram illustrates how a user command flows through the system:

Command Processing Sequence

Implementation Details:

The ArgumentParser class provides flag-based argument extraction, which all commands leverage for consistent input handling:

public static String getArgumentForFlag(String input, String flag) 
        throws MissingArgumentException {
    // Extract argument following the specified flag
    // Throws exception if flag is present but argument is missing
}

Status Display System

The status display system provides users with comprehensive project progress tracking, featuring completion percentages, visual progress bars, and context-aware motivational messages.

Architecture Overview:

The system separates concerns through two main components:

Class Diagram:

Status Display Class Diagram

Execution Flow:

When a user executes status <projectIndex> or status --all, the following sequence occurs:

Status Command Sequence

Implementation Details:

The ProjectStatusAnalyzer calculates completion metrics:

public static ProjectStatus analyzeProject(Project project) {
    int totalTasks = project.size();
    int completedTasks = 0;
    
    for (Task task : project.getProjectTasks().getTasks()) {
        if (task.isDone()) {
            completedTasks++;
        }
    }
    
    int percentage = (totalTasks == 0) ? 0 : (completedTasks * 100) / totalTasks;
    return new ProjectStatus(totalTasks, completedTasks, percentage);
}

Display Features:

  1. Progress Bar: Visual representation using ASCII characters ([=====> ] format with percentage)
  2. Completion Percentage: Numerical progress indicator
  3. Motivational Messages: Context-aware messages based on completion level:
    • ≤25%: “You are kinda cooked, start doing your tasks!”
    • ≤50%: “You gotta lock in and finish all tasks!”
    • ≤75%: “We are on the right track, keep completing your tasks!”
    • 75%: “We are finishing all tasks!! Upzzz!”


Data Storage

The storage system provides persistent data storage for FlowCLI, automatically saving and loading all projects and tasks between sessions.

Architecture Overview:

Storage Class Diagram

Key Components:

Storage Location: ./data/flowcli-data.txt

Data Format:

PROJECT|Project Name
TASK|isDone|description|deadline|priority

Implementation Highlights:

  1. Atomic Writes: Data is written to a temp file first, then renamed atomically to prevent corruption
  2. Data Validation: All loaded data is validated; corrupted files are backed up and user warned
  3. Error Handling: Retry logic for save failures; graceful degradation on load errors
  4. Edge Cases Handled: First-time runs, empty data, corrupted files, filesystem errors

Common Classes

The common classes form FlowCLI’s core data model, providing robust project and task management capabilities.

Class Diagram:

Project and Task Class Diagram

Class Overview:

Class Relationships:

Design Principles:

These classes follow object-oriented design principles:


Contributions to the User Guide (Extracts)

Common Workflows

Here are practical examples of how to combine commands for common use cases:

Daily Task Review

# Check what's urgent
filter-tasks --priority high
status --all

# Review and update a task
list 1
update-task 1 2 --deadline 2025-11-15
mark 1 1

Weekly Planning

# See all upcoming deadlines
sort-tasks --deadline ascending

# Export high-priority items for the week
export-tasks weekly-plan.txt filter-tasks --priority high sort-tasks --deadline ascending

Project Cleanup

# Check project status
status --all

# Mark completed tasks
mark 1 1
mark 1 3

# Remove finished tasks
delete-task 1 1

Tips and Best Practices

Workflow Optimization

Task Management

Export Strategies