Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
- Pull requests should include: a brief summary, testing notes, screenshots/GIFs for UI changes, and links to relevant issues or discussions.

## Configuration & Security Notes
- User-specific MCP servers live at `~/.config/SemanticDeveloper/mcp_servers.json` (or `%AppData%\SemanticDeveloper\mcp_servers.json` on Windows); avoid committing sample credentials.
- User-specific MCP servers live under `~/.codex/config.toml` (or `%USERPROFILE%\.codex\config.toml` on Windows); avoid committing sample credentials. The path honors `$CODEX_HOME`.
- API keys are configured through the app settings; never hard-code secrets—use environment variables or the settings dialog.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI app se
- Start a Codex session and stream assistant output in real time
- Send user input that is wrapped as protocol `Submission`s (app server)
- Auto‑approve exec/patch requests (automatic)
- Pick a model (built-in or from `config.toml` profiles) and load MCP servers from a JSON config (see [Windows setup](README.windows.md) for a WSL recipe)
- Pick a model (built-in or from `config.toml` profiles) and load MCP servers from the Codex CLI `config.toml` (`[mcp_servers]` section); see [Windows setup](README.windows.md) for a WSL recipe
- Keep multiple Codex sessions active at once using the tabbed header (each tab title shows its live status, e.g., `Session 2 – thinking…`)
– See live token usage and estimated context remaining in the header

Expand All @@ -28,21 +28,18 @@ Semantic Developer can drive the Codex CLI from Linux, macOS, or Windows.
### Linux

- Install the .NET 8 SDK and the Codex CLI in your Linux environment.
- Profiles live under `~/.codex/config.toml`; prompts under `~/.codex/prompts/`.
- MCP config file: `~/.config/SemanticDeveloper/mcp_servers.json`.
- Profiles & MCP servers live under `~/.codex/config.toml` (respects `$CODEX_HOME`); prompts under `~/.codex/prompts/`.

### macOS

- Install .NET 8 (e.g., `brew install dotnet-sdk`) and the Codex CLI (`brew install codex` or the official installer).
- Profiles/prompts: `~/.codex/config.toml` and `~/.codex/prompts/`.
- MCP config file: `~/Library/Application Support/SemanticDeveloper/mcp_servers.json`.
- Profiles & MCP servers: `~/.codex/config.toml` (respects `$CODEX_HOME`); prompts under `~/.codex/prompts/`.

### Windows

