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

# Commands

> All MoxyCode commands available from the Command Palette and right-click menu.

All MoxyCode commands are available from the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`). Type `MoxyCode` to filter the full list.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/commands-palette.png" alt="MoxyCode commands in the VS Code Command Palette" />
</Frame>

## Commands

### MoxyCode: Deploy to Org

Deploys the active file to your Salesforce CLI default org. For LWC components, deploys the entire bundle. Also available by right-clicking inside the editor or in the Explorer panel.

**When to use:** Any time you want to deploy an Apex or LWC file without leaving VS Code.

***

### MoxyCode: Clean Up Offline Files

Launches a guided process to remove the Offline Mode setup from your machine — uninstalls the local AI model and cleans up all MoxyCode offline files.

**When to use:** When you want to remove Offline Mode and free up disk space, or before switching machines.

***

### MoxyCode: Re-analyse File

Re-runs code analysis on the active file and updates all warnings and CodeLens links instantly — without needing to save the file.

MoxyCode shows a notification when the command completes:

| Situation             | Notification                                                                           |
| --------------------- | -------------------------------------------------------------------------------------- |
| Supported file open   | "MoxyCode: Re-analysis complete — `filename`"                                          |
| No file open          | "MoxyCode: Open a file first to re-analyse."                                           |
| Unsupported file type | "MoxyCode: Re-analyse only supports Apex (.cls, .trigger) and LWC (.js, .html) files." |

**When to use:** When you want to force a fresh analysis without saving — for example after making manual edits or when CodeLens links seem out of date.

***

### MoxyCode: Toggle Online / Offline Mode

Switches between online mode (cloud AI) and offline mode (local Ollama model) without opening VS Code Settings.

| Current mode | Result                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------ |
| Online       | Switches to Offline Mode — "MoxyCode: Switched to Offline Mode — using local Ollama model" |
| Offline      | Switches to Online Mode — "MoxyCode: Switched to Online Mode — using cloud AI"             |

Switching to Offline Mode has additional checks:

* **Free plan** — shows "MoxyCode: Offline Mode is a Pro feature." with an **Upgrade to Pro** button that opens the pricing page
* **Pro, offline not set up** — shows "MoxyCode: Offline Mode requires setup first. Set it up now?" with a **Set Up Offline Mode** button that launches the setup wizard
* **Pro, offline set up** — switches immediately

Switching back to Online Mode always works with no checks.

**When to use:** Any time you want to quickly switch between cloud AI and local AI without going into Settings.

***

### MoxyCode: Toggle Safe Mode

Switches between Safe Mode and Auto Fix Mode — the same as clicking **MoxyCode: Safe** or **MoxyCode: Auto** in the VS Code status bar.

* Switching to Safe Mode: *"Safe Mode enabled — fixes require manual approval"*
* Switching to Auto Fix Mode: *"Auto Fix Mode enabled — fixes apply automatically"*

**When to use:** When you prefer using the Command Palette over the status bar toggle.

***

### MoxyCode: Set Up Offline Mode

Launches the guided setup process for Offline Mode. Walks you through installing Ollama and downloading the local AI model so MoxyCode can run fully offline with no code leaving your machine.

<Note>
  Offline Mode requires a Pro plan. Running this command on a Free plan will show an upgrade prompt.
</Note>

**When to use:** When you want to set up local offline AI for the first time.

***

### MoxyCode: Clean Up Offline Files

Launches a guided process to remove the Offline Mode setup from your machine — removes the local AI model and optionally uninstalls Ollama.

**When to use:** When you want to remove Offline Mode and free up disk space.

***

### MoxyCode: Open Chat

Opens the **MoxyCode — Code Analysis** panel with an empty chat window. Ask MoxyCode anything about your Apex or LWC code — errors, best practices, code explanations, or general Salesforce questions.

<Note>
  If you click **MoxyCode: 💡 Explain & Fix** on a flagged line while the chat is open, the panel resets to show that specific fix. Use Open Chat to start a fresh conversation without triggering analysis.
</Note>

**When to use:** When you want to ask MoxyCode a question outside of the normal fix workflow.
