# 欢迎使用脚本。支持 IDM 命令行参数。

VDM takes IDM's command-line switches, so scripts written for IDM can hand it their downloads. A separate tool downloads in a terminal, and a local API lets other programs see and control the running app.

**Command line** Volt Download Manager

- 在应用中: `voltdownloadmanager-cli`, in VDM's folder
- 自: [版本 0.1.0](https://vdm.mikaillab.com/zh-hans/news.html#v0.1.0) 及更高版本
- 邮费: 免费
- 完整指南: [帮助中的分步说明](https://vdm.mikaillab.com/zh-hans/help/command-line.html)

## IDM 命令行参数，保持不变

The app understands the same switches as IDM: `/d` for the address, `/p` for the folder, `/f` for the file name, `/a` to queue it without starting, `/n` to skip the **Download File Info** window, and `/s` to start the main download queue. A batch file or another program that drives IDM this way can drive VDM by changing the program's name.

```
voltdownloadmanager.exe /d https://example.com/files/report.pdf /p D:\Reports /n
```

If VDM is running, the command goes to it; if not, VDM starts and carries it out. On macOS and Linux the program has the same name, without `.exe`.

## 终端下载器

`voltdownloadmanager-cli` comes with every download of VDM and works without the app running. `get` downloads a file over several connections with a progress line, **Ctrl+C** pauses it and `resume` carries on later. `video-get` downloads a video, and `torrent-get` a torrent or only some of its files. `video-info` and `torrent-info` say what there is to choose before you download. `voltdownloadmanager-cli help <command>` lists every option, and a command that fails exits with code 1.

## 用于脚本和程序的 JSON

使用 `--json`，每个命令都会打印 JSON，每行一个对象：文件下载时每半秒打印一行进度，然后是完成时的路径、大小和时间。大小以字节为单位，速度以字节每秒为单位，失败时打印错误对象，因此脚本或 AI 代理无需解析文本即可读取结果。[格式](https://vdm.mikaillab.com/zh-hans/help/command-line.html#json-for-scripts-and-programs)按命令列出。

## 运行中应用程序的 API

其他程序可以向正在运行的应用程序请求其下载任务（以 JSON 格式），并暂停、开始、移除或删除它们。它们仅连接到此计算机上的一个端口，使用每次启动时都会更改的秘密令牌，并且只有您自己的程序才能读取。API 默认关闭，直到您使用 `voltdownloadmanager-cli api on` 开启它，并且 `status`、`pause`、`start`、`remove` 和 `delete` 从命令行使用它。

Every request and answer is described field by field in a [JSON Schema](https://vdm.mikaillab.com/automation-api.schema.json), made from the code the app answers with, so programs can check what they send or generate their types from it. AI assistants use the same API through VDM's [MCP server](https://vdm.mikaillab.com/zh-hans/features/ai-assistants.html).

## 更多脚本功能

`playlist-get`下载播放列表或频道中的视频，`gallery-get` 下载图片库。`get` 最多支持 128 个连接，`-c` 可选择将名称解析为地址的服务器，`--dns` 可选择通过某个网络适配器发送下载或完全不发送。`--adapter` 应用程序的 `/startup` 可使其在通知区域隐藏启动。API 列表还提供队列、类别和可用空间，并可按名称启动和停止队列。

## 应用中的更多内容

- [通知区域](https://vdm.mikaillab.com/zh-hans/features/tray.html)
- [主题](https://vdm.mikaillab.com/zh-hans/themes.html)
- [崩溃报告](https://vdm.mikaillab.com/zh-hans/features/crash-reports.html)
- [87 种语言](https://vdm.mikaillab.com/zh-hans/features/languages.html)
- [Windows、Mac 和 Linux](https://vdm.mikaillab.com/zh-hans/features/systems.html)
- [无障碍功能](https://vdm.mikaillab.com/zh-hans/features/accessibility.html)
- [AI 助手](https://vdm.mikaillab.com/zh-hans/features/ai-assistants.html)
- [所有功能](https://vdm.mikaillab.com/zh-hans/features/)

[在 GitHub 上编辑此页面](https://github.com/mikailhossenimran/voltdownloadmanager/edit/main/website/content/features/command-line.md) [报告此页面的问题](https://github.com/mikailhossenimran/voltdownloadmanager/issues/new?template=website.yml&title=Website%3A%20Command%20line&page=https%3A//vdm.mikaillab.com/features/command-line.html) [页面历史](https://github.com/mikailhossenimran/voltdownloadmanager/commits/main/website/content/features/command-line.md)

免费、开源、无广告、无试用版。

[Download Volt Download Manager](https://vdm.mikaillab.com/zh-hans/download.html)