- RECOMMENDED see [Windows setup](README.windows.md) recipe
- Install the Windows .NET 8 SDK and Codex CLI for Windows, ensuring `codex.exe` is on your Windows `PATH`.
- Profiles/prompts default to `%USERPROFILE%\.codex\config.toml` and `%USERPROFILE%\.codex\prompts\` (respect `CODEX_HOME` if set).
- MCP config file: `%AppData%\SemanticDeveloper\mcp_servers.json`.
- Profiles & MCP servers default to `%USERPROFILE%\.codex\config.toml` (respects `CODEX_HOME`); prompts live under `%USERPROFILE%\.codex\prompts\`.

## Build & Run

Expand All @@ -65,11 +62,8 @@ Semantic Developer can drive the Codex CLI from Linux, macOS, or Windows.
- Any profiles defined in `config.toml` (e.g., `$CODEX_HOME/config.toml`, defaulting to `~/.codex/config.toml`) are appended to the list and marked with an asterisk (`*`). Selecting a profile locks the reasoning controls and lets the profile determine the model/effort.
- Profiles are optional—if you don’t have one, simply pick a built-in model.
- Verbose logging (show suppressed output)
- Enable MCP support (loads MCP servers from your JSON config and passes them directly to Codex)
- MCP config locations:
- Linux: `~/.config/SemanticDeveloper/mcp_servers.json`
- macOS: `~/Library/Application Support/SemanticDeveloper/mcp_servers.json`
- Windows: `%AppData%\SemanticDeveloper\mcp_servers.json`
- Enable MCP support (mirrors the `[mcp_servers]` entries from your Codex CLI `config.toml` and passes them directly to Codex)
- Config defaults to `~/.codex/config.toml` on Linux/macOS and `%USERPROFILE%\.codex\config.toml` on Windows; both honor `$CODEX_HOME`.
- Use API Key for Codex CLI (pipes the key to `codex login --with-api-key` before sessions; does not rely on existing CLI auth)
- Allow network access for tools (sets sandbox_policy.network_access=true on turns so MCP tools can reach the network)
- Without API key enabled, the app proactively authenticates with `codex auth login` (falling back to `codex login`) before sessions so your chat/GPT token is used.
Expand Down Expand Up @@ -222,18 +216,18 @@ Notes
## MCP Servers Panel

- The left pane includes an MCP section below the file tree:
- Servers list: a checkbox per server from `mcp_servers.json`. Only selected servers are injected at session start.
- Servers list: a checkbox per server defined under `[mcp_servers]` in your Codex `config.toml`. Only selected servers are injected at session start.
- Tools list: after session starts, tools are grouped under their server names using short identifiers (the full identifier is available as a tooltip).
- Header buttons:
- ⚙ opens `mcp_servers.json` in your editor.
- ⚙ opens `config.toml` in your editor.
- ↻ reloads the config and updates the server list.
- Only local stdio servers are supported (command/args/cwd/env). Remote transports (e.g., SSE) are not injected.

Config file location:
- Linux/macOS: `~/.config/SemanticDeveloper/mcp_servers.json`
- Windows: `%AppData%/SemanticDeveloper/mcp_servers.json`
- Linux/macOS: `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` if set)
- Windows: `%USERPROFILE%\.codex\config.toml` (honors `CODEX_HOME`)

> Unlike the Codex CLI's `config.toml`, which may also list MCP servers, the app only reads from `mcp_servers.json`. Keep your server command/argument definitions in this JSON file so Semantic Developer can surface them in the UI and pass them to Codex automatically. Profiles still live in `config.toml`, but MCP server wiring should follow the Semantic Developer format.
> Semantic Developer now shares the same MCP source as the Codex CLI. Define servers once inside `config.toml` and both the CLI and UI will pick them up automatically.

Selection behavior:
- The checkbox state in the MCP pane determines which servers are passed to Codex at session start.
Expand Down
4 changes: 2 additions & 2 deletions README.windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ WSLg should display the Semantic Developer UI on Windows. If the window fails to

## 10. Notes & Tips
- Store Codex profiles and prompts inside the WSL home (`~/.codex/config.toml`, `~/.codex/prompts/`); Semantic Developer detects them automatically.
- MCP server definitions live at `~/.config/SemanticDeveloper/mcp_servers.json` within Ubuntu.
- MCP server definitions live under `~/.codex/config.toml` (the `[mcp_servers]` section) within Ubuntu.
- Access Windows files from WSL using `/mnt/c/...`, but for best performance keep your workspace inside the Linux filesystem (e.g., `~/code`).
- To update Codex or Node.js later:
```bash
Expand All @@ -99,4 +99,4 @@ sudo apt install -y brave-browser

# test it
brave-browser
```
```
2 changes: 1 addition & 1 deletion SemanticDeveloper/Installers/Linux/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ APP_PROJ="$ROOT/SemanticDeveloper/SemanticDeveloper.csproj"
PUBLISH_DIR="$SCRIPT_DIR/out/publish"
PKG_ROOT="$SCRIPT_DIR/pkgroot"
DIST_DIR="$SCRIPT_DIR/dist"
VERSION="1.0.6"
VERSION="1.0.7"
ARCH="amd64"
if [[ "$RID" == "linux-arm64" ]]; then ARCH="arm64"; fi

Expand Down
Binary file not shown.
11 changes: 11 additions & 0 deletions SemanticDeveloper/SemanticDeveloper/Models/FileTreeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ public string Name
public bool IsDirectory { get; init; }
public ObservableCollection<FileTreeItem> Children { get; } = new();
public bool ChildrenInitialized { get; private set; }
private bool _isExpanded;
public bool IsExpanded
{
get => _isExpanded;
set
{
if (_isExpanded == value) return;
_isExpanded = value;
OnPropertyChanged();
}
}
private string _gitStatus = string.Empty; // "added", "modified", "deleted", ""
public string GitStatus
{
Expand Down
3 changes: 2 additions & 1 deletion SemanticDeveloper/SemanticDeveloper/SemanticDeveloper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>1.0.6</Version>
<Version>1.0.7</Version>
<Copyright>2025 Stainless Designer LLC</Copyright>
</PropertyGroup>

Expand All @@ -23,6 +23,7 @@
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.3.0" />
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Tomlyn" Version="0.15.0" />
</ItemGroup>

<ItemGroup>
Expand Down
22 changes: 22 additions & 0 deletions SemanticDeveloper/SemanticDeveloper/Services/CodexConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ public static string GetConfigTomlPath()
}
}

