![如何通过命令行向 Visual Studio Code 添加扩展?](https://linux22.com/image/1158979/%E5%A6%82%E4%BD%95%E9%80%9A%E8%BF%87%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%90%91%20Visual%20Studio%20Code%20%E6%B7%BB%E5%8A%A0%E6%89%A9%E5%B1%95%EF%BC%9F.png)
答案1
您可以使用以下命令获取命令行帮助
code -h
(A男人页面不存在。)
Extensions Management:
--extensions-dir <dir> Set the root path for extensions.
--list-extensions List the installed extensions.
--show-versions Show versions of installed extensions, when
using --list-extension.
--install-extension (<extension-id> | <extension-vsix-path>) Installs an extension.
--uninstall-extension (<extension-id> | <extension-vsix-path>) Uninstalls an extension.
--enable-proposed-api <extension-id> Enables proposed API features for an extension.
因此,您所需要的只是 extension-id 或 extension-vsix-path,然后
code --install-extension (<extension-id> | <extension-vsix-path>)
例如微软 Python可以通过以下方式安装软件包
code --install-extension ms-python.python