Codetime

by Max
5
4
3
2
1
Score: 50/100

Description

Reviews

No reviews yet.

Stats

0
stars
31
downloads
0
forks
8
days
5
days
6
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
42
commits

README file from

Github

CodeTime.dev for Obsidian

Track time spent writing in Obsidian with your codetime.dev account. The plugin records relevant vault activity, shows the current project's time in the status bar, and provides a diagnostic activity log.

[!info]+ Disclaimer This is an independent integration and is not made by or affiliated with CodeTime.dev. The plugin is loosely based on the CodeTime VS Code extension, so some features may not be available.


[!warning]+ Account and Paid Plan This plugin Requires an active codetime.dev account. It is usable for free, but has a paid plan for viewing more then the past 90 days and some more advanced features.

Features

  • Tracks file opens, editor changes, file creation, and file modifications.
  • Displays today's tracked time for the active project in Obsidian's status bar.
  • Uses the vault name as the project by default, with an optional project override.
  • Keeps your CodeTime token in Obsidian's secret storage.
  • Hides filenames by default.
  • Includes a filterable activity log for connection and request diagnostics.
  • Works on desktop and mobile Obsidian.

Installation

From a release

  1. Download main.js, manifest.json, and styles.css from the desired release.

  2. Create this folder in your vault:

    <vault>/.obsidian/plugins/starlightv-codetime/
    
  3. Copy the three downloaded files into that folder.

  4. In Obsidian, open Settings → Community plugins, enable community plugins if needed, then enable CodeTime.dev.

Development install

git clone <repository-url>
cd obsidian-codetime
npm install
npm run dev

For a one-off production build, run:

npm run build

Build output is written to main.js in the plugin root. Reload Obsidian after rebuilding.

Setup

  1. Sign in to codetime.dev and get your token from its account settings.
  2. In Obsidian, open Settings → Community plugins → CodeTime.dev.
  3. Under CodeTime Token, select or create an Obsidian secret containing the token.
  4. Confirm the status bar no longer says CodeTime: No Token or CodeTime: Invalid Token.

The plugin validates the token when its settings are applied. Clicking a missing- or invalid-token status item opens this settings page.

Settings

Setting Default Description
CodeTime Token An Obsidian secret containing the CodeTime API token. The token itself is not written to the plugin's settings data.
Server URL https://api.codetime.dev CodeTime API base URL. Change this only when using another compatible server.
Project Override Vault name Project name reported to CodeTime instead of the vault name.
Hide File Names On Replaces the filename sent with a generated anonymous name.

Use the reset button in the CodeTime settings section to restore the default server URL and project override. It keeps the configured token.

What is tracked and sent

After a valid token is configured, the plugin sends activity events to the configured CodeTime server when you open a file, edit in the editor, create a file, or modify a file. Events for the same event type and file are throttled to at most one per second.

Each event includes the project, file type/extension, event time and type, read or edit operation, editor (Obsidian), platform, and placeholder Git origin/branch values. The plugin also requests the current project's daily time total once a minute to update the status bar.

With Hide File Names enabled (the default), the real filename and path are not sent; each event instead uses an anonymous generated name. The project name is still sent, so set a Project Override if your vault name is sensitive.

Privacy notes

  • Tracking requires network requests to the configured CodeTime server; it does not send vault note contents.
  • Your token is retrieved from Obsidian secret storage. Only its secret reference is saved in plugin settings.
  • Disabling the plugin stops its tracked event listeners and scheduled status updates.

Activity log

Click the status-bar item while connected to open the activity log. It records connection state, authorization results, request attempts, throttling, and errors for the current session. Use the level selector and search field to narrow the displayed entries.

Development

This project uses TypeScript, esbuild, npm, and the Obsidian API.

Command Purpose
npm run dev Start esbuild in watch mode.
npm run build Type-check and create a production bundle.
npm run lint Run ESLint.

The required release artifacts are main.js, manifest.json, and styles.css. Do not commit generated dependencies or build output.

License

MIT