# @codemirror/commands

> Collection of editing commands for the CodeMirror code editor

Latest version **6.11.0** (published 2026-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codemirror/commands
pnpm add @codemirror/commands
yarn add @codemirror/commands
bun add @codemirror/commands
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.11.0 |
| Published | 2026-08-16 |
| First published | 2020-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 240.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marijn Haverbeke |
| Maintainers | marijn |
| Keywords | editor, code |

## Links

- npm: https://www.npmjs.com/package/@codemirror/commands
- Repository: https://code.haverbeke.berlin/codemirror/commands
- npm.io page: https://npm.io/package/@codemirror/commands

## Dependencies (4)

- [@lezer/common](https://npm.io/package/@lezer/common.md) ^1.1.0
- [@codemirror/view](https://npm.io/package/@codemirror/view.md) ^6.27.0
- [@codemirror/state](https://npm.io/package/@codemirror/state.md) ^6.7.0
- [@codemirror/language](https://npm.io/package/@codemirror/language.md) ^6.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 6.11.0 (latest) — 2026-08-16
- 6.10.4 — 2026-06-23
- 6.10.3 — 2026-03-12
- 6.10.2 — 2026-02-06
- 6.10.1 — 2025-12-17
- 6.10.0 — 2025-10-23
- 6.9.0 — 2025-10-02
- 6.8.1 — 2025-03-31
- 6.8.0 — 2025-01-08
- 6.7.1 — 2024-10-21
- 6.7.0 — 2024-10-07
- 6.6.2 — 2024-09-17
- 6.6.1 — 2024-08-31
- 6.6.0 — 2024-06-04
- 6.5.0 — 2024-04-19
- … 37 more at https://npm.io/package/@codemirror/commands/versions

## README

# @codemirror/commands [![NPM version](https://img.shields.io/npm/v/@codemirror/commands.svg)](https://www.npmjs.org/package/@codemirror/commands)

[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#commands) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/commands/src/branch/main/CHANGELOG.md) ]

This package implements a collection of editing commands for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://code.haverbeke.berlin/codemirror/commands/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import {EditorView, keymap} from "@codemirror/view"
import {standardKeymap, selectLine} from "@codemirror/commands"

const view = new EditorView({
  parent: document.body,
  extensions: [
    keymap.of([
      ...standardKeymap,
      {key: "Alt-l", mac: "Ctrl-l", run: selectLine}
    ])
  ]
})
```

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