pinme

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PinMe Skill

PinMe Skill

Use PinMe CLI to upload files and get a preview URL.
使用PinMe CLI上传文件并获取预览URL。

When to Use

使用场景

General File Upload

通用文件上传

  • User wants to upload any files or folders to IPFS
  • User wants to share files via decentralized storage
  • User mentions "pinme", "pin", "IPFS", or "upload to IPFS"
  • 用户希望将任意文件或文件夹上传至IPFS
  • 用户希望通过去中心化存储共享文件
  • 用户提及"pinme"、"pin"、"IPFS"或"上传至IPFS"

Website Deployment

网站部署

  • User requests deployment of a frontend project
  • User wants to deploy a static website
  • After building a frontend project (Vue, React, Next.js, etc.)
  • 用户请求部署前端项目
  • 用户希望部署静态网站
  • 前端项目(Vue、React、Next.js等)构建完成后

Upload Steps

上传步骤

1. Check if PinMe is Installed

1. 检查PinMe是否已安装

bash
pinme --version
If not installed:
bash
npm install -g pinme
bash
pinme --version
若未安装:
bash
npm install -g pinme

2. Identify Upload Target

2. 确定上传目标

For general files:
  • Use the file or directory path specified by the user
  • Can be any file type: images, documents, archives, etc.
For website deployment: Look for build output directories (in priority order):
  1. dist/
    - Vue/React/Vite default output
  2. build/
    - Create React App output
  3. out/
    - Next.js static export
  4. public/
    - Pure static projects
通用文件上传:
  • 使用用户指定的文件或目录路径
  • 支持任意文件类型:图片、文档、压缩包等
网站部署: 按以下优先级查找构建输出目录:
  1. dist/
    - Vue/React/Vite默认输出目录
  2. build/
    - Create React App输出目录
  3. out/
    - Next.js静态导出目录
  4. public/
    - 纯静态项目目录

3. Execute Upload

3. 执行上传

bash
pinme upload <path>
Examples:
bash
undefined
bash
pinme upload <path>
示例:
bash
undefined

Upload a single file

上传单个文件

pinme upload ./document.pdf
pinme upload ./document.pdf

Upload a folder

上传文件夹

pinme upload ./my-folder
pinme upload ./my-folder

Upload website build output

上传网站构建输出

pinme upload dist
undefined
pinme upload dist
undefined

4. Return Result

4. 返回结果

After successful upload, return the preview URL:
https://pinme.eth.limo/#/preview/<hash>
Users can visit the preview page to:
  • View or download the uploaded files
  • Get a fixed domain:
    https://<name>.pinit.eth.limo
上传成功后,返回预览URL:
https://pinme.eth.limo/#/preview/<hash>
用户可访问预览页面进行以下操作:
  • 查看或下载已上传的文件
  • 获取固定域名:
    https://<name>.pinit.eth.limo

Router Mode Check

路由模式检查

Before building a frontend project for IPFS deployment, ensure it uses hash mode routing (e.g.,
/#/about
). History mode (e.g.,
/about
) will cause 404 errors on sub-routes when deployed to IPFS, because there is no server to handle fallback routing.
  • React: Use
    HashRouter
    instead of
    BrowserRouter
  • Vue: Use
    createWebHashHistory()
    instead of
    createWebHistory()
在构建要部署到IPFS的前端项目之前,请确保项目使用哈希模式路由(例如
/#/about
)。历史模式(例如
/about
)部署到IPFS后,子路由会出现404错误,因为IPFS没有服务器处理回退路由。
  • React:使用
    HashRouter
    替代
    BrowserRouter
  • Vue:使用
    createWebHashHistory()
    替代
    createWebHistory()

Important Rules

重要规则

DO:
  • Verify the file or directory exists before uploading
  • Return the preview URL to the user
DO NOT:
  • Upload
    node_modules/
  • Upload
    .env
    files
  • Upload
    .git/
    directory
  • Upload empty or non-existent paths
For website deployment, also avoid:
  • Uploading source code instead of build output
  • Uploading configuration files (package.json, tsconfig.json, etc.)
需要执行:
  • 上传前验证文件或目录是否存在
  • 向用户返回预览URL
禁止操作:
  • 上传
    node_modules/
    目录
  • 上传
    .env
    文件
  • 上传
    .git/
    目录
  • 上传空路径或不存在的路径
网站部署额外注意:
  • 上传源代码而非构建输出文件
  • 上传配置文件(package.json、tsconfig.json等)

Common Workflows

常见工作流

General File Upload

通用文件上传

bash
undefined
bash
undefined

Upload a single file

上传单个文件

pinme upload ./image.png
pinme upload ./image.png

Upload a folder

上传文件夹

pinme upload ./my-documents
pinme upload ./my-documents

Upload with specific path

上传指定路径下的文件

pinme upload /path/to/files
undefined
pinme upload /path/to/files
undefined

Website Deployment

网站部署

Vue/Vite

Vue/Vite

bash
npm run build
pinme upload dist
bash
npm run build
pinme upload dist

React CRA

React CRA

bash
npm run build
pinme upload build
bash
npm run build
pinme upload build

Next.js Static

Next.js静态导出

bash
npm run build
npm run export  # or next export
pinme upload out
bash
npm run build
npm run export  # 或使用next export
pinme upload out

Error Handling

错误处理

ErrorSolution
command not found: pinme
Run
npm install -g pinme
No such file or directory
Check path exists
Permission denied
Check file/folder permissions
Upload failedCheck network, retry
错误解决方案
command not found: pinme
执行
npm install -g pinme
No such file or directory
检查路径是否存在
Permission denied
检查文件/文件夹权限
上传失败检查网络后重试

Other Commands

其他命令

bash
undefined
bash
undefined

List upload history

列出上传历史

pinme list pinme ls -l 5
pinme list pinme ls -l 5

Remove uploaded file

删除已上传文件

pinme rm <hash>
undefined
pinme rm <hash>
undefined