Skip to content

Add temp-check extension#25555

Closed
ADCAdams wants to merge 1 commit intoraycast:mainfrom
ADCAdams:ext/temp-check
Closed

Add temp-check extension#25555
ADCAdams wants to merge 1 commit intoraycast:mainfrom
ADCAdams:ext/temp-check

Conversation

@ADCAdams
Copy link
Contributor

@ADCAdams ADCAdams commented Feb 18, 2026

Description

Temp Check gives you instant access to your Mac's CPU temperature — right from the menu bar or a detailed Raycast command.

Why this extension?

There's no built-in way to check CPU temperature on macOS without third-party apps. Existing solutions are either paid, bloated, or require granting elevated permissions. Temp Check seamlessly reads thermal sensors directly via macOS IOKit APIs. This means no sudo, no background daemons, no kernel extensions, and no pop-ups!

Features

  • Menu Bar Display — Live CPU temperature with color-coded severity indicator (green/yellow/orange/red)
  • Detailed View — Full breakdown of all thermal die sensors, chip model, CPU core count, and temperature status
  • Celsius / Fahrenheit Toggle — Switch units instantly with Cmd+U in the list view, or from the menu bar dropdown. Preference persists across sessions via LocalStorage.
  • Configurable Thresholds — Set custom warning (default 80°C) and critical (default 95°C) temperature thresholds in extension preferences
  • Apple Silicon Aware — Detects chip model (M1/M2/M3/M4 etc.), reports correct core count, and explains that GPU shares the die on unified architecture chips

How it works

The extension compiles a lightweight Objective-C binary from source (tools/temp-reader.m) during the build step — no opaque binaries are bundled. The binary uses IOKit HID thermal APIs to read all available temperature sensors. It's compiled as a universal binary (arm64 + x86_64) so it runs natively on both Apple Silicon and Intel Macs.

A note on "Die Sensors" vs CPU cores

macOS exposes thermal die sensors (e.g. PMU tdie1), not per-core temperature readings. The number of die sensors does not match the number of CPU cores — for example, an M4 Max has 14 cores but 10 die sensors. The extension clearly labels these as "Die Sensor 1", "Die Sensor 2", etc. and shows the actual core count separately so users understand what they're seeing.

Screencast

TC1 TC2 TC3 TC4 TC5

Checklist

- Add temp-check/ to gitignore
- Fix Prettier formatting
- Add README with feature docs and sensor explanation
- Add Temp Check Raycast extension
- Initial commit
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Feb 18, 2026
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@ADCAdams ADCAdams marked this pull request as ready for review February 18, 2026 03:44
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 18, 2026

Greptile Summary

New extension that monitors Mac CPU temperature via IOKit thermal sensors, with a menu bar display and a detailed list view. The extension compiles a lightweight Objective-C binary from source during build to read thermal data without elevated permissions.

  • The Objective-C binary (tools/temp-reader.m) is missing an extern declaration for IOHIDEventSystemClientCopyServices, which relies on implicit function declaration. On 64-bit systems with modern Clang (Apple Clang 15+), this will either fail to compile or produce incorrect behavior by truncating the returned pointer.
  • .prettierrc uses printWidth: 100 instead of the required 120.
  • CHANGELOG.md uses a hardcoded date instead of the {PR_MERGE_DATE} placeholder.
  • Preferences interface is manually defined in src/lib/types.ts; preference types are auto-generated in raycast-env.d.ts and should not be duplicated.
  • Extension is missing the required metadata/ folder with Raycast-styled screenshots for the store listing.

Confidence Score: 2/5

  • This PR needs fixes before merging — the missing extern declaration in the native binary is a potential compilation/runtime issue, and several repository conventions are not followed.
  • Score of 2 reflects a potential compilation issue in the Objective-C binary (missing extern for IOHIDEventSystemClientCopyServices), missing metadata folder for store screenshots, non-standard prettierrc, hardcoded changelog date, and manually defined Preferences type. The TypeScript code itself is well-structured.
  • extensions/temp-check/tools/temp-reader.m (missing extern declaration), extensions/temp-check/.prettierrc (wrong printWidth), extensions/temp-check/CHANGELOG.md (hardcoded date), extensions/temp-check/src/lib/types.ts (manual Preferences interface)

Important Files Changed

Filename Overview
extensions/temp-check/package.json Well-structured package.json with proper commands, preferences, and build scripts. Category "System" is appropriate.
extensions/temp-check/.prettierrc Uses printWidth 100 instead of the required 120 per repository standards.
extensions/temp-check/CHANGELOG.md Uses hardcoded date instead of {PR_MERGE_DATE} placeholder as required by repository conventions.
extensions/temp-check/src/lib/types.ts Manually defines a Preferences interface that should be auto-generated from raycast-env.d.ts.
extensions/temp-check/src/lib/temperature.ts Clean temperature reading logic using execFile with timeout. Good error handling with fallback values.
extensions/temp-check/src/temperature-monitor.tsx Detailed list view for temperature monitoring with sensor breakdown. Well-structured component.
extensions/temp-check/src/menubar-temperature.tsx Menu bar command with color-coded temperature display. Properly structured with all expected sections.
extensions/temp-check/tools/temp-reader.m Objective-C binary for reading IOKit thermal sensors. Missing extern declaration for IOHIDEventSystemClientCopyServices which relies on implicit function declaration — a potential issue on strict compilers. Minor memory leak of IOHIDEventRef objects (cosmetic for short-lived process).

