Skip to content

Add dev-servers extension - #27230

Merged
raycastbot merged 5 commits into
raycast:mainfrom
tavlean:ext/dev-servers
May 19, 2026
Merged

raycastbot merged 5 commits into
raycast:mainfrom
tavlean:ext/dev-servers

Conversation

@tavlean

@tavlean tavlean commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a new extension that lists every dev server you have running, grouped by project, and lets you kill, restart, open in browser/terminal, or copy URLs without leaving Raycast.

Detection works for anything launched via node_modules/.bin/ (Vite, Next.js, Astro, SvelteKit, Nuxt, Webpack, Parcel, Gatsby, Remix, Turbo, esbuild) plus the Bun runtime. Restart automatically picks the right package manager from the project's lockfile (npm, pnpm, yarn, bun).

No external services, no analytics, no keychain access. macOS only (uses ps, lsof, /bin/zsh).

Screencast

Dev-Servers-Screencast

Checklist

- docs: remove em dashes, drop Known Limitations, single CHANGELOG entry
- chore: add Raycast Store screenshots
- chore: strip screenshot dummy data, restore live detection
- chore(screenshots): dummy data + custom extension icon
- chore: title-case dropdown item and empty-state title
- feat: stable port detection, validated favicons, theme-tuned tag colors
- feat: terminal/finder/refresh actions, tool filter, empty-state polish
- feat: confirm destructive actions, surface errors, snappy restart toast
- feat: detect Bun servers and pick the right package manager for restart
- Add README, CHANGELOG, linting config, and UI improvements
- Initial implementation of Dev Servers Raycast extension
@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels Apr 16, 2026
@raycastbot

Copy link
Copy Markdown
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.

@tavlean
tavlean marked this pull request as ready for review April 16, 2026 13:54
@greptile-apps

