save-artifact
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesave-artifact
save-artifact
Save target artifacts to ~/projects/artifacts-viewer for easy viewing and organization.
将目标工件保存到~/projects/artifacts-viewer目录,以便于查看和整理。
Quick Usage
快速使用指南
- Ensure target directory exists: (auto-created if missing)
~/projects/artifacts-viewer - Save artifact: Copy or move the file to artifacts-viewer with appropriate naming
- Git operations: Initialize git repo and push to GitHub when needed
- 确保目标目录存在:(若不存在则自动创建)
~/projects/artifacts-viewer - 保存工件:将文件复制或移动到artifacts-viewer目录,并使用具有描述性的名称
- Git操作:在需要时为artifacts-viewer初始化Git仓库并推送到GitHub
Supported File Types
支持的文件类型
- Documents: ,
.pdf,.doc.docx - Presentations: ,
.ppt.pptx - Markdown: ,
.md.mdx - Images: ,
.png,.jpg,.jpeg,.gif.svg - Other: ,
.txt.json
- 文档类:,
.pdf,.doc.docx - 演示文稿类:,
.ppt.pptx - Markdown文件:,
.md.mdx - 图片类:,
.png,.jpg,.jpeg,.gif.svg - 其他类型:,
.txt.json
Workflow
工作流程
Save Artifact
保存工件
bash
undefinedbash
undefinedEnsure directory exists
Ensure directory exists
mkdir -p ~/projects/artifacts-viewer
mkdir -p ~/projects/artifacts-viewer
Copy artifact to viewer (use descriptive name)
Copy artifact to viewer (use descriptive name)
cp <source-file> ~/projects/artifacts-viewer/<descriptive-name>
undefinedcp <source-file> ~/projects/artifacts-viewer/<descriptive-name>
undefinedGit Operations
Git操作
bash
cd ~/projects/artifacts-viewer
git init
git add .
git commit -m "Add artifacts"
git remote add origin https://github.com/<username>/artifacts-viewer.git
git push -u origin mainbash
cd ~/projects/artifacts-viewer
git init
git add .
git commit -m "Add artifacts"
git remote add origin https://github.com/<username>/artifacts-viewer.git
git push -u origin mainScript Usage
脚本使用方法
Use for automated saving:
scripts/save_artifact.pybash
python3 scripts/save_artifact.py <source_path> [--name <custom_name>] [--category <category>]Categories: docs, slides, markdown, images, diagrams, other
使用进行自动化保存:
scripts/save_artifact.pybash
python3 scripts/save_artifact.py <source_path> [--name <custom_name>] [--category <category>]分类选项:docs, slides, markdown, images, diagrams, other
Notes
注意事项
- Always use descriptive, unique names for artifacts
- Consider organizing by category subdirectories if needed
- Commit and push to GitHub for version control and sharing
- 始终为工件使用描述性的唯一名称
- 如有需要,可考虑按分类子目录进行整理
- 提交并推送到GitHub以实现版本控制和共享