Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to WakaTime

Scalekit connector
Open markdown

The WakaTime connector lets your AI agent act in each user's WakaTime account. Each user signs in to WakaTime once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 35 tools.

Tools
35
What they doRead · write · destructive
32 · 3 · 032 read3 write0 destructive
Users sign in with
OAuth app
Your own WakaTime app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the WakaTime connection

    In AgentKit > Connections, create a WakaTime connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    WakaTime connections use your own OAuth app. Register one with WakaTime and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the WakaTime connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'wakatime'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize WakaTime:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'wakatime_get_current_user',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • wakatime_get_all_time_since_todayRetrieve the total coding time logged since the account was created, optionally for one project.Read-only

    Get All Time Since Today

    Retrieve the total coding time logged since the account was created, optionally for one project. Returns total seconds, a human-readable text, daily average, the date range and a freshness flag; a 202 status means stats are still being calculated. Use this for a lifetime total. Use get_stats for a specific range or breakdown.

    Inputs

    projectstring
    Show the all-time total for this project only. Omit for the total across all projects.
  • wakatime_get_commitRetrieve a single commit of a WakaTime project by hash.Read-only

    Get Commit

    Retrieve a single commit of a WakaTime project by hash. Returns the commit's message, author, committer, timestamps and total coding seconds, plus project and repository details. Use this when you already have a commit hash. Use list_commits to find commits.

    Inputs

    hashstringrequired
    Revision control hash of the commit, as returned by list_commits.
    projectstringrequired
    Name of the WakaTime project, as returned by list_projects.
    branchstring
    Branch to filter the commit to. Defaults to the repository's default branch when omitted.
  • wakatime_get_current_userRetrieve the authenticated WakaTime user's profile.Read-only

    Get Current User

    Retrieve the authenticated WakaTime user's profile. Returns id, username, display name, timezone, plan, last heartbeat details, and public profile settings. Email is included only when the email scope was granted. Use this to identify the connected account or read its timezone before querying stats. Use get_stats for coding activity.

    Inputs

    This tool takes no inputs.

  • wakatime_get_custom_rules_progressCheck the progress of a background job applying custom rules to past coding stats.Read-only

    Get Custom Rules Progress

    Check the progress of a background job applying custom rules to past coding stats. Returns the job id and a progress percentage from 0 to 100. Use the job_id returned when custom rules were last updated.

    Inputs

    job_idstringrequired
    ID of the custom-rules job to check.
  • wakatime_get_durationsRetrieve the user's coding activity for one day as an array of durations.Read-only

    Get Durations

    Retrieve the user's coding activity for one day as an array of durations. Returns each duration with project, start time and length in seconds, sliced by project unless slice_by is set. Use this for a detailed timeline of a single day. Use get_summaries for several days or get_heartbeats for raw activity events.

    Inputs

    datestringrequired
    Day to fetch durations for, as YYYY-MM-DD. The result covers 12am to 11:59pm in the user's timezone (or the timezone input when the endpoint accepts one).
    branchesstring
    Comma-separated list of branch names to include. Omit to include all branches.
    projectstring
    Only include activity for this project name. Omit to include all projects.
    slice_bystring
    Primary key used to slice durations. One of project, entity, language, dependencies, os, editor, category, machine. The API defaults to project when omitted.one of projectentitylanguagedependenciesoseditorcategorymachine
    timeoutinteger
    Keystroke timeout in minutes used when joining heartbeats into durations. Defaults to the user's own keystroke timeout setting when omitted.
    timezonestring
    Timezone for the requested dates, in Olson format such as America/Los_Angeles. Defaults to the user's timezone when omitted.
    writes_onlyboolean
    When true, only count time from saving files. Defaults to the user's writes_only setting when omitted.
  • wakatime_get_goalRetrieve one coding goal by id.Read-only

    Get Goal

    Retrieve one coding goal by id. Returns the goal's id, delta, target seconds, status, average status and per-period chart data from cached data; only an empty chart_data is returned while the cache warms. Use list_goals to find goal ids.

    Inputs

    goalstringrequired
    ID of the goal, as returned by list_goals.
  • wakatime_get_insightRetrieve a single insight about the user's coding activity for a time range.Read-only

    Get Insight

    Retrieve a single insight about the user's coding activity for a time range. Returns the data for the chosen insight type, such as weekdays, days, ai_days, best_day, daily_average, projects, languages, editors, categories, machines or operating systems, with a freshness flag. Use this for one specific metric. Use get_stats for the full combined stats.

    Inputs

    insight_typestringrequired
    Which insight to retrieve. One of stats, weekdays, days, ai_days, best_day, daily_average, projects, languages, editors, categories, machines, operating_systems.one of statsweekdaysdaysai_daysbest_daydaily_averageprojectslanguageseditorscategoriesmachinesoperating_systems
    rangestringrequired
    Time range for the insight: a year (YYYY), a month (YYYY-MM), or one of last_7_days, last_30_days, last_6_months, last_year, all_time.
    timeoutinteger
    Keystroke timeout in minutes used when joining heartbeats into durations. Defaults to the user's own keystroke timeout setting when omitted.
    weekdaystring
    Filter days to one weekday, either an integer 0-6 or a name from monday to sunday. Only applies when insight_type is days.
    writes_onlyboolean
    When true, only count time from saving files. Defaults to the user's writes_only setting when omitted.
  • wakatime_get_org_dashboard_durationsRetrieve one day of durations for every developer on an organization dashboard.Read-only

    Get Org Dashboard Durations

    Retrieve one day of durations for every developer on an organization dashboard. Returns each developer's durations for the day, sliced by project unless slice_by is set. Use this for a team timeline. Use get_org_member_durations for one member.

    Inputs

    dashboardstringrequired
    ID of the organization dashboard, as returned by list_org_dashboards.
    datestringrequired
    Day to fetch the dashboard durations for, as YYYY-MM-DD. The result covers 12am to 11:59pm in the user's timezone (or the timezone input when the endpoint accepts one).
    orgstringrequired
    ID of the WakaTime organization, as returned by list_orgs.
    branchesstring
    Comma-separated list of branch names to include. Omit to include all branches.
    projectstring
    Only include activity for this project name. Omit to include all projects.
    slice_bystring
    Primary key used to slice durations. One of project, entity, language, dependencies, os, editor, category, machine. The API defaults to project when omitted.one of projectentitylanguagedependenciesoseditorcategorymachine