greptile-apps Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new dev-servers Raycast extension that detects running dev servers (Vite, Next.js, Astro, Bun, etc.) by scanning for node_modules/.bin/ processes and lists them grouped by project, with actions to kill, restart, open in browser/terminal, and copy URLs.

  • Server detection uses a shell script (FETCH_SCRIPT) piped through useExec, with package-manager detection via lockfile presence and a smart restart loop that polls until the new server binds a port.
  • The favicon resolution is custom-built (HTML <link rel=\"icon\"> parsing + /favicon.ico fallback) which is appropriate since getFavicon from @raycast/utils relies on remote favicon services that can't reach localhost.
  • CWD extraction with awk 'NR>1 {print $NF}' on lsof output breaks silently when the project path contains spaces — a common scenario on macOS — corrupting the project name and causing restart, Finder, and terminal actions to target the wrong directory.

Confidence Score: 4/5

The extension works correctly for projects in paths without spaces, but silently produces wrong results for any project whose directory path contains a space — a common macOS situation.

The CWD extraction in FETCH_SCRIPT uses awk on lsof column output in a way that silently truncates paths containing spaces, breaking restart, Finder, and terminal actions for affected users.

extensions/dev-servers/src/servers.ts — specifically the FETCH_SCRIPT constant and the lsof CWD extraction line.

Important Files Changed

Filename Overview
extensions/dev-servers/src/servers.ts Core detection and restart logic. awk '{print $NF}' for CWD breaks on paths with spaces, which cascades to broken project names, restart, and Finder/Terminal actions.
extensions/dev-servers/src/index.tsx Main UI command — well-structured with proper optimistic updates, ref-based polling for restart, and correct use of auto-generated Preferences.Index type.
extensions/dev-servers/src/types.ts Minimal DevServer interface — straightforward and correct.
extensions/dev-servers/package.json Well-formed package manifest with correct schema, categories, platform, and preferences definitions; both dependencies are used in source.
extensions/dev-servers/CHANGELOG.md Uses a hardcoded date instead of the required {PR_MERGE_DATE} placeholder; heading title also uses "Initial Version" instead of the conventional "Initial Release".
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
extensions/dev-servers/src/servers.ts:36
**`awk '$NF` truncates CWDs that contain spaces**

`lsof` column-formats its output; `awk 'NR>1 {print $NF}'` treats every whitespace-separated word as a separate field. A path like `/Users/John Doe/Projects/myapp` would be returned as just `myapp`, causing the wrong project name to display, and causing "Restart", "Open in Terminal", and "Show in Finder" to operate on the wrong (or non-existent) directory.

Use `lsof -F n` (machine-readable format, field `n` = filename) to get the full path safely: `lsof -p $PID -a -d cwd -F n 2>/dev/null | awk '/^n/ {print substr($0,2)}'`.

### Issue 2 of 2
extensions/dev-servers/CHANGELOG.md:3
The changelog uses a hardcoded date instead of the `{PR_MERGE_DATE}` placeholder that Raycast conventions require for initial release entries. The placeholder is automatically replaced with the actual merge date during publishing.

```suggestion
## [Initial Release] - {PR_MERGE_DATE}
```

Reviews (2): Last reviewed commit: "Update CHANGELOG.md and optimise images" | Re-trigger Greptile

Comment thread extensions/dev-servers/src/index.tsx Resolved
Comment thread extensions/dev-servers/src/index.tsx Resolved
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Apr 30, 2026
@tavlean

tavlean commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Friendly bump after the auto-stale tag. The PR is ready for review when a maintainer has time. CI is green, Greptile gave 5/5 with both suggestions addressed, and image assets are optimized. Happy to address any feedback quickly. Thanks!

@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Apr 30, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label May 14, 2026
@tavlean

tavlean commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

I understand that the team is busy with rollout of version 2.0 beta, so here's another friendly bump to remove the auto-stale tag.

@raycastbot raycastbot removed the status: stalled Stalled due inactivity label May 14, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution @tavlean 🔥

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

If there are unique features or workflows you're aiming to add (project-based grouping, framework detection, lockfile-aware restart, favicon/browser actions), 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 May 15, 2026 05:19
@0xdhrv 0xdhrv self-assigned this May 15, 2026
@tavlean

tavlean commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @0xdhrv, thanks for pointing me at Port Manager. I looked at it before I started working on this extension as well.

The two extensions answer different questions. Port Manager answers "what is listening on my machine, kill it": a general system utility for any port (Postgres, Docker, anything) where kill is the primary action. Dev Servers answers "what dev servers am I running, how do I manage my workflow": only surfaces processes launched via node_modules/.bin/ or the Bun runtime, groups them by project (cwd), identifies the framework (Svelte, Astro, Next, Vite), and runs a lockfile-aware restart that auto-detects npm/pnpm/yarn/bun and polls until the new server binds a port.

I considered whether the dev-server features could live inside Port Manager, and they don't fit cleanly. Either every listening port row would carry dev-server-specific affordances (favicons, framework tags, project grouping, lockfile-aware restart, runtime tags), which feels out of place on a Postgres or Docker process, or Port Manager would need a "dev mode vs system mode" toggle that bifurcates its codebase and UX. Both options pull Port Manager away from the focused, intentionally clean utility it is today.

The two are complementary. Reach for Port Manager when you need to inspect any listening process, kill a parent process, or assign a named label to a system service. Reach for Dev Servers during active development: switching between project contexts, restarting after dependency changes, and tracking which framework is on which port across the projects you have open.

Roadmap: v1.1 adds Start Dev Server from a folder selected in Finder (auto-detects the package manager, spawns the dev script, opens the URL in the browser). v1.2 adds a menu-bar variant showing the count of running dev servers with per-server quick actions.

Happy to discuss further.

@0xdhrv

0xdhrv commented May 19, 2026

Copy link
Copy Markdown
Member

Hi @0xdhrv, thanks for pointing me at Port Manager. I looked at it before I started working on this extension as well.

The two extensions answer different questions. Port Manager answers "what is listening on my machine, kill it": a general system utility for any port (Postgres, Docker, anything) where kill is the primary action. Dev Servers answers "what dev servers am I running, how do I manage my workflow": only surfaces processes launched via node_modules/.bin/ or the Bun runtime, groups them by project (cwd), identifies the framework (Svelte, Astro, Next, Vite), and runs a lockfile-aware restart that auto-detects npm/pnpm/yarn/bun and polls until the new server binds a port.

I considered whether the dev-server features could live inside Port Manager, and they don't fit cleanly. Either every listening port row would carry dev-server-specific affordances (favicons, framework tags, project grouping, lockfile-aware restart, runtime tags), which feels out of place on a Postgres or Docker process, or Port Manager would need a "dev mode vs system mode" toggle that bifurcates its codebase and UX. Both options pull Port Manager away from the focused, intentionally clean utility it is today.

The two are complementary. Reach for Port Manager when you need to inspect any listening process, kill a parent process, or assign a named label to a system service. Reach for Dev Servers during active development: switching between project contexts, restarting after dependency changes, and tracking which framework is on which port across the projects you have open.

Roadmap: v1.1 adds Start Dev Server from a folder selected in Finder (auto-detects the package manager, spawns the dev script, opens the URL in the browser). v1.2 adds a menu-bar variant showing the count of running dev servers with per-server quick actions.

Happy to discuss further.

Thanks for the information 👋

We can go forward with this, but make the following changes:

  • Lead the description with "project-grouped + restart with the right package manager" since the current opener sounds like Port Manager.
  • Add a README line explaining how it differs from Port Manager.

@tavlean

tavlean commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Both changes done: the description now leads with the project-grouping and restart differentiators, and the README has a "How it differs from Port Manager" section. Let me know if you'd like any tweaks.

@0xdhrv
0xdhrv marked this pull request as ready for review May 19, 2026 20:06

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 43e86d0 into raycast:main May 19, 2026
1 check passed
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

# non-deterministic and would flicker the displayed port across refreshes.
PORT=$(echo "$PORTS" | awk -v p=$PID '$1==p {print $2}' | sort -n | head -1)
[ -z "$PORT" ] && continue
CWD=$(lsof -p $PID -a -d cwd 2>/dev/null | awk 'NR>1 {print $NF}')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 awk '$NF truncates CWDs that contain spaces

lsof column-formats its output; awk 'NR>1 {print $NF}' treats every whitespace-separated word as a separate field. A path like /Users/John Doe/Projects/myapp would be returned as just myapp, causing the wrong project name to display, and causing "Restart", "Open in Terminal", and "Show in Finder" to operate on the wrong (or non-existent) directory.

Use lsof -F n (machine-readable format, field n = filename) to get the full path safely: lsof -p $PID -a -d cwd -F n 2>/dev/null | awk '/^n/ {print substr($0,2)}'.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/dev-servers/src/servers.ts
Line: 36

Comment:
**`awk '$NF` truncates CWDs that contain spaces**

`lsof` column-formats its output; `awk 'NR>1 {print $NF}'` treats every whitespace-separated word as a separate field. A path like `/Users/John Doe/Projects/myapp` would be returned as just `myapp`, causing the wrong project name to display, and causing "Restart", "Open in Terminal", and "Show in Finder" to operate on the wrong (or non-existent) directory.

Use `lsof -F n` (machine-readable format, field `n` = filename) to get the full path safely: `lsof -p $PID -a -d cwd -F n 2>/dev/null | awk '/^n/ {print substr($0,2)}'`.

How can I resolve this? If you propose a fix, please make it concise.

@tavlean
tavlean deleted the ext/dev-servers branch May 25, 2026 02:18
almatkai pushed a commit to almatkai/raymes-extensions that referenced this pull request Jul 13, 2026
* Add dev-servers extension

- docs: remove em dashes, drop Known Limitations, single CHANGELOG entry
- chore: add Raycast Store screenshots
- chore: strip screenshot dummy data, restore live detection
- chore(screenshots): dummy data + custom extension icon
- chore: title-case dropdown item and empty-state title
- feat: stable port detection, validated favicons, theme-tuned tag colors
- feat: terminal/finder/refresh actions, tool filter, empty-state polish
- feat: confirm destructive actions, surface errors, snappy restart toast
- feat: detect Bun servers and pick the right package manager for restart
- Add README, CHANGELOG, linting config, and UI improvements
- Initial implementation of Dev Servers Raycast extension

* chore: address Greptile review feedback

* chore: optimize PNG file sizes for icon and screenshots

* docs: differentiate from Port Manager per reviewer feedback

* Update CHANGELOG.md and optimise images

---------

Co-authored-by: raycastbot <[email protected]>
jomatsu added a commit to jomatsu/raycast-plugin-codex that referenced this pull request Aug 5, 2026
…ADME & Store description

Lead the description with the live-status differentiators and add a
"How it differs from the Codex extension" README section contrasting the
architectures (read-only on-disk state + hook companion vs live
app-server RPC thread management), mirroring the accommodation accepted
for dev-servers in raycast/extensions#27230.
@jomatsu jomatsu mentioned this pull request Aug 5, 2026
5 tasks done
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 platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants