ForkSnowflake (Arctic)Snowflake (Arctic)published Sep 11, 2025seen Jun 26

Snowflake-Labs/bluebazel

forked from NVIDIA/bluebazel

Open original ↗

Captured source

source ↗
published Sep 11, 2025seen Jun 26captured 2whttp 200method plain

Snowflake-Labs/bluebazel

Description: Blue Bazel: A vscode extension for bazel building, running, and testing with UI

Language: TypeScript

License: MIT

Stars: 0

Forks: 0

Open issues: 0

Created: 2025-09-11T05:11:15Z

Pushed: 2025-10-31T20:23:27Z

Default branch: main

Fork: yes

Parent repository: NVIDIA/bluebazel

Archived: no

README:

![Icon](images/icon_small.png) Blue Bazel

VS Code Extension for Bazel projects

This extension provides integration into Visual Studio Code for building, running, debugging, and testing bazel or dazel projects.

![Demo of Blue Bazel Debug](images/demo_debug.gif)

Keep track of targets with custom environment variables, arguments, and configuration. ![Screenshot of Blue Bazel](images/screenshot.png)

Test and debug unit tests and main functions right from the code editor. ![Screenshot of Blue Bazel Test Code Lens](images/test_codelens_screenshot.png)

Follow the steps to install the extension:

1. Select Extensions (Ctrl + Shift + X) 2. Open "More Action" menu 3. Click "Install from VSIX..." 4. Select VSIX file 5. Reload VScode

The VSIX files can be found in the releases folder. Unless you would like to modify the extension, you do not need to build it.

After installing the extension, a BLUE BAZEL view will be added to the explorer panel:

How to Build (for extension developers)

1. Run npm install in the project root folder. 2. Build with npm run compile. 3. Generate vsix file by running vsce package --out=.

Keyboard Binding

Follow the steps below to bind keyboard shortcuts to specific commands that are provided by this extension:

1. Open "Preferences: Open Keyboard Shortcuts (JSON)" via Ctrl + Shift + P. 2. Add a key shortcut for a command like this:

{
"key": "",
"command": ""
}

Commands

1. bluebazel.build - Build the selected build target 2. bluebazel.run - Run the selected run target 3. bluebazel.debug - Debug the selected run target 4. bluebazel.test - Test the selected test target 5. bluebazel.editRunArgs - Set run arguments for the currently selected run target 6. bluebazel.editTestArgs - Set test arguments for the currently selected test target 7. bluebazel.clean - Clean 8. bluebazel.format - Run the format command (set in settings) 9. bluebazel.buildCurrentFile - Build current active file 10. bluebazel.addActionAndTarget - Add a new action and target.

Example

{
"key": "ctrl+b",
"command": "bluebazel.build"
}

Custom Buttons

It is possible to add buttons with custom commands to the bazel view container.

The extension introduces two different types of configuration which allows users to define their own shell commands with a set of keywords that make it possible to interact with the other user variables such as selected run target, build target etc.

In order to add new buttons and commands to the bazel view container, please open the bazel extension settings in vscode (Settings -> Extensions -> Blue bazel) and click on the relevant "Edit in settings.json" so as to get the default values filled in in the settings.json file before modifying them:

Shell Commands configuration

Shell Commands configuration defines a set of functions, which can be called by wrapping the name of the configuration between ``.

The configuration has the following syntax:

"bluebazel.shellCommands": [
{
"name": "myCommand1",
"command": "A shell command"
}
]

Example:

"bluebazel.shellCommands": [
{
"name": "myEcho",
"command": "echo this is my custom shell command"
},
{
"name": "myEchoEcho",
"command": "echo " // This will execute the command `myEcho` and echo the result.
}
]

Custom Button configuration

Custom buttons configuration allows the user to add sections and buttons to the bazel view container, and link them to a command.

A custom button configuration has the following syntax:

"bluebazel.customButtons": [
{
"title": "MyCustomSection",
"buttons": [
{
"title": "MyCustomButton",
"command": "command to run on shell",
"description": "MyCustomButton description",
"tooltip": "MyCustomButton tooltip",
"methodName": "bluebazel.myCustomButton" // Unique methodName can be used to bind keyboard to the command.
},
{
"title": "MyCustomButton2",
"command": "command to run on shell",
"description": "MyCustomButton2 description",
"tooltip": "MyCustomButton2 tooltip",
"methodName": "bluebazel.myCustomButton2"
}
]
}
]

Note that commands in custom buttons can call the shell commands. Here is an example:

"bluebazel.customButtons": [
{
"title": "MyCustomSection",
"buttons": [
{
"title": "Echo something",
"command": "echo ", // Calls myEchoEcho from shell commands.
"description": "Echoes something",
"tooltip": "Echoes something",
"methodName": "bluebazel.echoEcho"
}
]
}
]

Note that a new button can also be added to an existing section by setting the title to the corresponding section's title.

Keywords

There are several keywords that can be used to receive user inputs:

1. ${bluebazel.runTarget}: Current run target. Example: //src/application:application. 2. ${bluebazel.buildTarget}: Current build target. Example: //src/application/.... 3. ${bluebazel.testTarget}: Current test target. 4. ${bluebazel.bazelBuildArgs}: Current bazel build arguments. 5. ${bluebazel.bazelRunArgs}: Current bazel run arguments. 6. ${bluebazel.bazelTestArgs}: Current bazel test arguments. 7. ${bluebazel.runArgs}: Current run arguments. 8. ${bluebazel.testArgs}: Current test arguments. 9. ${bluebazel.buildConfigs}: Current list of build configs. Example: --config=debug. 10. ${bluebazel.runConfigs}: Current list of run configs. Example: --config=debug. 11. ${bluebazel.testConfigs}: Current list of test configs. Example: --config=debug. 12. ${bluebazel.executable}: The current executable path to bazel. Example: ./bazel. 13. ${bluebazel.buildEnvVars}: The current build environment variables. 14. ${bluebazel.runEnvVars}: The current run environment variables. 15. ${bluebazel.testEnvVars}: The current test environment variables. 16. ${bluebazel.testEnvVars}: The current test env variables. 17. ${bluebazel.formatCommand}: The current format command. Example: run //:format.

Here are additional keywords to receive user input at the time of the execution:

1. [Pick(arg)]: This shows an item list for the user to choose one from. arg must be a command that returns multiline string where each line corresponds to an...

Excerpt shown — open the source for the full document.