Skip to content

menu add / edit

A menu is an activity-bar icon with a tree view of items (panels, commands, URLs, and groups). Use menu add to create one, menu edit to add items.

Terminal window
vsceasy menu add --name settings --title "Settings" --icon settings-gear
FlagTypeNotes
--nametextRequired. Menu id (file basename in src/menus/).
--titletextTitle shown on the view container.
--iconcodiconRequired. Activity-bar icon.

Add one item to an existing menu.

Terminal window
vsceasy menu edit --name settings --kind panel --panel usersList --label Users --icon account
FlagTypeNotes
--namemenu idRequired. Which menu to edit.
--kindpanel | command | url | groupRequired. Item type.
--groupgroup labelParent group. Defaults to root.
--panelpanel idRequired when --kind panel.
--commandcommand idRequired when --kind command.
--urlurlRequired when --kind url.
--labeltextItem label. Defaults from the target.
--iconcodiconItem icon.

Examples

Terminal window
# create a menu
vsceasy menu add --name settings --title "Settings" --icon settings-gear
# add a panel item
vsceasy menu edit --name settings --kind panel --panel dashboard --label Dashboard --icon play
# add a command item under a group
vsceasy menu edit --name settings --kind command --command sayHello --group Actions --icon play
# add an external link
vsceasy menu edit --name settings --kind url --url https://example.com --label Docs --icon book
src/menus/settings.ts
import { defineMenu } from '../shared/vsceasy';
export default defineMenu({
title: 'Settings',
icon: 'settings-gear',
items: [
{
label: 'Panels',
children: [
{ label: 'Dashboard', icon: 'play', panel: 'dashboard' },
{ label: 'Users', icon: 'account', panel: 'usersList' },
],
},
],
});