-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add create-file extension #24278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add create-file extension #24278
Conversation
|
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new "Create File" extension to Raycast that enables quick file creation with specified names and extensions across macOS, Windows, and Linux platforms.
Key changes:
- Implements cross-platform file explorer integration to detect current directory contexts
- Provides two commands: "Create File Here" (in current directory) and "Create File To Clipboard" (creates in /tmp and copies to clipboard)
- Includes intelligent file naming with auto-increment for duplicates following system conventions
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/create-file/package.json | Defines extension metadata, commands, dependencies, and build configuration |
| extensions/create-file/src/utils.ts | Contains utility functions for cross-platform file explorer detection, file creation, and path handling |
| extensions/create-file/src/create-file-here.tsx | Implements main command that creates files in the current file explorer directory with clipboard fallback |
| extensions/create-file/src/create-file-to-clipboard.tsx | Implements command that creates files in /tmp and copies them to clipboard |
| extensions/create-file/tsconfig.json | TypeScript configuration for the extension |
| extensions/create-file/README.md | Comprehensive documentation including usage examples, platform-specific behavior, and installation instructions |
| extensions/create-file/eslint.config.js | ESLint configuration using Raycast's standard config |
| extensions/create-file/.prettierrc | Prettier formatting configuration |
| extensions/create-file/.gitignore | Standard Node.js gitignore patterns |
Files not reviewed (1)
- extensions/create-file/package-lock.json: Language not supported
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Greptile SummaryAdds a new cross-platform extension for creating files with custom names and extensions. The extension provides two commands: "Create File Here" (creates files in the current Finder/Explorer directory with clipboard fallback) and "Create File To Clipboard" (creates files in Key issues found:
Positive aspects:
Confidence Score: 3/5
Important Files Changed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 3 comments
extensions/create-file/README.md
Outdated
|
|
||
| - **macOS**: Full support with Finder integration | ||
| - **Windows**: Full support with File Explorer integration | ||
| - **Linux**: Full support with file explorer integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: package.json specifies platforms: ["macOS", "Windows"], but README claims Linux support. Either add Linux to platforms array or remove Linux documentation.
| export const getLinuxFileManagerPath = async (): Promise<string | null> => { | ||
| try { | ||
| // Try to get the current directory from common Linux file explorers | ||
| // This is a best-effort approach as Linux file explorers vary widely | ||
|
|
||
| // Try xdotool to get the focused window's working directory | ||
| const { stdout } = await execAsync('xdotool getactivewindow getwindowname 2>/dev/null || echo ""'); | ||
|
|
||
| // Parse common file explorer window titles | ||
| const windowTitle = stdout.trim(); | ||
|
|
||
| // Try to extract path from Nautilus, Dolphin, Thunar, etc. | ||
| const pathMatch = windowTitle.match(/^(.*?)\s*[-–—]\s*(?:Files|Dolphin|Thunar)/); | ||
| if (pathMatch) { | ||
| return pathMatch[1].trim(); | ||
| } | ||
|
|
||
| return null; | ||
| } catch (e) { | ||
| console.error("Error getting Linux file explorer path:", e); | ||
| return null; | ||
| } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Linux is not in the supported platforms array in package.json, so this code won't be accessible to users. Either add Linux to platforms or remove this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was slop produced by your kind, raycast is not even on linux!
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- fix stupid bot - Merge branch \'contributions/merge-1767844831293\' - Pull contributions - updated icon - added changelogs - grammar and removing slop
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder