Skip to content

Conversation

@yigitefe
Copy link
Contributor

@yigitefe yigitefe commented Feb 8, 2026

Description

This PR introduces the Viscosity extension, which allows users to manage their Viscosity VPN connections directly from Raycast. It leverages AppleScript to interface with the Viscosity macOS application.

🚀 Features

  • List Connections
    View all configured VPN connections and their real-time status (Connected / Disconnected / Connecting).

  • Toggle Connections
    Quickly connect or disconnect a specific VPN by pressing Enter.

  • Quick Connect
    A dedicated command to instantly connect to a preferred VPN (or the first one in the list).

  • Disconnect All
    A utility command to drop all active VPN sessions at once.

  • Preference Management
    Users can set a Quick Connect default connection via the List Connections view (Cmd + Shift + Q).

🛠️ Implementation Details

  • AppleScript Integration
    Uses @raycast/utils runAppleScript to communicate with Viscosity.

  • Polling
    Implements a polling mechanism to provide real-time status updates while connections are being established or dropped.

  • State Management
    Uses Raycast’s LocalStorage to persist user preferences for the Quick Connect feature.

Screencast

Checklist

- chore: update viscosity screenshot
- chore: add and update viscosity screenshots
- refactor: extract and reuse actions for connection management
- refactor: replace Quick Connect icon, and add action icons
- refactor: simplify utility function names for connections handling
- refactor: extract error toast logic into a dedicated module
- refactor: centralize error toast handling
- refactor: handle permission-related errors in all commands
- chore: update dependencies to latest versions
- chore: add screenshots for the extension store
- chore: add "Communication" to categories in package.json
- chore: add "macOS" to supported platforms in package.json
- refactor: migrate package to ESM syntax
- docs: update command descriptions in package.json
- docs: update extension description and README with improved details and usage instructions
- refactor: rename extension from "Viscosity Connect" to "Viscosity" and update related metadata
- refactor: move `useConnections` to dedicated hooks folder
- refactor: remove ellipsis from connection state messages
- refactor: rename files to kebab-case
- refactor: add getActiveConnections and improve connection state handling logic
- refactor: add "No connections found" to error constants
- refactor: centralize polling logic into viscosity API and clean up utils
- refactor: transition to functional architecture and modular utilities
- refactor: centralize connection logic into ConnectionService
- refactor: simplify connection list rendering by extracting reusable function
- extract ConnectionListItem component and refactor list rendering for connections
- add error handling for failed connection state updates in quick-connect
- refactor: centralize error handling and decouple UI from service layer
- split utils into modular files and add path alias for imports
- extract Viscosity client logic into a reusable class
- rename toggleQuickConnect to makeQuickConnect and cleanup constants
- add error handling for failed connection state updates
- escape special characters in connection names to prevent syntax errors in AppleScript
- change extension icon
- change quick-connect icon
- add new status icons and make quick connect an accessory
- add polling to ensure all connections are disconnected
- refactor error handling and extract disconnectAll utility function
- implement Quick Connect command
- change Favorite to Quick Connect
- add "Make Favorite" action and visual indicators to list
- add useConnections hook
- update eslint config
- change command descriptions
- add polling for connection state indicators
- add Refresh action to list-connections
- split list into Active and Disconnected
- add connection state-based sorting, make active connections appear on top
- fix bug when "reset network after disconnect" option is on icon state not changing, and some more improvement on state indicators
- make all messages a constant and change Connection type to the enum
- add constants for messages
- turn prettier singleQuote rule off
- add disconnect script
- some refactoring
- add Connected and Disconnected icons in list view
- change list connections to AppleScript
- Initial commit
- docs: add Raycast link in README
- fix: properly escape backslashes and double quotes in strings
- refactor: apply Raycast prettier rules
- chore: add .vscode to gitignore and apply minor code formatting
- feat: add "Connect and Close" action to list-connections
- feat: use HUD notifications and close window for disconnect-all
- feat: Introduce HUD-specific error and message constants with emojis and update quick connect and error handling to use them.
- refactor: Update quick-connect to use `showHUD` for all notifications and errors, and close the main window.
- style: Reformat mock API file
- docs: Update Viscosity extension screenshots.
- feat: add mock API for connections
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Feb 8, 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.

@0xdhrv 0xdhrv self-assigned this Feb 8, 2026
@yigitefe yigitefe marked this pull request as ready for review February 8, 2026 16:51
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 8, 2026

Greptile Overview

Greptile Summary

This PR adds a new Viscosity VPN extension that enables users to manage VPN connections through Raycast using AppleScript integration.

Key Implementation Highlights:

  • Properly escapes user input in AppleScript strings to prevent injection vulnerabilities (src/utils/strings.ts:1-3)
  • Implements polling mechanism for connection state transitions with reasonable timeout (30 attempts)
  • Uses LocalStorage for persisting Quick Connect preferences
  • Includes comprehensive error handling with permission-specific messaging for AppleScript access
  • Follows Raycast extension standards: correct Prettier config, ESLint setup, CHANGELOG format, and metadata screenshots

Architecture:

  • Clean separation between API layer (api/viscosity.ts), UI components, and utility functions
  • React hooks pattern for connection state management
  • Three commands: List Connections (view), Quick Connect (no-view), Disconnect All (no-view)

The extension is well-structured, follows all repository guidelines, and implements security best practices for AppleScript execution.

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • Extension follows all Raycast standards, implements proper security measures (input escaping), includes comprehensive error handling, and has clean architecture. All configuration files match required standards (Prettier, ESLint, CHANGELOG format). No logical errors, syntax issues, or security vulnerabilities detected.
  • No files require special attention

Important Files Changed

Filename Overview
extensions/viscosity/package.json Configuration properly set up with correct dependencies, scripts, and metadata
extensions/viscosity/.prettierrc Prettier config matches required Raycast standards (printWidth: 120, singleQuote: false)
extensions/viscosity/CHANGELOG.md Changelog correctly uses {PR_MERGE_DATE} placeholder for initial version
extensions/viscosity/src/api/viscosity.ts AppleScript integration well-implemented with proper escaping and state management
extensions/viscosity/src/list-connections.tsx Main view with proper state management, error handling, and user feedback
extensions/viscosity/src/quick-connect.ts Quick connect command with proper error handling and HUD feedback
extensions/viscosity/src/hooks/use-connections.ts Custom hook properly manages connection state with error handling
extensions/viscosity/src/utils/strings.ts String escaping utility for AppleScript injection prevention

Copy link
Contributor

@0xdhrv 0xdhrv left a comment

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 7e3e331 into raycast:main Feb 9, 2026
2 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Published to the Raycast Store:
https://raycast.com/yigitefe/viscosity

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

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

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

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