Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions extensions/picgo/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
14 changes: 14 additions & 0 deletions extensions/picgo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# Raycast specific files
raycast-env.d.ts
.raycast-swift-build
.swiftpm
compiled_raycast_swift
compiled_raycast_rust

# misc
.DS_Store
5 changes: 5 additions & 0 deletions extensions/picgo/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"singleQuote": false,
"tabWidth": 4
}
7 changes: 7 additions & 0 deletions extensions/picgo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Picgo Changelog

## [Initial Version] - {PR_MERGE_DATE}

- Add command `Upload Images`, supports local or clipboard images uploading via **PicGo**.
- Remembering your uploader configuration with **Raycast LocalStorage**.
- Support copying image URLs with Markdown, Raw URL, HTML and UBB formats.
83 changes: 83 additions & 0 deletions extensions/picgo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# PicGo for Raycast

[简体中文](./media/README-zh.md)

A [Raycast](https://www.raycast.com/) extension to upload images to image hosts using [PicGo-Core](https://github.com/PicGo/PicGo-Core) API.

<p align="center">
<img src="./media/header.png" alt="">
</p>

## How It Works

This extension integrates with `picgo` library to handle image uploads.

- **Configuration Management**: The extension reads your PicGo config file (`~/.picgo/config.json`) to detect installed uploaders and their configurations.You can choose which uploader and config to use from the dropdown menu. The extension persists your selection in **Raycast LocalStorage** and won't change your local config file.

- **Select and Send Images**: Select images (allow multi selection) from file picker or paste from clipboard `Cmd+V`. .

- **Copy Result**: Choose your preferred format (URL, Markdown, HTML, or UBB) and copy to clipboard.

## ScreenShots

### Command `Upload Images` and Actions

![Command](./media/picgo-1.png)

### Uploader Configs

![Config](./media/picgo-2.png)

### Shortcuts

![Shortcuts](./media/picgo-3.png)

### Export Page

![Export](./media/picgo-4.png)

## Prerequisites: PicGo Installation and Configuration

```shell
# install picgo-cli
npm install -g picgo
# or
yarn global add picgo


# install picgo plugins
picgo install [name]
# or use npm
npm install picgo-plugin-[name]


# configuration of uploader
picgo set uploader
# and
picgo use uploader
```

For more, check out:

- [PicGo-Cli installation](https://docs.picgo.app/core/guide/getting-started#install-globally)
- [PicGo plugin installation](https://docs.picgo.app/core/guide/commands#install-add)
- [PicGO-Cli configuration](https://docs.picgo.app/core/guide/config)

## Keyboard Shortcuts

| Action | Shortcut |
| --------------------------- | ----------- |
| Quick upload from clipboard | `Cmd+V` |
| Submit and upload | `Cmd+Enter` |
| Copy current format | `Cmd+C` |

## Extension Preferences

| Setting | Description | Default |
| -------------- | -------------------------------------------------- | ------- |
| Upload Timeout | Maximum time (in ms) to wait for upload completion | 30000 |

## Limitations

- It does **NOT** support PicGo plugin management - install/remove plugins via PicGo directly
- It does **NOT** support configuring uploaders - configure them with `picgo set uploader`.
Binary file added extensions/picgo/assets/extension-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions extensions/picgo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { defineConfig } = require("eslint/config");
const raycastConfig = require("@raycast/eslint-config");

module.exports = defineConfig([
...raycastConfig,
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-require-imports": "off",
},
},
]);
83 changes: 83 additions & 0 deletions extensions/picgo/media/README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# PicGo for Raycast

[English](../README.md)

一个使用 [PicGo-Core](https://github.com/PicGo/PicGo-Core) API 上传图片到图床的 [Raycast](https://www.raycast.com/) 扩展。

<p align="center">
<img src="./header.png" alt="">
</p>

## 工作原理

该扩展集成 `picgo` 库来处理图片上传。

- **配置管理**:读取你的 PicGo 配置文件 (`~/.picgo/config.json`) 以检测已安装的上传配置。从下拉菜单中选择要使用的上传配置。你选择的配置会被持久化存储在 **Raycast 的 LocalStorage** 中,不会修改本地配置文件。

- **选择并发送图片**:从文件选择器中选择图片(支持多选),或从剪贴板粘贴 `Cmd+V`。

- **复制结果**:选择返回格式(URL、Markdown、HTML 或 UBB)并复制到剪贴板。

## 截图

### `Upload Images` 命令面板

![Command](./picgo-1.png)

### 上传配置

![Config](./picgo-2.png)

### 快捷键

![Shortcuts](./picgo-3.png)

### 导出页面

![Export](./picgo-4.png)

## 前置条件:PicGo 安装和配置

```shell
# 安装 picgo-cli
npm install -g picgo
# 或
yarn global add picgo


# 安装 picgo 插件
picgo install [name]
# 或使用 npm
npm install picgo-plugin-[name] -g


# 上传配置
picgo set uploader
# 设置默认使用
picgo use uploader
```

更多内容请参考:

- [PicGo-Cli 安装指南](https://docs.picgo.app/core/guide/getting-started#install-globally)
- [PicGo 插件安装](https://docs.picgo.app/core/guide/commands#install-add)
- [PicGo-Cli 配置指南](https://docs.picgo.app/core/guide/config)

## 键盘快捷键

| 操作 | 快捷键 |
| ---------------- | ----------- |
| 从剪贴板快速上传 | `Cmd+V` |
| 提交并上传 | `Cmd+Enter` |
| 复制当前格式 | `Cmd+C` |

## 扩展配置

| 设置 | 描述 | 默认值 |
| -------------- | -------------------- | ------ |
| Upload Timeout | 上传超时时间(毫秒) | 30000 |

## 限制

- **不支持** PicGo 插件管理,直接通过 PicGo 安装/卸载插件
- **不支持** GUI 配置上传器,使用 `picgo set uploader` 命令进行配置
Binary file added extensions/picgo/media/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/media/picgo-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/media/picgo-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/media/picgo-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/media/picgo-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/metadata/picgo-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/metadata/picgo-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/metadata/picgo-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/picgo/metadata/picgo-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading