Skip to main content

Open folders in VS Code devcontainers from Nautilus and the CLI

Project description

DevContainer Context Menu

Open any folder as a VS Code (or compatible fork) Devcontainer — from a context menu or the terminal.

Support

  • Windows via a Rust based COM extension
  • Linux (Nautilus) via a python based nautilus extension
  • Command line via a python uvx tool, run uvx code-devcontainer

Changing editor

All version of the extension take the first binary called code on your PATH.

If you want to change to another VS Code fork such as VSCodium then make sure to add it to your PATH.

Required folder structure

The Open in Devcontainer entry appears only for folders that contain a devcontainer config — either by selecting a single directory or right-clicking the background of an open folder. Place the config in either of these locations:

my-project/
├── .devcontainer/
│   └── devcontainer.json   # preferred
└── ...

# or, at the project root:

my-project/
├── devcontainer.json       # fallback
└── ...

The config is resolved in this order:

  1. .devcontainer/devcontainer.json
  2. devcontainer.json

If neither file exists, VS Code still opens the folder in Dev Containers mode and prompts you to create a configuration.

workspaceFolder is read from the config when present; otherwise the container defaults to /workspaces/<folder-name>.

A minimal devcontainer.json:

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu"
}

CLI

dcode              # opens the current directory
dcode ~/my-project # opens the specified directory

Linux — Nautilus context menu

Install the .deb from the latest GitHub release:

sudo dpkg -i code-devcontainer_*_all.deb

Then restart Nautilus:

nautilus -q

Right-click any folder (or the background of an open folder) that contains a devcontainer config and choose Open in Devcontainer. The entry only appears for folders that have a config.

Windows — Explorer context menu

Download code-devcontainer-setup.exe from the latest GitHub release and run it. No admin rights required.

Right-click any folder (or the background of an open folder) that contains a devcontainer config and choose Open in Devcontainer. The entry only appears for folders that have a config. Uninstall from Settings → Apps ("Open in Devcontainer").

Development

uv sync
just test        # run tests with coverage
just lint        # ruff check + format
just typecheck   # ty check

Release

Trigger the Release workflow in GitHub Actions and choose patch, minor, or major. This bumps the version, publishes to PyPI, builds a .deb and Windows installer, and creates a GitHub release with all assets attached.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devcontainer_context_menu-0.1.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devcontainer_context_menu-0.1.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file devcontainer_context_menu-0.1.3.tar.gz.

File metadata

File hashes

Hashes for devcontainer_context_menu-0.1.3.tar.gz
Algorithm Hash digest
SHA256 15777aca3323806b7707db710d6688b1328c002d264eb8bccaa1e750d81de72b
MD5 42f85681950468298c45b7e598fe1021
BLAKE2b-256 4899466a15161bffb2e2f571052e685ed82c3a390921c381d59b5e4ff0437511

See more details on using hashes here.

Provenance

The following attestation bundles were made for devcontainer_context_menu-0.1.3.tar.gz:

Publisher: release.yml on SrzStephen/devcontainer-context-menu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devcontainer_context_menu-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for devcontainer_context_menu-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a76bf8f0f7149dfa2d7707da31bf8bdd206edb9e12cff49880014610e2048be
MD5 d7f9d8389bed5acde297c4632cc669f8
BLAKE2b-256 22e57df71e6d11f03d6f2bd771ef15cb94ed7e20626b019e59b7b82236ad0243

See more details on using hashes here.

Provenance

The following attestation bundles were made for devcontainer_context_menu-0.1.3-py3-none-any.whl:

Publisher: release.yml on SrzStephen/devcontainer-context-menu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page