Taskflow is a Node.js-based automation tool designed to capture tasks from Gmail emails and append them to a tasks.md
file. It is built with modern JavaScript/TypeScript practices and integrates with the Gmail API for seamless task extraction and management.
- Email-to-Task Automation: Automatically fetches self-sent, unread emails and converts them into tasks.
- Configurable Settings: Adjust the number of emails to fetch, signature separators, and task formatting via a centralized configuration file.
- Signature Removal: Strips email signatures based on a configurable separator.
- Task Formatting: Ensures tasks are appended with consistent formatting and spacing.
- Code Coverage and Testing: Includes unit and integration tests with Vitest and Nock for robust testing.
- OAuth2 Integration: Securely connects to Gmail using OAuth2 for email access.
-
Clone the repository:
git clone https://github.com/dmitriz/taskflow.git cd taskflow
-
Install dependencies:
npm install
-
Set up Gmail API credentials:
- Place your
credentials.json
andtoken.json
files in thesecrets/
directory.
- Place your
-
Build the project:
npm run build
To fetch emails and append tasks to tasks.md
, run:
npm start
Modify the config.ts
file to adjust settings such as:
-
MAX_EMAILS_TO_FETCH
: Maximum number of emails to process. -
NEWLINES_AFTER_TASK
: Number of newlines to append after each task. -
SIGNATURE.SEPARATOR
: Text used to identify and remove email signatures.
Run the test suite with:
npm test
Generate a coverage report:
npm run coverage
auth.ts
: Handles OAuth2 authentication with Gmail.email-processor.ts
: Fetches and processes emails from Gmail.tasks-writer.ts
: Appends tasks to thetasks.md
file.remove-signature.ts
: Removes email signatures based on a separator.config.ts
: Centralized configuration for the project.tasks.md
: Stores the appended tasks.secrets/
: Containscredentials.json
andtoken.json
for Gmail API access.
- Node.js 18+ (LTS recommended)
- npm 7+
Compile TypeScript files to JavaScript:
npm run build
Ensure code quality with:
npm run lint
Contributions are welcome! Please follow these steps:
-
Fork the repository.
-
Create a feature branch:
git checkout -b feature/your-feature
-
Commit your changes:
git commit -m "Add your feature"
-
Push to your branch:
git push origin feature/your-feature
-
Open a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.