Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A CLI/TUI that simplifies launching VSCode projects, with a focus on dev containers

License

NotificationsYou must be signed in to change notification settings

michidk/vscli

Repository files navigation

MIT LicenseContinuous integration

A CLI/TUI which makes it easy to launchVisual Studio Code (vscode)dev containers. Also supports other editors likeCursor.

Screenshot showing the recent UI feature.

Readhere about the journey of reverse engineering Microsoft's dev container CLI in order to make this.

Features

  • A shorthand for launching vscode projects (to be used like thecode command but with dev container support)
  • Supports different editors likevscode,vscode-insiders,cursor and other vscode forks
  • Detects whether a project is adev container project, and launches the dev container instead
  • Supportsmultiple dev containers in the same project
  • Tracks your projects and allows you to open them using a CLI-based UI

Installation

Packaging status

Homebrew

Installvscli using cargo on Windows or Linux:

cargo install vscli

Installvscli using homebrew on Linux or Mac:

brew install michidk/tools/vscli

Installvscli using Chocolatey on Windows:

choco install vscli

Installvscli using winget on Windows:

winget install vscli

Additional steps

You can set a shorthand alias forvscli in your shell's configuration file:

alias vs="vscli open"alias vsr="vscli recent"

Usage

Commands

After installation, thevscli command will be available:

Usage: vscli [OPTIONS] <COMMAND>Commands:  open    Opens a dev container  recent  Opens an interactive list of recently used workspaces  help    Print this message or the help of the given subcommand(s)Options:  -s, --history-path <HISTORY_PATH>  Overwrite the default path to the history file [env: HISTORY_PATH=]  -d, --dry-run                      Whether to launch in dry-run mode (not actually open vscode) [env: DRY_RUN=]  -v, --verbose...                   Increase logging verbosity  -q, --quiet...                     Decrease logging verbosity  -h, --help                         Print help  -V, --version                      Print version

Open Dev Containers

Opens a dev container.

Usage: vscli open [OPTIONS] [PATH] [ARGS]...Arguments:  [PATH]     The path of the vscode project to open [default: .]  [ARGS]...  Additional arguments to pass to the editor [env: ARGS=]Options:  -c, --command <COMMAND>            The editor command to use (e.g. "code", "code-insiders", "cursor") [env: COMMAND=]  -s, --history-path <HISTORY_PATH>  Overwrite the default path to the history file [env: HISTORY_PATH=]  -b, --behavior <BEHAVIOR>          Launch behavior [possible values: detect, force-container, force-classic]  -d, --dry-run                      Whether to launch in dry-run mode (not actually open vscode) [env: DRY_RUN=]      --config <CONFIG>              Overwrites the path to the dev container config file [env: CONFIG=]  -v, --verbose...                   Increase logging verbosity  -q, --quiet...                     Decrease logging verbosity  -h, --help                         Print help (see more with '--help')

Recent UI

Opens an interactive list of recently used workspaces.

Usage: vscli recent [OPTIONS] [ARGS]...Arguments:  [ARGS]...  Additional arguments to pass to the editor [env: ARGS=]Options:      --hide-instructions            Hide the instruction message in the UI  -s, --history-path <HISTORY_PATH>  Overwrite the default path to the history file [env: HISTORY_PATH=]  -d, --dry-run                      Whether to launch in dry-run mode (not actually open vscode) [env: DRY_RUN=]      --hide-info                    Hide additional information like strategy, command, args and dev container path in the UI  -c, --command <COMMAND>            The editor command to use (e.g. "code", "code-insiders", "cursor") [env: COMMAND=]  -v, --verbose...                   Increase logging verbosity  -b, --behavior <BEHAVIOR>          Launch behavior [possible values: detect, force-container, force-classic]  -q, --quiet...                     Decrease logging verbosity      --config <CONFIG>              Overwrites the path to the dev container config file [env: CONFIG=]  -h, --help                         Print help (see more with '--help')

Both theopen andrecent commands share the same set of launch arguments:

  • --command: Specify which editor command to use (e.g., "code", "code-insiders", "cursor")
  • --behavior: Set the launch behavior ("detect", "force-container", "force-classic")
  • --config: Override the path to the dev container config file
  • Additional arguments can be passed to the editor executable by specifying them after--

Therecent command additionally supports:

  • --hide-instructions: Hide the keybinding instructions from the UI
  • --hide-info: Hide additional information like strategy, command, args and dev container path
Keybindings
Key/Key CombinationActionDescription
Esc,Ctrl+Q orCtrl+CQuitExits the application.
Down orCtrl+JSelect NextMoves to the next selectable item.
Up orCtrl+KSelect PreviousMoves to the previous selectable item.
KeypadBegin orCtrl+1Select FirstSelects the first item.
End orCtrl+0Select LastSelects the last item.
Enter orCtrl+OOpen SelectedOpens the currently selected item.
Delete,Ctrl+R, orCtrl+XDelete Selected EntryDeletes the currently selected item.

Note: If an input does not match any of the defined keybindings, it is treated as part of a search input.

Mouse Interactions
Mouse ActionDescription
Left ClickSelects an item. Clicking the same item again opens it.
Mouse WheelScrolls through the list, moving selection up/down.
Launch Behavior

There are three launch behaviors:

  • force-classic: Launch vscode without a dev container
  • force-container: Launch vscode with a dev container, error if no dev container is found
  • detect: Detect whether the project is a dev container project, and launch the dev container if it is
Detection Algorithm

The detection algorithm determines which dev container config to launch.

  • First, check whether a dev container config was specified via the--config flag -> launch it
  • Then loads the first dev container it finds
    • If more than one exists -> show a interactive list of dev containers and let the user select one
    • If one exists -> launch it
    • If none exists -> launch vscode normally without a dev container

Examples

Launching a project

You can launch a project using the default behavior:

vscli open# open vscode in the current directoryvscli open.# open vscode in the current directoryvscli open /path/to/project# open vscode in the specified directory

The default behavior tries to detect whether the project is adev container project. If it is, it will launch the dev container instead - if not it will launch vscode normally.

You can change the launch behavior using the--behavior flag:

vscli open --behavior force-container.# force open vscode dev container (even if vscli did not detect a dev container)vscli open --behavior force-classic.# force open vscode without a dev container (even if vscli did detect a dev container)

When you open a project containing more than one dev container config, you will be prompted to select one:Screenshot showing the dev container selection UI.

You can specify which editor command to use with the--command flag:

vscli open --command cursor.# open using cursor editorvscli open --command code.# open using vscode (default)vscli open --command code-insiders.# open using vscode insiders

Additional arguments can be passed to the editor executable, by specifying them after--:

vscli open. -- --disable-gpu# open the current directory without GPU hardware acceleration

Read more about the editor flags by executingcode --help (orcursor --help, etc).

CLI UI

You can open a CLI-based user interface to display a list of recently opened projects using therecent command:

vscli recent# open the CLI-based UI to select a recently opened project to openvscli recent --command cursor# open the selected project with cursor, ignoring the editor stored in historyvscli recent --behavior force-container# force open the selected project in a dev containervscli recent --command cursor --behavior detect# open with cursor and detect if dev container should be usedvscli recent --config .devcontainer/custom.json# open with a specific dev container configvscli recent -- --disable-gpu# pass additional arguments to the editorvscli recent --hide-instructions# hide the keybinding instructions from the UIvscli recent --hide-info# hide additional information like strategy, command, args and dev container path

The UI mode provides a convenient way to browse and manage your recent workspaces, with customizable display options and full support for all launch configurations.

About

A CLI/TUI that simplifies launching VSCode projects, with a focus on dev containers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp