# 명령줄 및 자동화

VDM can be driven without its window in three ways:

- **앱의 명령줄**은 IDM과 같은 스위치를 사용합니다. 스크립트, 배치 파일 또는 다른 프로그램에서 실행 중인 앱에 다운로드를 전달할 수 있습니다.
- **`voltdownloadmanager-cli`**는 별도의 명령줄 도구입니다. 앱을 실행하지 않고 터미널에서 진행 상황을 확인하며 파일, 동영상, 토렌트를 다운로드할 수 있습니다.
- **The automation API**: other programs list the running app's downloads (as JSON) and pause, start, remove or delete them, over a local, token-protected channel. AI assistants use it through VDM's MCP server: see [AI assistants](https://vdm.mikaillab.com/ko/help/ai-assistants.html).

To run the whole app without a window, on a home server or a NAS, see [Run VDM on a server](https://vdm.mikaillab.com/ko/help/server.html) (`voltdownloadmanager --headless`); to control it from a phone, [Control VDM from your phone](https://vdm.mikaillab.com/ko/help/remote-control.html).

예시에서는 Windows 경로를 사용합니다. macOS 및 Linux에서는 프로그램 이름이 `.exe` 없이 동일합니다.

## 앱의 명령줄

```
voltdownloadmanager.exe /d URL [/p folder] [/f name] [/a] [/n] [/s]
```

| 스위치 | 기능 |
|---|---|
| `/d URL` | 다운로드할 주소입니다. |
| `/p folder` | 이 폴더에 저장합니다 (그렇지 않으면 **옵션 → 저장 위치**에서 카테고리 폴더에 저장됩니다). |
| `/f name` | 이 이름으로 저장합니다. |
| `/a` | 시작하지 않고 메인 다운로드 대기열에 추가합니다. |
| `/n` | 자동: **파일 정보 다운로드** 창이 나타나지 않으며, 다운로드가 즉시 시작됩니다 (또는 `/a`와 함께 대기열에 추가됩니다). |
| `/s` | 메인 다운로드 대기열을 시작합니다. |
| `/exit` | 실행 중인 앱을 저장하고 닫습니다 (설치 프로그램이 업그레이드 전에 사용합니다). |
| `/startup` | Start in the notification area, the window hidden: what **Launch Volt Download Manager on startup** starts VDM with when you sign in. Where no notification area shows VDM's icon (some Linux desktops), VDM starts minimized. A running VDM stays as it is. |
| *a `.torrent` 파일 또는 `magnet:` 링크* | Open it in **Add torrent** (what Windows passes when VDM opens torrents). |

Switches can start with `/` or `-`, in any case. If VDM is running, the command goes to it; if not, VDM starts and carries it out. For example:

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

## voltdownloadmanager-cli

It comes with every download of VDM, next to the app (the installer puts it in VDM's folder). It works on its own: the app needn't run, except for `status` and `api`.

Its downloads leave the way the app's do: through **Options → Proxy / Socks** (no proxy, **Use system settings** with its `HTTPS_PROXY` / `HTTP_PROXY` / `ALL_PROXY` variables and the system's automatic configuration script, an automatic configuration script, fetched before the command starts, or a manual proxy with its login) and its **Network adapter**, with the DNS of **Options → Connection**. That covers `get`, `resume`, the video, playlist and gallery commands (yt-dlp and gallery-dl too), the `install-*` commands, and torrents when Torrent settings' **Use the proxy** is on. For one run, `--proxy` takes the place of Options' proxy: `none` (direct, yt-dlp and gallery-dl too, whatever the system's proxy), `system`, or a proxy's address, `http://127.0.0.1:7890`, `https://…`, `socks5://…`, `socks5h://…` (the proxy looks the sites' names up), `socks4://…`, `socks4a://…`. A password is never taken on the command line, where other programs can read it: write the user name in the address (`socks5://ann@127.0.0.1:1080`) and put the password in the `VDM_PROXY_PASSWORD` environment variable. `get` and `resume` also have `--dns` and `--adapter`, and `video-get` and `gallery-get` `--adapter` (`any` for none), for the same.

| 명령 | 기능 |
|---|---|
| `get URL [-o folder\\|file] [-c connections] [-H "Header: value"]... [-r referer] [--user-agent agent] [--cookie cookie] [--checksum hash] [--dns choice] [--adapter name] [--proxy proxy]` | Download a file with up to 8 connections (`-c`, 1 to 128), showing progress. `Ctrl+C` pauses it; `resume` continues. `-r` sets the referring page address (Referer header), `--user-agent` sets the request's User-Agent (then the only one sent; without it, VDM speaks as your default browser, and, when a site's bot check refuses that and the way a browser connects too, once more under its own name), `--cookie` sets the Cookie header (a cookie on the command line ends up in the shell's history; `-` reads it from standard input instead). `--checksum` checks the finished file: hex MD5, SHA-1, SHA-256, SHA-512 or CRC32, optionally named (`sha256:…`); a file that doesn't match fails. Without it, a checksum the server sends is checked, and a file that doesn't match it is kept with a `warning:` line (see [Verify checksum](https://vdm.mikaillab.com/ko/help/download-list.html#verify-checksum)). `--dns` picks the DNS instead of Options': `system`; a service and how to ask it, `cloudflare-https`, `quad9-tls`, `google-plain`, `adguard-https`, `nextdns-tls`; DNS servers' addresses, `9.9.9.9,149.112.112.112`; or a DNS-over-HTTPS address. It never falls back to the system's DNS. `--adapter` sends every connection through one network adapter instead of Options' (`any` for none), by its name (`Ethernet`, `wg0`) or one of its addresses; when it isn't connected, nothing is sent and the download fails. `--proxy` takes the place of Options' proxy for this run (see above). The app's [site rules](https://vdm.mikaillab.com/ko/help/connections-and-speed.html#site-rules) for the address apply too (their headers, User-Agent, browser-like connection, number of connections and proxy), where the command line gives none of the same: `--proxy` goes before every rule's proxy. A link from a file host that one of your debrid accounts (**Options → Accounts**) supports goes through that account, as in the app, and `get` says `through Real-Debrid`; `--direct` downloads the address itself ([Debrid service accounts](https://vdm.mikaillab.com/ko/help/debrid.html)). |
| `resume file.vdm.json [-c connections] [-H ...] [-r referer] [--user-agent agent] [--cookie cookie] [--checksum hash] [--dns choice] [--adapter name] [--proxy proxy] [--direct]` | 일시 중지되거나 중단된 다운로드를 옆의 `.vdm.json` 파일에서 계속합니다. `-r`, `--user-agent` 및 `--cookie`는 추가 헤더를 설정합니다(`-`는 표준 입력에서 쿠키를 읽습니다). `--checksum`는 해당 실행을 위해 완료된 파일을 확인합니다. `--dns`, `--adapter` 및 `--proxy`는 `get`와 같이 연결의 DNS, 네트워크 어댑터 및 프록시를 설정하며, 앱의 사이트 규칙은 `get`와 같이 적용됩니다. `get`와 같이 디브리드 계정을 통해: 서비스는 이전 링크가 만료되면 새 링크를 제공합니다. `--direct`는 주소 자체에서 계속합니다. |
| `install-gallery-dl` | 이미지 갤러리용 gallery-dl을 설치하거나 업데이트합니다. 체크섬 목록은 작성자의 서명 키로 확인하고, 프로그램은 해당 목록으로 확인합니다(Windows 및 Linux x86-64에서 지원되며, 그 외 환경에서는 직접 설치해야 합니다). |
| `gallery-get URL [-o folder] [--limit N] [--adapter name]` | Download a gallery's pictures (a Wikimedia Commons category, a Flickr album, ...) into a folder named after it inside `-o`; `--limit` takes at most that many, the first the site lists. Started again, it fetches only the new ones. VDM's own downloader brings the pictures gallery-dl lists, 4 at a time. `--adapter` sends the connections, VDM's and gallery-dl's, through one network adapter, as for `get`. |
| `video-info URL` | 페이지에 있는 동영상(YouTube, Vimeo 등)과 선택할 수 있는 화질을 표시합니다. |
| `playlist-info URL [--from N] [--count N]` | 재생목록이나 채널의 동영상 정보를 사이트에 표시된 순서대로 한 줄씩 표시합니다. 항목 위치, 길이, 제목, 주소가 포함됩니다. |
| `playlist-get URL [-f selector] [-o folder] [-c pieces] [--split-chapters] [--from N] [--count N]` | 재생 목록 또는 채널의 비디오를 `-o` 내의 목록 이름으로 된 폴더에 차례로 다운로드합니다. `-f`는 `video-get`와 같이 모든 비디오에 대한 단일 품질입니다(기본적으로 각 비디오의 최고 품질; `bv*[height<=720]+ba/b[height<=720]` = 최대 720p; `bv[vcodec^=avc]+ba[acodec^=mp4a]/b[vcodec^=avc][acodec^=mp4a]` = 최대 호환, AAC가 포함된 H.264; `ba` = 원본 사운드; `mp3:320`, `opus:`, `flac:`는 `video-get`와 같습니다). `-c` 및 `--split-chapters`는 `video-get`와 같습니다. |
| `video-get URL [-f selector \\| -q height\\|compatible] [-o folder] [-c pieces] [--subs langs] [--auto-subs] [--embed-subs] [--split-chapters] [--adapter name]` | Download a video. Without `-f` or `-q`, the best quality, the one the Download video window starts on: with ffmpeg the best picture with the best sound joined to it (a site whose pictures and sounds come apart, such as Bilibili, needs ffmpeg for a video), else the best file with both. `-q 1080` (or `720p`) takes that height, or the nearest below it the page offers (else the nearest above), and says so. `-q compatible` takes the most compatible quality, as the window's **Most compatible (H.264 + AAC)**: the best H.264 picture with AAC sound, in an MP4 that plays in every editor, TV and phone; a page without one says so (nothing is converted). `-f` takes a quality's selector from `video-info` (`b` = the best single file; `ba` = the sound alone as the site has it, not converted; `mp3:320`, `mp3:256`, `mp3:192` or `mp3:128` = the sound as an MP3 at that bitrate, `mp3:0` at its best variable one; `opus:` = as Opus; `flac:` = as FLAC, lossless but no better than the site's sound; conversions need ffmpeg). `-c`: VDM's own downloader brings each stream yt-dlp finds over this many connections (8 by default, 1 to 128), a stream in pieces (HLS, DASH) this many pieces at once. `--subs` saves subtitles beside it: language codes from `video-info` (`en,fr`), or `all` for every one the uploader gave; `--auto-subs` takes the site's automatic captions instead; `--embed-subs` puts them into the video (needs ffmpeg, MP4 or MKV). With ffmpeg, the video's chapters go into the file too, as Download video's **Embed chapters** does. `--split-chapters` splits the video into numbered chapter files without re-encoding, beside the main video. `--adapter` sends the downloads' connections, and yt-dlp's (and ffmpeg's), through one network adapter, as for `get`; when it isn't connected, nothing starts. When no format of the page matches, the error lists the ones it offers, as `video-info` does. |
| `update-helpers` | Check VDM's own helpers (yt-dlp, ffmpeg, gallery-dl, Node.js) for newer versions now, install them (each checked as its first install was), and print their versions. A helper a download is using switches to its new version once that download ends. Programs you chose in Helpers, and your system's, are yours to update. |
| `install-ytdlp`, `install-ffmpeg`,`install-js-runtime` | Install or update the helpers videos need: yt-dlp (checked against its signing key), ffmpeg (x64 and ARM64 Windows, a build in VDM's signed list of checked builds; on macOS and Linux VDM uses the system's, and on 32-bit Windows one you choose in Helpers) and VDM's own JavaScript runtime, which yt-dlp needs for YouTube's qualities: Node.js's newest LTS build (its checksum list checked against Node.js's releasers' keys; Windows, Linux and macOS). A runtime already on your computer, or one chosen in Helpers, is still used first, and the command says so. `install-deno`, its earlier name, does the same. |
| `torrent-info SOURCE` | 토렌트의 이름, 파일(번호 매겨짐) 및 크기입니다. `SOURCE`은 마그넷 링크 또는 `.torrent` 파일입니다. |
| `torrent-get SOURCE [-o folder] [--files 0,2] [--use-existing]` | 토렌트를 다운로드하거나 일부 파일만 다운로드합니다. 일부 파일이 이미 폴더에 있으면 중지하고 이름을 지정합니다. `--use-existing`는 대신 해당 파일을 사용합니다(일치하는 파일은 유지되고 나머지는 다운로드됩니다). 토렌트 설정의 **이 공개 목록의 트래커를 공개 토렌트에 추가**가 켜져 있으면, 앱에서와 같이 공개 토렌트도 목록의 트래커를 가져옵니다. |
| `torrent-create PATH -o file.torrent` | 파일 또는 폴더의 `.torrent`를 만듭니다. 폴더의 파일은 이름으로 나열됩니다(피어는 DHT를 통해 찾음). |
| `status [--id N] [-s status] [--search text] [-c category] [-q queue] [-l limit]`(또는 `list`) | 실행 중인 앱의 다운로드 목록을 ID와 함께 JSON 형식으로 표시합니다(자동화 API가 켜져 있어야 함). 선택적 플래그는 ID, 상태, 검색 문자열, 카테고리 또는 대기열로 필터링하거나 개수를 제한합니다. |
| `pause ID...`, `start ID...` | 실행 중인 앱에서 진행 중인 다운로드를 일시 중지하거나, 중지·대기 중이거나 실패한 다운로드를 시작(재개)합니다. |
| `remove ID...`, `delete ID...` | 실행 중인 앱의 목록에서 다운로드를 제거합니다. `remove`는 파일을 유지하고, `delete`는 파일도 삭제합니다. 진행 중인 다운로드는 먼저 일시 중지됩니다(`pause`). |
| `add URL [-o folder] [-f name] [-c category] [-q queue] [--checksum hash] [-r referer] [--user-agent agent] [--cookie cookie] [--private] [-l] [-s]` | 실행 중인 앱에 다운로드를 전달합니다. `-o`는 폴더를 설정하고, `-f`는 파일 이름을, `-c`는 카테고리를, `-q`는 대기열을, `--checksum`는 필요한 해시를, `-r`는 참조 페이지 주소(Referer 헤더)를, `--user-agent`는 요청의 User-Agent를, `--cookie`는 Cookie 헤더를 설정합니다(명령줄의 쿠키는 셸 기록에 남으므로, `-`는 대신 표준 입력에서 읽습니다). `--private`는 개인 정보 보호 창의 다운로드로 표시합니다(일반 창의 다운로드와 분리되며, **옵션 → 일반 → 개인 정보 보호 창에서 다운로드한 파일 목록에 유지**가 켜져 있는 동안에만 목록에 저장됩니다. 기본적으로 켜져 있습니다). `-l`는 시작하지 않고 대기열에 추가하고, `-s`는 파일 정보 다운로드 대화 상자를 건너뜁니다. 성공 시 `{"id": N}`를 출력합니다. |
| `start-queue [name] [-q name]`, `stop-queue [name] [-q name]` | 실행 중인 앱에서 다운로드 대기열을 시작하거나 중지합니다(자동화 API). 생략하면 기본 대기열을 시작하거나 중지합니다. |
| `pair` | 실행 중인 앱의 원격 제어와 휴대폰 또는 원격 브라우저를 페어링할 새 코드를 표시합니다: 웹 주소, 페어링 코드 및 QR 코드. |
| `api on`, `api off` | 실행 중인 앱의 자동화 API를 켜거나 끕니다. |

`voltdownloadmanager-cli help <command>`모든 옵션을 표시합니다. 명령이 실패하면(앱이 실행 중이지 않거나, 오류 응답을 받거나, 다운로드가 중단되는 경우) 종료 코드 1을 반환합니다. 예를 들어:

```
voltdownloadmanager-cli get https://example.com/big.iso -o D:\Downloads -c 16 --checksum sha256:9f86d0…
voltdownloadmanager-cli video-get "https://www.youtube.com/watch?v=aqz-KE-bpKQ" -q 720
voltdownloadmanager-cli torrent-get "magnet:?xt=urn:btih:…" --files 0
```

### 스크립트와 프로그램용 JSON

명령 앞이나 뒤에 `--json`를 지정하면 모든 명령이 텍스트 대신 JSON을 출력합니다. 스크립트와 AI 에이전트가 읽을 수 있도록 한 줄에 객체 하나씩 출력합니다.

| 명령 | 출력 내용 |
|---|---|
| `get`, `resume` | `{"event": "through", "service"}`다운로드가 디브리드 계정을 통해 진행될 때 먼저, 그 다음 `{"event": "progress", "downloaded", "size", "speed", "connections", "segments"}` 줄이 0.5초마다, 그 다음 `{"event": "done", "path", "size", "seconds"}`(파일이 서버가 보낸 체크섬과 일치하지 않아 유지된 경우 `"warning"` 포함), 또는 `Ctrl+C` 다음에 `{"event": "paused", "state"}`(`state`는 `resume`가 가져오는 파일입니다). |
| `video-get` | `-f`이 없으면 `{"event": "quality", "label", "format", "height", "asked", "nearest"}`가 먼저 나옵니다: 가져온 품질, `asked`는 `-q`의 높이(`"compatible"`는 `-q compatible`, 그렇지 않으면 `null`) 및 `nearest`는 해당 높이가 제공되지 않았는지 여부. 그런 다음 `{"event": "progress", "downloaded", "size", "speed"}` 줄, `{"event": "note", "text"}`는 다운로드 로그에 표시된 내용(서버가 제공하지 않는 품질, 가장 가까운 아래 품질로 가져옴), 그런 다음 `{"event": "done", "path", "subtitles", "subtitle_problems"}`: 그 옆에 저장된 자막 파일 및 사이트에서 거부한 언어(`{"code", "name", "reason", "beside"}`; `beside`: 두 번째 시도에서 비디오 안에 대신 비디오 옆에 나타남). |
| `torrent-get` | `{"event": "progress", "phase", "downloaded", "size", "speed", "peers", "peers_seen"}`줄을 출력한 다음 `{"event": "done", "path", "size"}` 또는 `--seconds`가 포함된 `{"event": "stopped", "downloaded", "seconds"}`를 출력합니다. |
| `video-info` | `{"title", "choices": [{"label", "format", "size", "approx", "height", "fps", "codec", "range"}], "subtitles": [{"code", "name", "automatic"}], "declared"}`; `declared`은 페이지가 언급하는 비디오의 주소입니다. HTML에서 첫 번째 플레이어 대신 해당 비디오를 조회했을 때(yt-dlp에 자체 리더가 없는 사이트에서), 그렇지 않으면 `null`입니다. 선택의 `format`는 `video-get -f`가 가져오는 것입니다(크기가 조정된 바로 그 형식, `401+251`와 같이, 그런 다음 해당 코덱과 높이가 사라진 경우 가장 가까운 것, 그런 다음 모든 코덱). `approx`는 `size`가 예상치라고 말하고, `codec`은 `AV1`, `VP9`, `H.264`…, `range`은 `HDR` (또는 HDR 선택 옆의 `SDR`)입니다. 자막의 `code`는 `--subs`가 가져오는 것입니다. |
| `torrent-info` | `{"name", "info_hash", "size", "files": [{"index", "size", "path"}]}`. |
| `torrent-create` | `{"info_hash", "path"}`. |
| `install-ytdlp`, `install-ffmpeg`,`install-js-runtime` | `{"tool", "version", "path"}`; `install-js-runtime`은 `used`, yt-dlp가 사용하는 런타임(`{"runtime", "version", "path"}`)을 추가합니다. |
| `update-helpers` | 도우미당 `{"tool", "status", "version"}` 하나; `status`는 `up-to-date`, `updated`, `ready`(다운로드가 끝나면 사용됨), `skipped`(최신 버전에서 되돌아감), `not-ours`, `busy` 또는 `failed`(`error`와 함께)입니다. |
| `status`, `pause`, `start`, `remove`, `delete`, `start-queue`, `stop-queue`, `add`, `pair`,`api` | 이미 JSON 형식인 앱의 응답입니다(아래 참조). |

크기는 바이트 단위(`null`는 알 수 없을 때), 속도는 초당 바이트 단위입니다. 실패하면 `{"error": "…"}`를 출력하고 코드 1로 종료합니다. `video-get`가 다운로드할 페이지 형식을 찾지 못하면 `"choices"`(`video-info`와 같음) 및 `"formats"`(yt-dlp 자체: `{"id", "ext", "height", "video", "audio"}`)와 함께 오류가 발생합니다. 예를 들어:

```
voltdownloadmanager-cli --json get https://example.com/big.iso -o D:\Downloads
{"event":"progress","downloaded":4194304,"size":1073741824,"speed":52428800,"connections":8,"segments":8}
…
{"event":"done","path":"D:\\Downloads\\big.iso","size":1073741824,"seconds":20.4}
```

## 자동화 API

다른 프로그램은 실행 중인 앱에 다운로드 중인 항목을 물어보고 다운로드를 일시 중지, 시작, 제거 또는 삭제할 수 있습니다. API는 **기본적으로 꺼져 있습니다**. `voltdownloadmanager-cli api on`로 켜고 `api off`로 끕니다.

### How a program talks to VDM

1. While it runs, VDM listens on a port of `127.0.0.1` (this computer only) and writes the port and a secret token to `ipc.json` in its data folder: - Windows: `%APPDATA%\voltdownloadmanager\ipc.json` - macOS: `~/Library/Application Support/voltdownloadmanager/ipc.json` - Linux: `~/.local/share/voltdownloadmanager/ipc.json` - A [portable copy](https://vdm.mikaillab.com/ko/help/portable.html): `data\ipc.json` next to the program.

The token changes at every start; only programs that can read your data folder (yours) can use it. 2. Connect to that port and send one line of JSON: the token and the command's fields, e.g. `{"token": "<token>", "query": "list"}`. 3. VDM answers with one line: `ok` for a command, or a JSON object for a question.

### 지원하는 요청

| 필드(`token` 제외) | 응답 |
|---|---|
| `{"query": "list"}` | 각 다운로드 및 총 속도: `{"downloads": [{"id", "file", "url", "path", "status", "size", "downloaded", "speed", "added", "category", "error"}], "speed": bytes per second, "queues": [{"name", "running", "ids"}], "categories": [{"key", "name"}], "free": bytes}`. `status`는 `Queued`, `Downloading`, `Stopped`, `Complete` 또는 `Error`입니다. `size`는 알 수 없을 때 `null`입니다. `error`(실패 이유)는 `Error`에 있는 다운로드에만 표시됩니다. `category`는 카테고리의 `key`입니다. `free`는 다운로드가 저장되는 여유 공간입니다(`null`는 알 수 없을 때). API가 켜져 있을 때만 가능합니다. |
| `{"action": "pause", "ids": [3, 4]}` | ID로 다운로드를 처리합니다: `"pause"`, `"start"`, `"remove"`(파일 유지) 또는 `"delete"`(파일도 삭제). `{"done": [3], "skipped": [{"id": 4, "why": "not running"}]}`로 응답합니다. 진행 중인 다운로드는 제거하거나 삭제하기 전에 일시 중지해야 합니다. API가 켜져 있을 때만 사용할 수 있습니다. |
| `{"action": "start_queue", "queue": "Main download queue"}` | 해당 이름의 대기열을 시작합니다(또는 `"stop_queue"`로 중지합니다)(목록의 `queues`에서 가져온 이름; 기본값: 기본 다운로드 대기열). `{"done": [], "skipped": []}` 또는 `{"error": …, "code": "unknown-queue"}`로 응답합니다. API가 켜져 있을 때만 작동합니다. |
| `{"api": true}` / `{"api": false}` | API를 켜거나 끕니다: `{"api": true}`. |
| `{"url": "https://…", "dir": "D:\\Files", "name": "a.zip", "silent": true}` | 명령줄의 `/d /p /f /n`처럼 다운로드를 추가합니다(`"later": true`는 `/a`입니다). `ok`. `"category"`(목록의 `categories`에 있는 키)는 해당 유형이 선택하는 폴더 대신 해당 카테고리의 폴더에 저장합니다. `"queue"`(대기열 이름)은 `"later"`와 함께 대기하는 대기열입니다. 명령줄처럼 API가 꺼져 있을 때도 가능합니다. |
| `{"start_queue": true}` | 주 다운로드 대기열을 시작합니다. `ok`. |

An unknown question or action is answered `{"error": "…"}`, as is a question while the API is off (then with `"code": "api-off"`, for programs to check: the error text may change). A wrong token is answered `denied`. When VDM is already handling as many requests as it takes at once, it answers `busy`: nothing was done, and the line can be sent again a moment later.

A command (answered `ok`) may carry an `"id"` of your own: letters, digits and `-`, at most 64, different for each command. If its answer doesn't come back (the line closed, or a wait ran out), send the same line again with the same `id`: VDM does it once, however many of those lines reach it, and answers `ok` to each. Without an `id`, each line is a new command. A second launch of the program (`voltdownloadmanager.exe /d …`, `/exit`) does this by itself.

모든 요청과 응답은 JSON 스키마인 [automation-api.schema.json](https://vdm.mikaillab.com/automation-api.schema.json)(`https://vdm.mikaillab.com/automation-api.schema.json`에서도 확인 가능)에 필드별로 설명되어 있습니다. 이는 앱이 응답하는 코드로부터 만들어지므로 정확하게 유지됩니다. 프로그램은 이를 기준으로 보내고 읽는 내용을 확인하거나, 이를 통해 유형을 생성할 수 있습니다.

### 예시

PowerShell (Windows):

```
$ep = Get-Content "$env:APPDATA\voltdownloadmanager\ipc.json" | ConvertFrom-Json
$client = New-Object Net.Sockets.TcpClient("127.0.0.1", $ep.port)
$stream = $client.GetStream()
$writer = New-Object IO.StreamWriter($stream); $reader = New-Object IO.StreamReader($stream)
$writer.WriteLine((@{ token = $ep.token; query = "list" } | ConvertTo-Json -Compress))
$writer.Flush()
$reader.ReadLine() | ConvertFrom-Json | Select-Object -ExpandProperty downloads | Format-Table file, status, downloaded, size
$client.Close()
```

Python:

```
import json, os, socket

ipc = os.path.join(os.environ["APPDATA"], "voltdownloadmanager", "ipc.json")  # see above elsewhere
ep = json.load(open(ipc))
with socket.create_connection(("127.0.0.1", ep["port"])) as s:
    s.sendall((json.dumps({"token": ep["token"], "query": "list"}) + "\n").encode())
    answer = json.loads(s.makefile().readline())
for d in answer["downloads"]:
    print(d["file"], d["status"], d["downloaded"], d["size"])
```

대신 다운로드를 추가하려면 `{"token": "…", "url": "https://example.com/a.zip", "silent": true}`를 보내세요.

## 관련 항목

- [옵션](https://vdm.mikaillab.com/ko/help/options.html)
- [테마](https://vdm.mikaillab.com/ko/help/themes.html)
- [언어](https://vdm.mikaillab.com/ko/help/languages.html)
- [휴대용 모드](https://vdm.mikaillab.com/ko/help/portable.html)
- [바로 가기 키](https://vdm.mikaillab.com/ko/help/keyboard-shortcuts.html)

[GitHub에서 이 페이지 편집](https://github.com/mikailhossenimran/voltdownloadmanager/edit/main/docs/command-line.md) [이 페이지의 문제 보고](https://github.com/mikailhossenimran/voltdownloadmanager/issues/new?template=website.yml&title=Website%3A%20Command%20line%20and%20automation&page=https%3A//vdm.mikaillab.com/help/command-line.html) [페이지 기록](https://github.com/mikailhossenimran/voltdownloadmanager/commits/main/docs/command-line.md)

무료, 오픈 소스, 광고 없음, 평가판 없음.

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