# Junie CLI 快速上手：安装、登录和更新通道

> Junie CLI 在各系统的安装命令、三种登录方式、几个典型任务的写法，以及临时试用 EAP 或 nightly 版本的办法。

- 网址：https://funcoding.ai/agents/junie/getting-started/quickstart/
- 核实日期：2026-09-30（命令、配置和价格以官方文档为准）
- 官方来源：[Junie 源码仓库：README](https://github.com/jetbrains/junie)、[Junie 文档](https://junie.jetbrains.com/docs)

---
## 安装

macOS / Linux：

```bash
curl -fsSL https://junie.jetbrains.com/install.sh | bash
```

Windows：

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install.ps1')"
```

其他方式：

```bash
# macOS（Homebrew）
brew tap jetbrains-junie/junie
brew install junie

# npm
npm install -g @jetbrains/junie
```

## 登录

第一次运行 `junie` 时选择登录方式，三选一：

- **JetBrains 账号**：OAuth 登录
- **Junie API Key**：在 [Junie Tokens](https://junie.jetbrains.com/cli) 页面获取
- **自带 Key（BYOK）**：使用自己的模型服务商，支持 Anthropic、OpenAI、Google、xAI、OpenRouter 或 Copilot

## 开始使用

在项目目录里运行：

```bash
junie
```

然后用自然语言描述任务，例如：

```text
> Review the current changes in this branch and highlight potential bugs, performance issues, and missing tests
```

```text
> Fix the failing tests in the auth module and add a regression test
```

## 常用命令

| 命令 | 作用 |
| --- | --- |
| `/model` | 选择模型 |
| `/install-github-action` | 配置 GitHub Action，让 Junie 自动响应 Issue、PR 和 CI 失败 |
| `/feedback` | 反馈问题 |

## 临时试用其他更新通道

已经装好 Junie 之后，可以只在**这一次启动**里使用其他通道的最新版本，不改变默认安装：

```bash
junie --eap            # 最新的 EAP 版本
junie --nightly        # 最新的 nightly
junie --release        # 最新的稳定版
junie --channel=eap    # 等价的显式写法
```

用 `--use-version` 固定某个具体版本：

```bash
junie --eap --use-version=122.1
```

之后直接运行 `junie`，启动的仍然是默认通道。

想接入其他模型服务，见 [官方文档](https://junie.jetbrains.com/docs)。
