> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 완성

> Tab 키를 누르면 셸이 XBOX CLI 명령, 옵션, 값을 완성하게 하는 스크립트를 출력합니다.

Tab 키를 누르면 `xbox` 명령, 옵션, 고정 목록의 값이 완성되도록 셸 완성 스크립트를 출력합니다.

```bash theme={null}
xbox completion <shell>
```

`<shell>`은 `bash`, `zsh`, `fish` 또는 `powershell`입니다. 이 명령은 스크립트를 stdout에 쓰고 `0`으로
종료합니다. 네트워크 요청을 하지 않으며 로그인할 필요가 없습니다. `--output table`은 허용하지 않습니다.

## 완성되는 항목

* `play`를 `playfab` 또는 `playtest`로 완성하는 것처럼 모든 깊이의 명령과 하위 명령.
* 전역 옵션을 포함하여 명령이 받는 옵션.
* `--output` 형식, `--supported-device` 값, `xbl config` 명령의 `--scope` 값,
  `xbl config download`의 `--view` 값, `context set`과 `context unset`이 받는 키 같은 고정 목록의 값.

완성 기능은 플레이테스트, 샌드박스, 빌드 같은 리소스나 저장한 프로필을 조회하지 않으므로, 이러한 값은
직접 입력해야 합니다.

## 완성 사용 설정

셸의 시작 파일에 해당 셸의 줄을 추가한 다음 새 터미널을 여세요. 현재 터미널에서 먼저 사용해 보려면
같은 줄을 그 터미널에서 실행하세요.

Bash의 경우 `~/.bashrc`에 추가합니다.

```bash theme={null}
eval "$(xbox completion bash)"
```

Zsh의 경우 `~/.zshrc`에서 `compinit`가 실행된 후에 추가합니다.

```zsh theme={null}
source <(xbox completion zsh)
```

fish의 경우 `~/.config/fish/config.fish`에 추가합니다.

```fish theme={null}
xbox completion fish | source
```

PowerShell의 경우 `$PROFILE`이 가리키는 파일에 추가합니다.

```powershell theme={null}
xbox completion powershell | Out-String | Invoke-Expression
```

스크립트는 `xbox`라는 이름의 명령을 완성하므로, CLI가 그 이름으로 `PATH`에 있어야 합니다.

## 작동 방식

각 스크립트는 Tab 키를 누를 때마다 지금까지 입력한 명령줄로 `xbox`를 실행하여 CLI에 후보를 요청합니다.
CLI는 자체 명령 트리에서 응답합니다. 구성이나 저장된 컨텍스트를 읽지 않고, 로그인하지 않으며, 원격
분석을 보내거나 아무것도 쓰지 않습니다.


## Related topics

- [Playtest 사용하기](https://docs.xbox.com/ko/publishing/game-publishing/concepts/playtest-preview.md)
- [설치](https://docs.xbox.com/ko/tools/xbox-cli/installation.md)
- [리더보드](https://docs.xbox.com/ko/build/steam-porting-guide/features/steam-leaderboards.md)
- [SHAPE 개요](https://docs.xbox.com/ko/build/console-features/audio/overviews/shape-overview.md)
- [Using resettable statistics and leaderboards](https://docs.xbox.com/ko/services/playfab/community/leaderboards/tournaments-leaderboards/using-resettable-statistics-and-leaderboards.md)
