# Connect-IntelligenceX

Connects to IntelligenceX (native or app-server) and returns a client instance.

Command 

**Module**

`IntelligenceX.PowerShell`

**Outputs**

`IntelligenceX.OpenAI.IntelligenceXClient`

Connects to IntelligenceX (native or app-server) and returns a client instance.

## Syntax

```
Connect-IntelligenceX
[-Arguments <string>]
[-Diagnostics]
[-ExecutablePath <string>]
[-NoConfig]
[-OpenAIAccountId <string>]
[-Transport <Native|AppServer|CompatibleHttp|CopilotCli>]
[-WorkingDirectory <string>]
[<CommonParameters>]
```

[#](#method-connect-intelligencex-string-switchparameter-string-switchparameter-string-openaitransportkind-string)

## Examples

### Example 1

```powershell
Connect-IntelligenceX -Transport Native
```

Native transport (ChatGPT OAuth)

### Example 2

```powershell
Connect-IntelligenceX -Transport AppServer -ExecutablePath "C:\tools\codex.exe"
```

App-server transport with explicit executable path

### Example 3

```powershell
Connect-IntelligenceX -Transport AppServer -WorkingDirectory "C:\repo" -Arguments "app-server --verbose"
```

App-server transport with custom working directory and args

### Example 4

```powershell
Connect-IntelligenceX -Transport Native -Diagnostics
```

Enable diagnostics output

### Example 5

```powershell
Connect-IntelligenceX -Transport Native -OpenAIAccountId "user-123"
```

Pin a specific OpenAI account id when multiple bundles are present

## Parameters

**-Arguments string optional**

Arguments to pass to the app-server. Defaults to 'app-server'.

**-Diagnostics SwitchParameter optional**

Enable diagnostics output (RPC calls, login events, stderr).

**-ExecutablePath string optional**

Path to the codex executable. Defaults to 'codex' on PATH.

**-NoConfig SwitchParameter optional**

Ignore .intelligencex/config.json overrides.

**-OpenAIAccountId string optional**

Optional ChatGPT account id to use when multiple auth bundles are present.

**-Transport OpenAITransportKind optional**

Transport to use (Native or AppServer). Native uses ChatGPT OAuth directly. Possible values: Native, AppServer, CompatibleHttp, CopilotCli

Possible values: `Native`, `AppServer`, `CompatibleHttp`, `CopilotCli`

**-WorkingDirectory string optional**

Working directory for the app-server process.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:41B2027EB99A274B0825A213666CD748EA10B580CF235FE540DFC7E602321EC5 -->
