Skip to content

Add port-from-project-name extension - #22312

Merged
raycastbot merged 6 commits into
raycast:mainfrom
Vethya:ext/port-from-project-name
Nov 17, 2025
Merged

raycastbot merged 6 commits into
raycast:mainfrom
Vethya:ext/port-from-project-name

Conversation

@Vethya

@Vethya Vethya commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor

Description

A extension that generates unique 4-digit ports for your development projects based on the project name.

Features:

  • Deterministic Port Generation: Same project name always generates the same port
  • Port History: Keeps track of all generated ports with timestamps
  • Quick Access: Generate ports directly from Raycast with a simple command
  • History Management: View, search, and manage your port history

Usage:

1. Generate Port
Use the "Generate port" command in Raycast:

  1. Open Raycast
  2. Type "Generate port"
  3. Enter your project name as an argument
  4. The extension will generate and display a unique port for that project

Example:

Generate port my-react-app

This will generate a consistent port number for the "my-react-app" project.

2. View Port History
Use the "Port History" command to:

  • View all previously generated ports
  • See when each port was first created and last updated
  • Search through your port history
  • Copy port numbers to clipboard
  • Delete individual entries or clear all history

How It Works
The extension uses a deterministic algorithm to generate ports:

  1. Creates an MD5 hash of the project name
  2. Converts the first 8 characters of the hash to an integer
  3. Maps the result to a port number in the range 1000-9999
  4. Stores the mapping in local history for future reference

Port Range: 1000-9999 (4-digit ports commonly used for development)

Important Notes

  • Deterministic: The same project name always generates the same port
  • Collision possibility: Different project names may occasionally generate the same port. With 9,000 possible ports (1000-9999), collisions are rare but possible in practice (~42% collision probability with 100 projects).

Privacy

  • All data is stored locally on your device
  • No information is sent to external servers
  • Project names and generated ports are only used locally

Development
This extension is built with:

  • TypeScript
  • Raycast API
  • React hooks for state management
  • Local storage for history persistence

License
MIT License - feel free to use and modify as needed.

Screencast

port-detail port-history port-filtered-and-options

Checklist

@raycastbot

ghost commented Oct 21, 2025 •

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10 business days.

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

@Vethya
Vethya marked this pull request as ready for review October 21, 2025 14:05

ghost left a comment

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.

Greptile Overview

Summary

This PR adds a new extension that generates deterministic 4-digit ports (1000-9999) from project names using MD5 hashing. The implementation is clean and well-structured with two commands: port generation and history management.

Key highlights:

  • Deterministic port generation algorithm using MD5 hashing with proper collision acknowledgment
  • History tracking with automatic cleanup (1000 entry limit)
  • Proper use of useLocalStorage from @raycast/utils for persistence
  • Configuration follows Raycast standards (Prettier, ESLint)
  • Comprehensive documentation and metadata screenshots included
  • Appropriate platform specification for cross-platform compatibility

Minor observation:

  • One minor casing inconsistency in action labels between the two command files

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The extension follows all Raycast guidelines and coding standards. The implementation is straightforward with proper state management, no external dependencies beyond Raycast utilities, and comprehensive documentation. The only item noted is a minor style inconsistency that doesn't affect functionality.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
extensions/port-from-project-name/package.json 5/5 Clean configuration with proper metadata, dependencies, and platform specification
extensions/port-from-project-name/src/generate-port.tsx 5/5 Implements deterministic port generation with history tracking and proper state management
extensions/port-from-project-name/src/view-port-history.tsx 4/5 History view with search and management actions; minor inconsistency in action label casing

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

… generate-port.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

ghost left a comment

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.

Hi 👋

Thanks for your contribution 💪

I have now tested your extension, and I have some feedback ready for you:

  • Could you add at least one screenshot of the extension and add them to a folder called metadata - you need to use our tool to get the right padding on the images

  • You can get command arguments directly from raycast-env.d.ts (you don't need to set the interface yourself)

I'm looking forward to testing this extension again 🔥

Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.

@pernielsentikaer
pernielsentikaer marked this pull request as draft October 29, 2025 08:06
@Vethya

ghost commented Nov 8, 2025

Copy link
Copy Markdown
Contributor Author

Hello @pernielsentikaer. Thank you for reviewing my extension!

I am using the Raycast Windows beta and I cannot find the built-in screenshot tool. I found a thread on Slack with people saying that it's not available for Windows yet. Can you please help me with the screenshots? I want them the same as the 3 screenshots in my comment at the very top.

@pernielsentikaer
pernielsentikaer force-pushed the ext/port-from-project-name branch from c55093a to d022ff1 Compare November 17, 2025 14:49
@pernielsentikaer
pernielsentikaer marked this pull request as ready for review November 17, 2025 14:52

ghost left a comment

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.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 0ee9695 into raycast:main Nov 17, 2025
@github-actions

ghost commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@Vethya).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

@greptile-apps

ghost commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Greptile Summary

  • Adds new extension that generates deterministic 4-digit ports (1000-9999) from project names using MD5 hashing
  • Includes port history management with timestamps, search, and clipboard actions

Confidence Score: 5/5

  • This PR is safe to merge with no issues found.
  • Extension follows all Raycast guidelines including proper error handling with showFailureToast, correct configuration files, metadata screenshots for view commands, proper CHANGELOG format with {PR_MERGE_DATE}, and isLoading state management. Code is well-structured with good TypeScript practices.
  • No files require special attention.

Important Files Changed

Filename Overview
extensions/port-from-project-name/package.json New extension configuration with proper metadata, commands, and dependencies. CHANGELOG title matches package.json title correctly.
extensions/port-from-project-name/src/generate-port.tsx Implements deterministic port generation with proper history management and clipboard actions.
extensions/port-from-project-name/src/view-port-history.tsx History view with proper error handling using showFailureToast, isLoading state, and empty state handling.

ghost left a comment

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.

9 files reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@Vethya

ghost commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

Looks good to me, approved 🔥

Thanks very much for your help and review!

@Vethya
Vethya deleted the ext/port-from-project-name branch December 2, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants