Blog.

Automating Google Tasks with google-tasks1-cli and Warp's Agentic Mode

Cover Image for Automating Google Tasks with google-tasks1-cli and Warp's Agentic Mode
Josh Peterson
Josh Peterson

Managing tasks in Google Tasks can be a repetitive chore, especially when you want to organize them into specific lists and avoid duplicates. Fortunately, with google-tasks1-cli, a command-line tool for interacting with Google Tasks, and Warp's agentic mode powered by Claude 3.7 Sonnet, you can automate this process directly from your terminal. In this blog post, I’ll guide you through setting up these tools, configuring a Google Developer Console project, and creating an AI-driven workflow to efficiently manage your tasks. This guide is designed for a general technical audience, with all personal specifics removed and examples generalized.

Introduction to the Tools

  • google-tasks1-cli: A Rust-based CLI tool that lets you interact with Google Tasks via the Tasks API. It supports commands like listing task lists, viewing tasks, and adding new ones.
  • Warp's Agentic Mode: Warp is a modern terminal emulator with AI-powered features. Its agentic mode, using models like Claude 3.7 Sonnet, can automate workflows by interpreting prompts and executing commands. Warp offers a free tier with 150 AI requests per month, and a paid plan at $15/month gets you 1,000 AI requests, making it accessible for both casual users and those needing more frequent automation.

Together, these tools allow you to automate task categorization, check for duplicates, and add tasks to Google Tasks—all from the command line.

Step 1: Installing google-tasks1-cli

Since google-tasks1-cli is built with Rust, you’ll need Rust and Cargo (Rust’s package manager) installed. If you don’t have them, install Rust from rustup.rs. Once Rust is ready, install google-tasks1-cli with:

cargo install google-tasks1-cli

Verify the installation by checking the version:

google-tasks1-cli --version

You should see the version number, confirming that the tool is installed correctly.

Step 2: Setting Up a Google Developer Console Project

To use google-tasks1-cli, you need to set up a project in the Google Developer Console and generate OAuth credentials. Here’s how:

  1. Create a Project:

    • Visit the Google Cloud Console.
    • Click "New Project," name it (e.g., "Tasks CLI Project"), and create it.
  2. Enable the Tasks API:

    • Go to "APIs & Services" > "Library."
    • Search for "Tasks API" and click "Enable."
  3. Configure the OAuth Consent Screen:

    • Navigate to "APIs & Services" > "OAuth consent screen."
    • Choose "External" as the user type (suitable for personal use).
    • Enter required details: app name (e.g., "Tasks CLI"), your email for support and developer contact.
    • Add the scope https://www.googleapis.com/auth/tasks for task management.
    • Set the status to "Testing" and add your email as a test user to bypass verification.
  4. Generate OAuth Credentials:

    • Go to "APIs & Services" > "Credentials."
    • Select "Create Credentials" > "OAuth client ID."
    • Choose "Desktop app" as the type, name it (e.g., "Tasks CLI Desktop"), and download the JSON file with your client ID and secret.
  5. Store the Credentials:

    • Save the JSON file to ~/.google-service-cli/tasks1-secret.json. Create the directory if it doesn’t exist:

      mkdir -p ~/.google-service-cli
      
    • Move the file (adjust the filename as needed):

      mv ~/Downloads/client_secret_*.json ~/.google-service-cli/tasks1-secret.json
      

This setup prepares google-tasks1-cli to authenticate with your Google account.

Step 3: Authenticating google-tasks1-cli

Run a command that requires Google Tasks access to trigger authentication:

google-tasks1-cli tasklists list

A browser window will open, prompting you to log in with your Google account (use the same email listed as a test user). Grant permissions, and the tool will store an authentication token locally for future use.

Troubleshooting Authentication Issues

  • "This app is blocked": Ensure the app is in "Testing" mode and your email is a test user.
  • "Error 401: deleted_client": Verify that the custom credentials in tasks1-secret.json are correctly set up.

If successful, google-tasks1-cli tasklists list will display your task lists, confirming the setup.

Step 4: Automating Tasks with Warp's Agentic Mode

Warp’s agentic mode, using Claude 3.7 Sonnet, lets you automate task management by generating and executing google-tasks1-cli commands based on a prompt. Here’s how to set it up:

Selecting the Model

In Warp, go to the AI settings and choose Claude 3.7 Sonnet. Its reasoning skills are perfect for categorizing tasks and avoiding duplicates.

Crafting the Prompt for Warp's Agentic Mode

To leverage Warp's agentic mode with Claude 3.7 Sonnet, you need a clear and concise prompt that guides the AI in managing your Google Tasks. Here’s an example prompt:

Use tasks1 to retrieve my Google Tasks lists, using the help to understand syntax, assign each task to the most appropriate list, and add them if they don’t already exist.

Tasks to Assign
"Buy groceries"
"Finish report"
"Read book"
"Go for a run"
"Call friend"

This prompt instructs Warp to dynamically fetch your task lists, assign tasks intelligently, and prevent duplicates by checking existing tasks before adding new ones.

Step 5: Verifying the Results

Check your tasks in the Google Tasks app or at tasks.google.com. Each task should appear in its assigned list, with no duplicates.

Conclusion

With google-tasks1-cli and Warp’s agentic mode, you can streamline Google Tasks management from your terminal. This setup is perfect for developers, productivity enthusiasts, or anyone who enjoys automating repetitive tasks. Customize the prompt to match your own lists and keywords for a tailored experience.

Tip: Double-check your tasks in the Google Tasks app or web interface to ensure everything worked as expected.

Happy automating!