Last reviewed commit: b43537d

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

19 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@@ -0,0 +1,4 @@
{
"printWidth": 100,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-standard printWidth value

All extensions in this repository must use printWidth: 120 per the standard Raycast Prettier configuration. This is set to 100.

Suggested change
"printWidth": 100,
"printWidth": 120,

Context Used: Rule from dashboard - What: All extensions must use the standard Raycast Prettier configuration with printWidth: 120 and... (source)

@@ -0,0 +1,10 @@
# Temp Check Changelog

## [Initial Version] - 2026-02-17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use {PR_MERGE_DATE} placeholder

Changelog entries for new PRs must use the {PR_MERGE_DATE} placeholder instead of a hardcoded date. The actual merge date is set automatically during release.

Suggested change
## [Initial Version] - 2026-02-17
## [Initial Version] - {PR_MERGE_DATE}

Context Used: Rule from dashboard - What: Changelog entries must use {PR_MERGE_DATE} placeholder in titles, be placed at the top of th... (source)

Comment on lines +24 to +29
export interface Preferences {
temperatureUnit: "celsius" | "fahrenheit";
refreshInterval: string;
warningThreshold: string;
criticalThreshold: string;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove manual Preferences interface

Preference types are auto-generated in raycast-env.d.ts when the extension builds. Manually defining a Preferences interface is redundant and can drift out of sync with package.json. Remove this interface and use Preferences from the auto-generated types directly (it's globally available).

All call sites (temperature-monitor.tsx, menubar-temperature.tsx, useTemperatureUnit.ts) should update their imports to stop importing Preferences from this file.

Context Used: Rule from dashboard - What: Don't manually define Preferences for getPreferenceValues() or commends Argument interfa... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +11 to +15
extern IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef allocator);
extern int IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef client, CFDictionaryRef match);
extern IOHIDEventRef IOHIDServiceClientCopyEvent(IOHIDServiceClientRef, int64_t, int32_t, int64_t);
extern CFStringRef IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef property);
extern double IOHIDEventGetFloatValue(IOHIDEventRef event, int32_t field);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing extern declaration for IOHIDEventSystemClientCopyServices

All other private IOKit functions (IOHIDEventSystemClientCreate, IOHIDServiceClientCopyEvent, etc.) have explicit extern declarations, but IOHIDEventSystemClientCopyServices (used on line 23) does not. This relies on implicit function declaration, which assumes the function returns int. On 64-bit systems, this truncates the returned pointer value and can cause a crash. Modern Clang versions (Apple Clang 15+) treat implicit function declarations as errors by default.

Add the missing declaration alongside the others:

Suggested change
extern IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef allocator);
extern int IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef client, CFDictionaryRef match);
extern IOHIDEventRef IOHIDServiceClientCopyEvent(IOHIDServiceClientRef, int64_t, int32_t, int64_t);
extern CFStringRef IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef property);
extern double IOHIDEventGetFloatValue(IOHIDEventRef event, int32_t field);
extern IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef allocator);
extern int IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef client, CFDictionaryRef match);
extern CFArrayRef IOHIDEventSystemClientCopyServices(IOHIDEventSystemClientRef client);
extern IOHIDEventRef IOHIDServiceClientCopyEvent(IOHIDServiceClientRef, int64_t, int32_t, int64_t);
extern CFStringRef IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef property);

@0xdhrv 0xdhrv self-assigned this Feb 18, 2026
@0xdhrv
Copy link
Contributor

0xdhrv commented Feb 18, 2026

Thanks for your contribution 🔥

We already have an extension in the Store that deals with system monitoring. Could we consider enhancing the existing extension below instead of creating another one?

I think you can enhance the existing extension to add the temp-check feature

If there are unique features or workflows you’re aiming to add, we’d love to hear them and see if they can be integrated into this to avoid duplication and improve discoverability.

This would help avoid duplication and keep related functionality consolidated in one place.
As mentioned in our extension guidelines here ↗

@0xdhrv 0xdhrv marked this pull request as draft February 18, 2026 06:01
@ADCAdams
Copy link
Contributor Author

Thanks for the feedback @0xdhrv — that makes sense. Happy to contribute CPU temperature monitoring to the existing System Monitor extension instead.

The core value-add here is reading thermal sensor data via IOKit HID APIs through a lightweight Objective-C binary compiled from source (no sudo, no kernel extensions, no native node addons). This gives:

  • CPU die temperature — average, max, and per-sensor breakdown
  • Chip-aware context — detects Apple Silicon model, core count, and number of die sensors
  • Severity indicators — color-coded normal/warm/hot/critical thresholds
  • Celsius/Fahrenheit toggle

System Monitor currently only has battery temperature. I'll open a PR on the System Monitor extension adding a Temperature section to both the list view and menu bar command.

I'll close this PR once that's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants