# Keil Build

> Compile Keil MDK projects (.uvprojx) via command line using Keil UV4 compiler, supporting incremental build and full rebuild, and parse build results. Trigger scenarios: (1) Compile Keil/MDK ARM project, (2) User mentions "build", "compile", "construct" project, (3) Need to check if project has build errors or warnings, (4) Need to compile before flashing firmware. Even if user just says "compile…

- **Type:** Skill
- **Install:** `agentstack add skill-changde-tang-embedded-skills-keil-build`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [changde-tang](https://agentstack.voostack.com/s/changde-tang)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [changde-tang](https://github.com/changde-tang)
- **Source:** https://github.com/changde-tang/embedded-skills/tree/main/keil-build

## Install

```sh
agentstack add skill-changde-tang-embedded-skills-keil-build
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

```bash
# Incremental build (default)
python py_keil_build.py -p 

# Full rebuild (clean rebuild)
python py_keil_build.py -p  -r

# Specify UV4.exe path
python py_keil_build.py -p  -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:

```json
{
  "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: `\Objects\*build_log*.htm`
  - Falls back to searching recursively in project directory

## Typical Workflow

1. First use `keil-parser` to confirm project configuration is correct
2. Call this tool to build, check if `errors_count` is 0
3. After successful build, use `jlink-download` to flash firmware

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [changde-tang](https://github.com/changde-tang)
- **Source:** [changde-tang/embedded-skills](https://github.com/changde-tang/embedded-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-changde-tang-embedded-skills-keil-build
- Seller: https://agentstack.voostack.com/s/changde-tang
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
