Skip to content

Conversation

@Vethya
Copy link

@Vethya Vethya commented Oct 21, 2025

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
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five 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
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.

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>
Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

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
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