# generator-code

> Yeoman generator for Visual Studio Code extensions.

Latest version **1.12.0** (published 2026-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install generator-code
pnpm add generator-code
yarn add generator-code
bun add generator-code
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.12.0 |
| Published | 2026-06-23 |
| First published | 2015-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20.5.0 |
| Dependencies | 5 |
| Unpacked size | 240.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1642 |
| Author | VS Code Team |
| Maintainers | microsoft1es, microsoft-oss-releases, alexandrudima, joaomoreno.ms, kaimaetzel, sbatten, lszomoru, vscode-bot |
| Keywords | yeoman-generator, vscode, visual studio, visual studio code, vs code, extensions |

## Links

- npm: https://www.npmjs.com/package/generator-code
- Repository: https://github.com/Microsoft/vscode-generator-code
- Homepage: http://code.visualstudio.com
- Issues: https://github.com/Microsoft/vscode-generator-code/issues
- npm.io page: https://npm.io/package/generator-code

## Dependencies (5)

- [which](https://npm.io/package/which.md) ^7.0.0
- [yosay](https://npm.io/package/yosay.md) ^3.0.0
- [fast-plist](https://npm.io/package/fast-plist.md) ^0.1.3
- [request-light](https://npm.io/package/request-light.md) ^0.8.0
- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^8.2.2

## Recent versions

- 1.12.0 (latest) — 2026-06-23
- 1.2.0-next.3 (next) — 2019-06-25
- 1.11.18 — 2026-02-28
- 1.11.17 — 2026-02-03
- 1.11.16 — 2026-01-09
- 1.11.15 — 2025-12-05
- 1.11.14 — 2025-11-10
- 1.11.13 — 2025-10-02
- 1.11.12 — 2025-09-05
- 1.11.11 — 2025-08-06
- 1.11.10 — 2025-07-04
- 1.11.9 — 2025-04-30
- 1.11.8 — 2025-03-25
- 1.11.7 — 2025-03-03
- 1.11.6 — 2025-02-03
- … 202 more at https://npm.io/package/generator-code/versions

## README

# Yo Code - Extension and Customization Generator
[![npm Package](https://img.shields.io/npm/v/generator-code.svg?style=flat-square)](https://www.npmjs.org/package/generator-code)
[![NPM Downloads](https://img.shields.io/npm/dm/generator-code.svg)](https://npmjs.org/package/generator-code)
[![Build Status](https://github.com/microsoft/vscode-generator-code/actions/workflows/tests.yml/badge.svg)](https://github.com/microsoft/vscode-generator-code/actions/tests.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

We have written a Yeoman generator to help get you started. We plan to add templates for most extension/customization types into this.

## Install the Generator

Install Yeoman and the VS Code Extension generator:

```bash
npm install -g yo generator-code
```

## Run Yo Code

The Yeoman generator will walk you through the steps required to create your customization or extension prompting for the required information.

To launch the generator simply type:

```bash
yo code
```

![The command generator](yocode.png)

## Generator Output

These templates will:

* Create a base folder structure
* Template out a rough `package.json`
* Import any assets required for your extension e.g. tmBundles or the VS Code Library
* For Extensions: Set-up `launch.json` for running your extension and attaching to a process

## Command line

```
Usage:
  yo code [<destination>] [options]

Argument (optional):
  The destination to create the extension in, absolute or relative to the current working
  directory. Use '.' for the current folder.
  If not provided, defaults to a folder in the current working directory with the extension
  display name.

Options:
  -h,   --help                  # Print the generator's options and usage
  -i,   --insiders              # Show the insiders options for the generator
  -q,   --quick                 # Quick mode, skip all optional prompts and use defaults
  -o,   --open                  # Open the generated extension in Visual Studio Code
  -O,   --openInInsiders        # Open the generated extension in Visual Studio Code Insiders
  -t,   --extensionType         # ts, js, colortheme, language, snippets, keymap...
        --extensionId           # Id of the extension
        --extensionDescription  # Description of the extension
        --pkgManager            # 'npm', 'yarn' or 'pnpm'
        --bundle                # 'webpack', 'esbuild'. Bundle the extension with webpack or esbuild
        --gitInit               # Initialize a git repo

Example usages:
  yo code                       # Create an extension in a folder with the extension's name.
  yo code . -O                  # Create an extension in current folder and open with code-insiders
  yo code Hello -t=ts -q        # Create an TypeScript extension in './Hello', skip prompts, use defaults.
  yo code --insiders            # Show the insiders options for the generator
```

## Run Generator using Docker

If you don't want to install nodejs or any node packages, use this method to containerize the generator.

Go into your project directory.

```bash
cd <project directory>
```

Build the docker image from the docker file.

```bash
docker build -t vscode-generator-code .
```

Create a docker container with volumes.

```bash
docker run -it -v $(pwd):/usr/src/app vscode-generator-code
```

## Local development

After making necessary changes, run `npm link` before running `yo code` to
test the local version.

You can learn more about Yeoman generator development on its
[documentation website](https://yeoman.io/authoring/index.html).

## History

* 1.0.0: Generates a VS Code extension for TypeScript 2.0.3
* 0.10.x: Generates a VS Code extension for TypeScript 1.8.10

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/generator-code · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
