pinme
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePinMe 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 --versionIf not installed:
bash
npm install -g pinmebash
pinme --version若未安装:
bash
npm install -g pinme2. 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):
- - Vue/React/Vite default output
dist/ - - Create React App output
build/ - - Next.js static export
out/ - - Pure static projects
public/
通用文件上传:
- 使用用户指定的文件或目录路径
- 支持任意文件类型:图片、文档、压缩包等
网站部署:
按以下优先级查找构建输出目录:
- - Vue/React/Vite默认输出目录
dist/ - - Create React App输出目录
build/ - - Next.js静态导出目录
out/ - - 纯静态项目目录
public/
3. Execute Upload
3. 执行上传
bash
pinme upload <path>Examples:
bash
undefinedbash
pinme upload <path>示例:
bash
undefinedUpload 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
undefinedpinme upload dist
undefined4. 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., ). History mode (e.g., ) will cause 404 errors on sub-routes when deployed to IPFS, because there is no server to handle fallback routing.
/#/about/about- React: Use instead of
HashRouterBrowserRouter - Vue: Use instead of
createWebHashHistory()createWebHistory()
在构建要部署到IPFS的前端项目之前,请确保项目使用哈希模式路由(例如)。历史模式(例如)部署到IPFS后,子路由会出现404错误,因为IPFS没有服务器处理回退路由。
/#/about/about- React:使用替代
HashRouterBrowserRouter - 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 files
.env - Upload directory
.git/ - 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
undefinedbash
undefinedUpload 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
undefinedpinme upload /path/to/files
undefinedWebsite Deployment
网站部署
Vue/Vite
Vue/Vite
bash
npm run build
pinme upload distbash
npm run build
pinme upload distReact CRA
React CRA
bash
npm run build
pinme upload buildbash
npm run build
pinme upload buildNext.js Static
Next.js静态导出
bash
npm run build
npm run export # or next export
pinme upload outbash
npm run build
npm run export # 或使用next export
pinme upload outError Handling
错误处理
| Error | Solution |
|---|---|
| Run |
| Check path exists |
| Check file/folder permissions |
| Upload failed | Check network, retry |
| 错误 | 解决方案 |
|---|---|
| 执行 |
| 检查路径是否存在 |
| 检查文件/文件夹权限 |
| 上传失败 | 检查网络后重试 |
Other Commands
其他命令
bash
undefinedbash
undefinedList upload history
列出上传历史
pinme list
pinme ls -l 5
pinme list
pinme ls -l 5
Remove uploaded file
删除已上传文件
pinme rm <hash>
undefinedpinme rm <hash>
undefined