BitBake — 18 Operations for AI Agents

BitBake recipes build embedded Linux itself — Yocto layers, package recipes, image definitions. act101 navigates recipes and their tasks structurally, so agents work across layer stacks without losing track of what overrides what.

This page is the canonical reference an AI coding agent uses to refactor, query, and analyze BitBake code through the act MCP server. 18 operations available: 0 refactor, 18 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.

18Query

Worked BitBake examples

act101 reads a BitBake recipe's variable assignments (SUMMARY = "...", DEPENDS = "...") as variable declarations named for the variable, its shell task functions (do_compile() { ... }) and Python task functions (python do_configure:prepend() { ... }) as function declarations named for the task, and its inherit directive as an import, named for the entire inherit systemd statement rather than just the class name. symbols covers the variable and function cases identically to the skeleton, but has no rule for inherit at all, so that declaration disappears. The unit of structure is the variable, the task function, and the inherited class: act101 does not read a task function's shell or Python body as declarations of its own. Each example below is the verbatim output of the command shown, run against the file shown. Query outputs are pretty-printed with the timing block omitted.

Read the recipe's variables, tasks, and inherit directive as a skeleton

sensord_1.0.bb packages a sensor daemon: four metadata variables, an inherit systemd directive, a do_compile and do_install shell task, and a Python do_configure:prepend override.

$ act query skeleton sensord_1.0.bb

Before

SUMMARY = "Sensor daemon reading I2C telemetry"
LICENSE = "MIT"
DEPENDS = "libgpiod i2c-tools"
SRC_URI = "git://example.com/sensord.git;branch=main"

inherit systemd

do_compile() {
    oe_runmake
}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 sensord ${D}${bindir}
}

python do_configure:prepend() {
    bb.note("configuring sensord")
}

Output

{
    "type": "Skeleton",
    "declarations": [
        {
            "kind": "variable",
            "name": "SUMMARY",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 1,
                    "byte_offset": 0
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 48,
                    "byte_offset": 47
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 1,
                    "byte_offset": 0
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 8,
                    "byte_offset": 7
                }
            }
        },
        {
            "kind": "variable",
            "name": "LICENSE",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 1,
                    "byte_offset": 48
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 16,
                    "byte_offset": 63
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 1,
                    "byte_offset": 48
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 8,
                    "byte_offset": 55
                }
            }
        },
        {
            "kind": "variable",
            "name": "DEPENDS",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 1,
                    "byte_offset": 64
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 31,
                    "byte_offset": 94
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 1,
                    "byte_offset": 64
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 8,
                    "byte_offset": 71
                }
            }
        },
        {
            "kind": "variable",
            "name": "SRC_URI",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 1,
                    "byte_offset": 95
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 54,
                    "byte_offset": 148
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 1,
                    "byte_offset": 95
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 8,
                    "byte_offset": 102
                }
            }
        },
        {
            "kind": "import",
            "name": "inherit systemd",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 6,
                    "column": 1,
                    "byte_offset": 150
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 6,
                    "column": 16,
                    "byte_offset": 165
                }
            }
        },
        {
            "kind": "function",
            "name": "do_compile",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 8,
                    "column": 1,
                    "byte_offset": 167
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 10,
                    "column": 2,
                    "byte_offset": 198
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 8,
                    "column": 1,
                    "byte_offset": 167
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 8,
                    "column": 11,
                    "byte_offset": 177
                }
            }
        },
        {
            "kind": "function",
            "name": "do_install",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 12,
                    "column": 1,
                    "byte_offset": 200
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 15,
                    "column": 2,
                    "byte_offset": 287
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 12,
                    "column": 1,
                    "byte_offset": 200
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 12,
                    "column": 11,
                    "byte_offset": 210
                }
            }
        },
        {
            "kind": "function",
            "name": "do_configure",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 17,
                    "column": 1,
                    "byte_offset": 289
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 19,
                    "column": 2,
                    "byte_offset": 357
                }
            },
            "name_range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 17,
                    "column": 8,
                    "byte_offset": 296
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 17,
                    "column": 20,
                    "byte_offset": 308
                }
            }
        }
    ]
}

The skeleton reports SUMMARY, LICENSE, DEPENDS, and SRC_URI as variable declarations, inherit systemd as a single import, and do_compile, do_install, and do_configure as function declarations — the last one named for its base task, without the :prepend override suffix.

List the variables and task functions as symbols

do_install installs the compiled sensord binary into ${D}${bindir} after do_compile runs oe_runmake.

$ act query symbols sensord_1.0.bb

Before

SUMMARY = "Sensor daemon reading I2C telemetry"
LICENSE = "MIT"
DEPENDS = "libgpiod i2c-tools"
SRC_URI = "git://example.com/sensord.git;branch=main"

inherit systemd

do_compile() {
    oe_runmake
}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 sensord ${D}${bindir}
}

python do_configure:prepend() {
    bb.note("configuring sensord")
}

Output

{
    "type": "Symbols",
    "symbols": [
        {
            "name": "SUMMARY",
            "kind": "variable",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 1,
                    "byte_offset": 0
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 1,
                    "column": 8,
                    "byte_offset": 7
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "LICENSE",
            "kind": "variable",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 1,
                    "byte_offset": 48
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 2,
                    "column": 8,
                    "byte_offset": 55
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "DEPENDS",
            "kind": "variable",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 1,
                    "byte_offset": 64
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 3,
                    "column": 8,
                    "byte_offset": 71
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "SRC_URI",
            "kind": "variable",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 1,
                    "byte_offset": 95
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 4,
                    "column": 8,
                    "byte_offset": 102
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "do_compile",
            "kind": "function",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 8,
                    "column": 1,
                    "byte_offset": 167
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 8,
                    "column": 11,
                    "byte_offset": 177
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "do_install",
            "kind": "function",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 12,
                    "column": 1,
                    "byte_offset": 200
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 12,
                    "column": 11,
                    "byte_offset": 210
                }
            },
            "visibility": "unknown"
        },
        {
            "name": "do_configure",
            "kind": "function",
            "range": {
                "start": {
                    "file": "sensord_1.0.bb",
                    "line": 17,
                    "column": 8,
                    "byte_offset": 296
                },
                "end": {
                    "file": "sensord_1.0.bb",
                    "line": 17,
                    "column": 20,
                    "byte_offset": 308
                }
            },
            "visibility": "unknown"
        }
    ]
}

symbols reports the identical four variable declarations and three function declarations as skeleton; the inherit systemd declaration has no rule in this query and is absent.

Query

18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.

callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch

← BigQuery SQLC →