public static void EnsureConfigExists()
{
try
{
var path = GetConfigTomlPath();
if (File.Exists(path))
return;
var dir = Path.GetDirectoryName(path);
if (!string.IsNullOrWhiteSpace(dir))
Directory.CreateDirectory(dir);
// Seed a minimal config so opening the file works even on fresh installs.
var seed = "# Codex CLI configuration generated by Semantic Developer" + Environment.NewLine +
Environment.NewLine +
"[mcp_servers]" + Environment.NewLine;
File.WriteAllText(path, seed);
}
catch
{
// Best-effort safeguard — ignore failures so the caller can handle errors gracefully.
}
}

public static string GetPromptsDirectory()
{
try
Expand Down
44 changes: 0 additions & 44 deletions SemanticDeveloper/SemanticDeveloper/Services/McpConfigService.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
IsChecked="{Binding McpEnabled, Mode=TwoWay}"
HorizontalAlignment="Stretch"
Margin="0,0,24,0"/>
<TextBlock Margin="0,4,24,6" Foreground="#888" FontSize="12" Text="Loads MCP servers from mcp_servers.json in your app data folder and passes them directly to Codex." TextWrapping="Wrap"/>
<TextBlock Margin="0,4,24,6" Foreground="#888" FontSize="12" Text="Loads MCP servers from the Codex CLI config.toml ([mcp_servers]) so they flow straight into Codex sessions." TextWrapping="Wrap"/>
<StackPanel IsEnabled="{Binding McpEnabled}">
<CheckBox Content="Allow network access for tools (MCP, web fetches)"
IsChecked="{Binding AllowNetworkAccess, Mode=TwoWay}"
Expand Down
13 changes: 11 additions & 2 deletions SemanticDeveloper/SemanticDeveloper/Views/SessionView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
<Grid RowDefinitions="Auto,*,Auto,*">
<TextBlock Margin="10,8" FontWeight="SemiBold" Text="Workspace Files" Foreground="#E6E6E6"/>
<TreeView x:Name="WorkspaceTree" Grid.Row="1" ItemsSource="{Binding TreeRoots}" SelectionChanged="OnTreeSelectionChanged">
<TreeView.Styles>
<Style Selector="TreeViewItem">
<Setter Property="IsExpanded">
<Setter.Value>
<Binding Path="IsExpanded" Mode="TwoWay"/>
</Setter.Value>
</Setter>
</Style>
</TreeView.Styles>
<TreeView.DataTemplates>
<TreeDataTemplate DataType="models:FileTreeItem" ItemsSource="{Binding Children}">
<Grid ColumnDefinitions="Auto,6,*" VerticalAlignment="Center">
Expand Down Expand Up @@ -110,7 +119,7 @@
<TextBlock FontWeight="SemiBold" Text="MCP" Foreground="#E6E6E6" VerticalAlignment="Center"/>
<Button Width="22" Height="22"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Padding="0" Click="OnOpenMcpConfigClick" ToolTip.Tip="Open mcp_servers.json">⚙</Button>
Padding="0" Click="OnOpenMcpConfigClick" ToolTip.Tip="Open Codex config.toml">⚙</Button>
<Button Width="22" Height="22"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Padding="0" Click="OnMcpRefreshConfigClick" ToolTip.Tip="Refresh servers">↻</Button>
Expand All @@ -120,7 +129,7 @@
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="0,4,0,0">
<StackPanel HorizontalAlignment="Stretch" Spacing="6">
<TextBlock TextWrapping="Wrap" Foreground="#AAAAAA" FontSize="12"
Text="No MCP servers configured yet. Click ⚙ to open mcp_servers.json and add your servers using Semantic Developer's JSON format."
Text="No MCP servers configured yet. Click ⚙ to open config.toml and add entries under the [mcp_servers] section."
IsVisible="{Binding HasNoMcpServers}"/>
<TextBlock TextWrapping="Wrap" Foreground="#AAAAAA" FontSize="12"
Text="MCP support is currently disabled. Enable it under CLI Settings so selected servers are passed to Codex."
Expand Down
Loading