
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This project packages up a number of productivity-enhancing tools for KiCad ([***] primarily focused on automating generation of fabrication outputs and commandline productivity for projects tracked in git.
make fabrication-outputs wil automatically create the following outputs in an output directory:
All of this is built on other projects:
As of this writing, these tools target KiCad 5.1, running in a Docker container. While Docker does add a small amount of overhead, it helps compartmentalize the complexity of orchestrating these tools and (most importantly) makes it possible to generate schematic output from eeschema by running KiCad on a known configuration of an Ubuntu machine with a headless virtual X server.
Dockerization makes it possible to run these tools consistently on different platforms; macOS and Linux have been tested, Windows should also work though that is as-yet untested.
Before setting up this package, you should have both Docker and git installed on your workstation.
cd /opt/kicad-tools git submodule update --init make
This will spin for a while, downloading Ubuntu, KiCad, and the various tools we use.
Alternatively, you can use the pre-built image from Github Container Registry:
``` docker image tag ghcr.io/obra/kicad-tools:latest kicad-automation ```
If you get an error about being unable to connect to Docker, your Docker configuration
may require you to 'sudo' to run Docker. In that case
sudo make
Eventually, you should see something like 'Successfully built 6476202f4575'
export PATH=/opt/kicad-tools/bin:$PATH to your .bashrc or its equivalent.If you needed to run sudo make before, you should also add the line export DOCKER_NEEDS_SUDO=1 just below the PATH line.
You will need to restart your shell before it picks up any changes to your .bashrc or equivalent.
If you'd prefer to be able to run Docker containers without sudo,
you can find instructions for that here:
https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user
brew install coreutils
You can verify that everything you've done so far is working by typing
kicad-docker-run hostname
You should see something like this:
0230e9b27ebb
If you don't get an error, things are on the right track.
A sample Makefile is distributed with this package. You can find it in the 'etc' directory.
cp /opt/git-tools/etc/Makefile ./Makefile
WARNING: DO NOT BLINDLY RUN THAT COMMAND IF YOU ALREADY HAVE A MAKEFILE.
To enable automatic graphical diffs of PCB layouts, you need to teach git how to handle .kicad_pcb files
# echo "*.kicad_pcb diff=kicad_pcb" >> `git rev-parse --show-toplevel`/.gitattributes # git config diff.kicad_pcb.command /opt/kicad-tools/bin/git-pcbdiff
Generating diff-able PNGs of schematics and boards is a fairly slow operation. Because of that, we cache the generated files. By default, they're cached in /tmp. Each board and schematic is uniquely identified in the cache, so it's safe to share a cache across multiple projects.
You may want to *** persisting the cache across reboots.
To configure the PCB image cache, set the environment variable BOARD_CACHE_DIR. For example, you could add this to your .bashrc
export BOARD_CACHE_DIR=$HOME/.kicad-tools/cache/boards
To configure the schematic image cache, set the environment variable SCHEMATIC_CACHE_DIR. For example, you could add this to your .bashrc
export SCHEMATIC_CACHE_DIR=$HOME/.kicad-tools/cache/schematics
By default, all build artifacts are created in a subdirectory of the 'out' directory of your project.
To customize the name of the subdirectory artifacts are created in, set the BOARD_SNAPSHOT_LABEL environment variable.
To customize the output directory, set the OUTPUT_PATH environment variable.
To generate a whole package of fabrication outputs,
$ make fabrication-outputs
To generate SVG schematics
$ make schematic-svg
To generate PDF schematics
$ make schematic-pdf
To generate gerbers, pdfs, dxfs, and svgs of your layout
$ make gerbers
To generate a CSV bom
$ make bom
To generate an HTML interactive BOM
$ make interactive-bom
If you need to log into the docker instance to debug something, there's a makefile target for that, too
$ make docker-shell
If you've configured git as described above, the regular git diff tool will show you a visual diff between two versions of a .kicad_pcb file.
In the future, this functionality may move to only running if you use git difftool -gui
To show the difference between your current checkout and the HEAD of your current branch, run
$ git diff HEAD my_board.kicad_pcb
Due to some limitations in the information git provides to external git diff tools, you need to use a special command to compare schematics.
To compare the current checkout to the HEAD of your current branch
$ git schematic-diff HEAD my_board.sch
To compare the version of my_board.sch in master to the version as of tag rev1
$ git schematic-diff master rev1 my_board.sch
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务