File contents Keil Project Compilation
Invoke py_keil_build.py to compile projects via Keil UV4 command-line interface, and return structured build results.
Tool Script
Script Path : py_keil_build.py
Dependencies : Python 3.x standard library + Installed Keil MDK (with UV4.exe)
Usage
# Incremental build (default)
python py_keil_build.py -p <project.uvprojx>
# Full rebuild (clean rebuild)
python py_keil_build.py -p <project.uvprojx> -r
# Specify UV4.exe path
python py_keil_build.py -p <project.uvprojx> -k "D:\keil\UV4\UV4.exe"
Parameter Description
Parameter
Short
Description
Default
--project
-p
.uvprojx file path
Required
--keil
-k
UV4.exe path
D:\application\keil_v5\UV4\UV4.exe
--rebuild
-r
Full rebuild
Incremental build
Output Structure
Returns JSON format result:
{
"status": "success", // "success" or "failed" or "error"
"log_path": "C:\\project\\Objects\\GD32F303RCT6.build_log.htm", // 编译日志路径
"errors": 0, // 编译错误数
"warnings": 3 // 编译警告数
}
Notes
Keil default installation path: D:\application\keil_v5\UV4\UV4.exe, if different please specify with -k
Build output is printed directly to terminal (no log file generated)
Build success is determined by checking if *build_log*.htm exists after compilation
First checks: <project_dir>\Objects\*build_log*.htm
Falls back to searching recursively in project directory
Typical Workflow
First use keil-parser to confirm project configuration is correct
Call this tool to build, check if errors_count is 0
After successful build, use jlink-download to flash firmware
1 --- 2 name: keil-build 3 description: Keil Project Compilation 4 --- 5 6 # Keil Project Compilation 7 8 Invoke `py_keil_build.py` to compile projects via Keil UV4 command-line interface, and return structured build results. 9 10 ## Tool Script 11 12 **Script Path**: `py_keil_build.py` 13 **Dependencies**: Python 3.x standard library + Installed Keil MDK (with UV4.exe) 14 15 ## Usage 16 17 ```bash 18 # Incremental build (default) 19 python py_keil_build.py -p <project.uvprojx> 20 21 # Full rebuild (clean rebuild) 22 python py_keil_build.py -p <project.uvprojx> -r 23 24 # Specify UV4.exe path 25 python py_keil_build.py -p <project.uvprojx> -k "D:\keil\UV4\UV4.exe" 26 ``` 27 28 ## Parameter Description 29 30 | Parameter | Short | Description | Default | 31 | -------------- | ----- | -------------------------- | ------------------------------------- | 32 | `--project` | `-p` | `.uvprojx` file path | **Required** | 33 | `--keil` | `-k` | UV4.exe path | `D:\application\keil_v5\UV4\UV4.exe` | 34 | `--rebuild` | `-r` | Full rebuild | Incremental build | 35 36 ## Output Structure 37 38 Returns JSON format result: 39 40 ```json 41 { 42 "status": "success", // "success" or "failed" or "error" 43 "log_path": "C:\\project\\Objects\\GD32F303RCT6.build_log.htm", // 编译日志路径 44 "errors": 0, // 编译错误数 45 "warnings": 3 // 编译警告数 46 } 47 ``` 48 49 ## Notes 50 51 - Keil default installation path: `D:\application\keil_v5\UV4\UV4.exe`, if different please specify with `-k` 52 - Build output is printed directly to terminal (no log file generated) 53 - Build success is determined by checking if `*build_log*.htm` exists after compilation 54 - First checks: `<project_dir>\Objects\*build_log*.htm` 55 - Falls back to searching recursively in project directory 56 57 ## Typical Workflow 58 59 1. First use `keil-parser` to confirm project configuration is correct 60 2. Call this tool to build, check if `errors_count` is 0 61 3. After successful build, use `jlink-download` to flash firmware
changde-tang/embedded-skills/tree/main/keil-build commit 3563634f2e
Frequently asked questions How do I install the Keil Build skill? Run npx skillmds@latest add changde-tang/keil-build in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Keil Build skill do? Keil Project Compilation It is listed under Coding & Dev Tools on SkillMD.
Is Keil Build safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Keil Build? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Keil Build free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Keil Build? changde-tang (@changde-tang) published this skill. Their other Agent Skills are listed on their SkillMD profile.