Skip to content

Weekly

Draft your weekly timesheet from email and commits

Every Friday you get an email with a draft timesheet, grouped by client and task, built from the emails you sent and the code you committed that week.

Runs
Weekly
Apps
GitHub, Gmail
AI
Yes, uses the built-in AI allowance
Access
gmail.readonly, gmail.send; GitHub repo read

Send this to your assistant

Create a ClickRuntime automation: every Friday at 4, look at the emails I sent and my GitHub commits this week, group them into tasks per client with estimated hours, and email me the draft timesheet.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A freelance developer bills four clients by the hour. Every Friday they try to reconstruct the week from memory, scrolling through sent mail and commit history, and inevitably forget an afternoon of calls or a quick fix. Unbilled hours add up to real money over a year.

A drafted timesheet built from what they actually sent and committed gives them a starting point that misses very little. They adjust the hours, and invoices go out on time with fewer gaps.

What you get out of it

  • Fewer forgotten hours

    Every commit and sent email is a reminder of work done. Small tasks that would be forgotten end up on the timesheet.

  • Grouped by client

    Work is sorted by client and task, matching how you invoice. Copying it into an invoice is quick.

  • A draft, not a final answer

    Hours are estimates you correct. You stay in charge of what gets billed.

  • Friday admin takes minutes

    Instead of reconstructing the week, you review a list. The end of the week goes back to actual work or rest.

How it works

What happens, step by step

  1. Every Friday afternoon, ClickRuntime collects the emails you sent this week from Gmail.

  2. It also collects the commits you made in GitHub this week.

  3. AI groups everything into tasks per client and estimates the hours for each.

  4. The draft timesheet is emailed to you to check and adjust.

Before it runs live

  • Connect GitHub
  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail

What you get

RunsWeekly
Draft your weekly timesheet from email and commitstoday, 9:00Succeeded
Email · Draft timesheet, week of 13 OctNorthwind | Checkout bug fixes and release | 6.5 h Acme | Weekly call and API estimate | 2 h

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other GitHub and Gmail steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
weekly_timesheet_from_emails_and_commits.pyexample
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify, ai

def gh(method, path, **kw):
    resp = http.request(method, f"https://api.github.com{path}", headers={
        "Authorization": f"Bearer {credentials.connection('github', 'work')}", "Accept": "application/vnd.github+json"}, **kw)
    return resp.raise_for_status() or (resp.json() if resp.content else None)

AUTHOR = "your-github-username"

@on_trigger
def run(event):
    since = date.today() - timedelta(days=date.today().weekday())
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
    sent = gmail.messages().list(userId="me", q=f"in:sent after:{since:%Y/%m/%d}", maxResults=100).execute().get("messages", [])
    mails = []
    for m in sent:
        h = {x["name"]: x["value"] for x in gmail.messages().get(userId="me", id=m["id"], format="metadata",
             metadataHeaders=["To", "Subject", "Date"]).execute()["payload"]["headers"]}
        mails.append(f"{h.get('Date', '')[:16]} to {h.get('To')}: {h.get('Subject')}")
    commits = gh("GET", "/search/commits", params={"q": f"author:{AUTHOR} committer-date:>={since}", "per_page": 100})["items"]
    work = [f"{c['commit']['author']['date'][:10]} {c['repository']['full_name']}: {c['commit']['message'].splitlines()[0]}" for c in commits]
    draft = ai.generate("Sent emails:\n" + "\n".join(mails) + "\n\nCommits:\n" + "\n".join(work), max_output_tokens=1200,
                        system="Group this week's work into tasks per client with estimated hours. Output a plain-text table.").text
    notify.email_me(f"Draft timesheet, week of {since:%d %b}", draft)
    return {"emails": len(mails), "commits": len(work)}

FAQ

Common questions

How does it know which client each item is for?
From the repository name and the email recipient's domain. You can give it a list that maps domains and repositories to client names.
Does it read the content of my emails?
It reads the subject and recipient of mail you sent this week, and the first line of each message. That is enough to name the task.
Can it fill a timesheet sheet directly?
Yes. Ask for rows in a Google Sheet instead of an email, and each task is added with its date, client and hours.
What permissions does it need?
gmail.readonly, gmail.send; GitHub repo read. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Draft your weekly timesheet from email and commits” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.