Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Nov 20, 2025

Closes #1136.

Spotlight Control Center

This PR introduces the Spotlight Control Center, enabling users to manage all spotlight run instances from a centralized UI or via a new spotlight list CLI command.

Key Features:

  • Instance Registry: Tracks all spotlight run instances, including health checks (HTTP, PID, start time) and automatic cleanup of stale entries.
  • spotlight list CLI Command: A new command to list running instances with support for human, JSON, logfmt, and Markdown output formats.
  • API Endpoints: Provides endpoints for listing, pinging, and terminating instances.
  • Control Center UI: A new UI section to view, search, connect to, and terminate instances in real-time.
  • Connection Switching: Allows seamless switching between active Spotlight instances with a clean state reset.
  • Cross-Platform Support: Implemented using pidusage for robust process management across Linux, macOS, and Windows.

Why this change?

This feature addresses the need for better visibility and control over multiple running Spotlight instances, improving the developer experience by simplifying instance management and debugging.

Testing Notes:

  • The CLI functionality (spotlight list and instance registration) has been thoroughly tested and verified.
  • UI components are built and integrated; manual UI interaction testing is recommended to verify connection switching and instance termination from the browser.

Open in Cursor Open in Web

@BYK BYK deployed to Preview November 20, 2025 11:51 — with GitHub Actions Active
@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
spotlightjs Ready Ready Preview Comment Nov 20, 2025 0:22am

@BYK BYK changed the title Manage spotlight control center to-dos Spotlight Control Center Nov 20, 2025
-p, --port <port> Port to listen on (default: 8969, or 0 for random)
-d, --debug Enable debug logging
-f, --format <format> Output format for tail command (default: human)
-f, --format <format> Output format for tail/list command (default: human)
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
-f, --format <format> Output format for tail/list command (default: human)
-f, --format <format> Output format for commands like run, tail, and list command (default: human)

Comment on lines 44 to 47
return Object.entries(fields)
.map(([key, value]) => `${key}=${value}`)
.join(" ");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Use the existing logfmt library we have for this.

Comment on lines 87 to 111
switch (format) {
case "human":
for (const instance of instances) {
console.log(formatHuman(instance));
}
break;

case "json":
console.log(formatJson(instances));
break;

case "logfmt":
for (const instance of instances) {
console.log(formatLogfmt(instance));
}
break;

case "md":
console.log(formatMarkdown(instances));
break;

default:
logger.error(`Unsupported format: ${format}`);
process.exit(1);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of this switch/case block research the code for formatters and try to use existing formatters by extending them. If that's not possible, at least use the Map() architecture rather than if or switch blocks.

@@ -0,0 +1,268 @@
# Spotlight Control Center - Implementation Summary
Copy link
Member Author

Choose a reason for hiding this comment

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

Create new docs using the contents of this file under packages/website/src/docs and then delete this file.

@@ -0,0 +1,248 @@
# Spotlight Control Center - Testing Complete ✅
Copy link
Member Author

Choose a reason for hiding this comment

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

Delete this file.

@cursor cursor bot deployed to Preview November 20, 2025 12:22 Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spotlight Control Center

3 participants