Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devc

Quickly add .devcontainer configuration to any JavaScript project, and more!

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

📦 devc

NPM version Build Status Node version XO code style License

Quickly add .devcontainer configuration to any JavaScript project, and more!

But wait, what's a dev container?

A dev container is a full development environment packaged into a Docker container. It's ready to use, easy to update and painless to share with your team. It also brings the complete VS Code experience through the Remote Development extension pack. Dev containers can run locally on your machine, or in the cloud through services like GitHub Codespaces.

You can learn more about dev containers here or watch this introduction video series.

Getting started

There are multiple ways to use the devc tool:

  • Install globally as a CLI tool: npm install -g devc
  • Generate a dev container configuration in a project without installing: npm init devc or yarn create devc or pnpm create devc
  • Add a dev container configuration to an Angular project ng add devc

While the main use case is to generate a dev container configuration, there are also other features provided by the CLI if you install it. For example, you can run a command in a dev container (even if it's not started) or open VS Code directly in a dev container.

Usage

Usage: devc [command] [options]

Commands:
  init                Initialize dev container config (default command)
    -s, --stack <name1, name2, ...>
                      Set the stack to be used (default: autodetect)
    -p, --packageManager <npm|yarn|pnpm>
                      Set package manager (default: autodetect)
    -d, --detect      Force stack detection even if stack option is set
    --list            List available tech stacks

  code [path]         Open folder in a VS Code dev container
    -i, --insiders    Use insiders version of VS Code

  shell [command]     Open a shell in dev container
    -e, --exec <cmd>  Execute command in container shell

General options:
    -v, --version     Show version
    --help            Show this help

Init

devc init will create a .devcontainer folder in the current directory with the configuration for the current project.

By default, it will detect automatically which package manager and which stack is used. You can override this by using the --packageManager and --stack options. Using --stack will override the detection and only use the specified stack, but you can use --detect to use autodetection in addition to your --stack value.

To list available supported stacks, use devc init --list.

Note: the base dev container configuration generated can work with any Node.js project, and it's always possible to customize it after initialization.

Code

devc code will open the current folder in a VS Code dev container directly.

If no path is specified, it will open the current folder. You can also use the --insiders option to open the Insiders version of VS Code.

Shell

devc shell will open an interactive shell in the current folder in an existing dev container.

If the dev container is not running, it will start it for the duration of your session and stop it when you exit the shell.

Using the --exec option, you can directly execute a single command in the dev container shell, without going interactive.

Note: currently, the dev container must have been created in VS Code before you can use this command. Building the dev container from the command line is not (yet) supported.

Contributing

Contributions are welcome! :heart: You can have a look at the contributing guide to learn how to contribute to this project.

Keywords

FAQs

Package last updated on 09 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc