Skip to Content
DocumentationDocumentationProvidersVS Code Extensions

VS Code Extensions Provider

Wraps the code command-line tool to manage VS Code extensions. Clicking through the extension store one at a time on every new machine is one of life’s lesser joys — this provider exists to make that moment disappear.

Platforms: macOS, Linux

Usage

# Install (publisher.name form) hams code install esbenp.prettier-vscode # Remove hams code uninstall esbenp.prettier-vscode # See what's managed hams code list

To find an extension’s ID: open the VS Code extensions panel, right-click any extension → Copy Extension ID. That publisher.name string is what you want.

Hamsfile example

# macOS/vscodeext.hams.yaml schema_version: 1 provider: vscodeext groups: - tag: language-support items: - app: golang.go intro: Rich Go language support. - app: rust-lang.rust-analyzer intro: Rust language server. - app: dbaeumer.vscode-eslint intro: ESLint integration. - tag: theme items: - app: esbenp.prettier-vscode intro: Prettier formatter for VS Code. - app: PKief.material-icon-theme

How state is probed

code --list-extensions prints one extension ID per line. hams reads that list. Blunt but works.

Bootstrap

The machine needs to have code on the PATH. On macOS you have to manually run “Shell Command: Install ‘code’ command in PATH” from the VS Code command palette after installing the app. Automate it with a bash provider step:

- urn: "urn:hams:bash:link-vscode-cli" step: Link VS Code CLI run: ln -sf "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code check: command -v code

Cursor, VSCodium, and other VS Code forks

The code provider targets VS Code specifically — it will not be repurposed to point at cursor or codium via a cli_command override. If you want to manage Cursor extensions, a dedicated cursor provider will be added alongside (v1.1+). Until then, use a bash step:

- urn: "urn:hams:bash:cursor-ext-prettier" step: Install Prettier extension in Cursor run: cursor --install-extension esbenp.prettier-vscode check: cursor --list-extensions | grep -q esbenp.prettier-vscode

User settings (settings.json) and key bindings (keybindings.json) are out of scope for this provider — they’re just dotfiles. Use the file provider, or clone a dotfiles repo with hams git clone.

Last updated on