Compare commits
No commits in common. "main" and "master" have entirely different histories.
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
.vscode-test/
|
||||
*.vsix
|
||||
41
.vsixmanifest
Normal file
41
.vsixmanifest
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="alfred-commander" Version="1.0.1" Publisher="gositeme" />
|
||||
<DisplayName>Alfred Commander — Full IDE Chat & Voice</DisplayName>
|
||||
<Description xml:space="preserve">Fresh Alfred panel: all agents & models, voice STT/TTS, attachments, hands-free. IDE shortcuts are explicit buttons — chat text always goes to AI.</Description>
|
||||
<Tags>keybindings</Tags>
|
||||
<Categories>Other</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.70.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="workspace" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Content.Pricing" Value="Free"/>
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
|
||||
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
79
README.md
79
README.md
@ -1,43 +1,60 @@
|
||||
# Alfred IDE
|
||||
# Alfred Commander (Theia / code-server extension)
|
||||
|
||||
Cloud-native AI development environment built on code-server, with custom Commander extension, multi-provider AI chat, voice assistant, and sovereign infrastructure.
|
||||
**Alfred IDE** = GoCodeMe **Theia** in the browser (`/ide/...`), **not** Cursor. Extensions are loaded from **`gocodeme/theia-fork/plugins/`** (see `gocodeme/docs/ALFRED_COMMANDER_THEIA.md`).
|
||||
|
||||
## Architecture
|
||||
**New panel** — does **not** replace `gositeme.alfred-voice`; you can disable the old one when you’re happy.
|
||||
|
||||
- **Base**: code-server 4.102.2 (VS Code for the web)
|
||||
- **Extension**: Alfred Commander (3,551-line extension.js) — AI chat, stats, voice, walkthrough
|
||||
- **Auth**: Cookie-based gating via Apache + PHP, PIN/email login
|
||||
- **MCP**: 500+ tools via gocodeme-mcp service (port 3006)
|
||||
- **Branding**: Patched workbench.js + NLS message files
|
||||
## What’s included (full stack)
|
||||
|
||||
## Components
|
||||
- **All agents & model routes** (same list as Alfred Voice)
|
||||
- **Voice**: mic → Whisper STT → chat; **TTS** playback of replies
|
||||
- **Hands-free**, **attachments** (images, PDF, text, ZIP), **payload meter**, **telemetry log**, **retry**
|
||||
- **IDE shortcuts** as **explicit buttons** (Terminal, Save, Save all, Commands, Split, New file) — **chat text is never hijacked** by “save/search/find” phrases
|
||||
- `run <cmd>` still sends **only** to the integrated terminal (not to AI)
|
||||
- `insert` / `type` prefixes still insert at cursor
|
||||
|
||||
| Component | Location | Purpose |
|
||||
|-----------|----------|---------|
|
||||
| `start.sh` | Server start script | Launches code-server with config |
|
||||
| `config.yaml` | code-server config | Port 8443, auth:none (Apache handles auth) |
|
||||
| `branding-patches.sh` | Branding automation | Patches "code-server" → "Alfred IDE" |
|
||||
| Commander extension | `extensions/gositeme.alfred-commander-1.0.1/` | Full IDE UX |
|
||||
## Proven wiring (kept from working code)
|
||||
|
||||
## Auth Flow
|
||||
- `POST /api/alfred-chat.php` with `ide_session_token`, IDE bearer headers, **Set-Cookie array** handling, CSRF retry
|
||||
- `ide_client_id` / `ide_sig` HMAC when profile is available
|
||||
- **Request id** on thinking rows for reply alignment
|
||||
|
||||
1. User visits `gositeme.com/alfred-ide/`
|
||||
2. Apache checks for `alfred_ide_token` cookie
|
||||
3. Missing → redirect to `alfred-ide-auth.php`
|
||||
4. Login via PIN (Commander) or email/password
|
||||
5. Session created in DB, cookie set → proxy to code-server
|
||||
## Install (Alfred IDE / Theia — primary)
|
||||
|
||||
## Running
|
||||
Canonical copy:
|
||||
|
||||
```bash
|
||||
# PM2 managed
|
||||
pm2 start alfred-ide
|
||||
`~/.local/share/code-server/extensions/gositeme.alfred-commander-1.0.0/`
|
||||
|
||||
# Manual
|
||||
./start.sh
|
||||
# → http://127.0.0.1:8443
|
||||
```
|
||||
**Theia** (Alfred IDE) loads plugins from:
|
||||
|
||||
## License
|
||||
`gocodeme/theia-fork/plugins/gositeme.alfred-commander-1.0.0` → symlink to the canonical path above.
|
||||
|
||||
AGPL-3.0 — GoSiteMe Inc.
|
||||
1. Confirm that symlink exists on the server.
|
||||
2. **Restart your IDE session** (stop + launch Theia) so plugins reload.
|
||||
3. **View → Open View…** → **Alfred Commander**.
|
||||
|
||||
Optional: **code-server**-only installs can use the same canonical path under `~/.local/share/code-server/extensions/`.
|
||||
|
||||
4. **Activity bar** — gold mic **Alfred Commander**; or **Command Palette** → **Alfred Commander: Open Panel**.
|
||||
5. Optional: disable `alfred-voice` if you don’t want two Alfred panels.
|
||||
6. To dock on the **right**: drag the view into the **secondary side bar** (View → Appearance → Secondary Side Bar).
|
||||
|
||||
## Commands & keys (no **View** menu required)
|
||||
|
||||
- **Ctrl+Shift+P** (or **F1**) → type **`Alfred Commander: Open Panel`** → Enter.
|
||||
This works even when the top menu bar is hidden.
|
||||
- **Ctrl+Shift+Alt+O** — **Open Panel** (after extension loads / VSIX updated).
|
||||
- **Ctrl+Shift+Alt+A** — **Toggle mic**
|
||||
- **Alfred Commander: Test API Connection** — from Command Palette
|
||||
|
||||
If the menu bar is missing: **Ctrl+Shift+P** → **Preferences: Open Settings** → search **`menu bar`** → set **Menu Bar Visibility** to **Visible** (or **Classic**). The extension also sets a default to show the menu when possible.
|
||||
|
||||
## Commands (palette)
|
||||
|
||||
- `Alfred Commander: Open Panel`
|
||||
- `Alfred Commander: Toggle Mic`
|
||||
- `Alfred Commander: Test API Connection`
|
||||
|
||||
## Token
|
||||
|
||||
Same as before: sign in at `/alfred-ide/`, `session.json` in `logs/alfred-ide/` or `~/.alfred-ide/`, or `ALFRED_IDE_TOKEN` env.
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Alfred IDE Branding Patches
|
||||
# Applied to code-server workbench.js and NLS files
|
||||
# See user memory notes for full details
|
||||
|
||||
WORKBENCH="/home/gositeme/.local/share/code-server/lib/vscode/out/vs/workbench/workbench.web.main.js"
|
||||
|
||||
# Product name patches
|
||||
sed -i 's/nameShort:"code-server"/nameShort:"Alfred IDE"/g' "$WORKBENCH"
|
||||
sed -i 's/nameLong:"code-server"/nameLong:"Alfred IDE"/g' "$WORKBENCH"
|
||||
|
||||
# Secure context warning
|
||||
sed -i 's/d(3228,null,"code-server")/d(3228,null,"Alfred IDE")/g' "$WORKBENCH"
|
||||
|
||||
# Logout menu
|
||||
sed -i 's/d(3230,null,"code-server")/d(3230,null,"Alfred IDE")/g' "$WORKBENCH"
|
||||
|
||||
# Update notification
|
||||
sed -i 's/\[code-server v/[Alfred IDE v/g' "$WORKBENCH"
|
||||
|
||||
echo "Branding patches applied to $(basename $WORKBENCH)"
|
||||
@ -1,7 +0,0 @@
|
||||
bind-addr: 127.0.0.1:8443
|
||||
auth: none
|
||||
cert: false
|
||||
app-name: Alfred IDE
|
||||
welcome-text: Welcome, Commander
|
||||
disable-telemetry: true
|
||||
disable-update-check: true
|
||||
3551
extension.js
Normal file
3551
extension.js
Normal file
File diff suppressed because it is too large
Load Diff
10
extensions.json
Normal file
10
extensions.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"gositeme.alfred-commander"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode-remote.remote-ssh",
|
||||
"ms-vscode.remote-server",
|
||||
"ms-vscode.remote-explorer"
|
||||
]
|
||||
}
|
||||
6
media/alfred-icon.svg
Normal file
6
media/alfred-icon.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#e2b340" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>
|
||||
<path d="M19 10v2a7 7 0 0 1-14 0v-2"/>
|
||||
<line x1="12" y1="19" x2="12" y2="23"/>
|
||||
<line x1="8" y1="23" x2="16" y2="23"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 352 B |
17
media/walkthrough/meet-alfred.md
Normal file
17
media/walkthrough/meet-alfred.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Meet Alfred
|
||||
|
||||
Alfred is your AI coding companion, built into the sidebar.
|
||||
|
||||
## What Alfred Can Do
|
||||
- **Answer questions** about your code, frameworks, and tools
|
||||
- **Generate code** from natural language descriptions
|
||||
- **Debug issues** by analyzing errors and suggesting fixes
|
||||
- **Explain code** — select any block and ask "what does this do?"
|
||||
- **Run tools** — file search, terminal commands, web lookups
|
||||
|
||||
## How to Start
|
||||
1. Click the **Alfred icon** (🅰️) in the activity bar (left side)
|
||||
2. Type your question or request in the chat input
|
||||
3. Press Enter — Alfred responds in real time
|
||||
|
||||
Alfred remembers your conversation context, so you can have natural multi-turn discussions about your code.
|
||||
18
media/walkthrough/models.md
Normal file
18
media/walkthrough/models.md
Normal file
@ -0,0 +1,18 @@
|
||||
# AI Models
|
||||
|
||||
Alfred IDE supports multiple AI providers and models.
|
||||
|
||||
## Available Tiers
|
||||
|
||||
| Tier | Best For | Examples |
|
||||
|------|----------|---------|
|
||||
| **Leaf** | Simple tasks, quick answers | GPT-4o-mini, local Ollama |
|
||||
| **Mid** | Code generation, analysis | Claude 3.5 Sonnet, GPT-4o |
|
||||
| **Frontier** | Complex reasoning, architecture | Claude Opus, GPT-4 |
|
||||
| **Max** | Research, multi-step planning | Claude Opus (extended) |
|
||||
|
||||
## How to Switch
|
||||
Use the **model dropdown** at the top of the Alfred panel to select your preferred model.
|
||||
|
||||
## Local Models
|
||||
If Ollama is running, local models appear automatically — your code never leaves your machine.
|
||||
24
media/walkthrough/shortcuts.md
Normal file
24
media/walkthrough/shortcuts.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Keyboard Shortcuts
|
||||
|
||||
Master these to work at full speed.
|
||||
|
||||
## Alfred Commands
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Ctrl+Shift+Alt+O` | Open Alfred Panel |
|
||||
| `Ctrl+Shift+Alt+A` | Toggle Voice Mode |
|
||||
|
||||
## Essential IDE Shortcuts
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Ctrl+P` | Quick File Open |
|
||||
| `Ctrl+Shift+P` | Command Palette |
|
||||
| `Ctrl+`` ` | Toggle Terminal |
|
||||
| `Ctrl+B` | Toggle Sidebar |
|
||||
| `Ctrl+Shift+E` | File Explorer |
|
||||
| `Ctrl+Shift+F` | Search Across Files |
|
||||
| `Ctrl+Shift+G` | Source Control |
|
||||
| `F5` | Start Debugging |
|
||||
| `Ctrl+/` | Toggle Line Comment |
|
||||
| `Alt+↑/↓` | Move Line Up/Down |
|
||||
| `Ctrl+D` | Select Next Occurrence |
|
||||
27
media/walkthrough/sovereign.md
Normal file
27
media/walkthrough/sovereign.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Sovereign Development
|
||||
|
||||
Alfred IDE is built on one principle: **your code is yours**.
|
||||
|
||||
## What We Don't Do
|
||||
- ❌ No telemetry or usage tracking
|
||||
- ❌ No analytics or behavior profiling
|
||||
- ❌ No data sold to third parties
|
||||
- ❌ No phone-home to Microsoft, Google, or anyone
|
||||
- ❌ No extension marketplace surveillance
|
||||
|
||||
## What We Do
|
||||
- ✅ All AI calls go through your GoSiteMe account
|
||||
- ✅ Conversations are stored in YOUR database
|
||||
- ✅ Local Ollama models keep everything on-device
|
||||
- ✅ Secret redaction engine scrubs credentials from all output
|
||||
- ✅ Post-quantum encryption available via Veil Protocol
|
||||
|
||||
## The GoSiteMe Ecosystem
|
||||
Alfred IDE is one pillar of the sovereign computing stack:
|
||||
- **Alfred Linux** — AI-native operating system
|
||||
- **Alfred Browser** — zero-tracking web browser
|
||||
- **Alfred Mobile** — sovereign smartphone OS
|
||||
- **Veil** — post-quantum encrypted messaging
|
||||
- **MetaDome** — VR worlds with 51M+ AI agents
|
||||
|
||||
Welcome to the kingdom. 🏰
|
||||
16
media/walkthrough/stats.md
Normal file
16
media/walkthrough/stats.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Account & Usage
|
||||
|
||||
Monitor your plan, usage, and billing from inside the IDE.
|
||||
|
||||
## How to Access
|
||||
Click your **username** in the bottom status bar, or run:
|
||||
- Command Palette → "Alfred: Account & Usage Stats"
|
||||
|
||||
## What You'll See
|
||||
- **Plan**: Your current subscription tier
|
||||
- **Token Usage**: How many AI tokens you've consumed
|
||||
- **Credit Balance**: Remaining credits for the billing period
|
||||
- **Active Services**: Which ecosystem services are linked
|
||||
|
||||
## Commander Access
|
||||
If you're the Commander (client_id 33), you have unlimited access — no token limits, no restrictions.
|
||||
18
media/walkthrough/voice.md
Normal file
18
media/walkthrough/voice.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Voice Commands
|
||||
|
||||
Talk to your IDE — Alfred listens, transcribes, and responds.
|
||||
|
||||
## How It Works
|
||||
1. Click the **🎤 microphone** button in the Alfred panel
|
||||
2. Speak naturally — your voice is transcribed in real time
|
||||
3. Alfred processes your request and responds
|
||||
|
||||
## Voice Architecture
|
||||
- **STT (Speech-to-Text)**: Whisper-based transcription
|
||||
- **LLM**: Your selected AI model processes the request
|
||||
- **TTS (Text-to-Speech)**: Kokoro voices read the response back
|
||||
|
||||
## Tips
|
||||
- Speak clearly and at a normal pace
|
||||
- You can say "stop" or click the mic again to end recording
|
||||
- Voice works best with short, focused requests
|
||||
142
package.json
Normal file
142
package.json
Normal file
@ -0,0 +1,142 @@
|
||||
{
|
||||
"name": "alfred-commander",
|
||||
"displayName": "Alfred IDE Assistant — Full IDE Chat & Voice",
|
||||
"description": "Fresh Alfred panel: all agents & models, voice STT/TTS, attachments, hands-free. IDE shortcuts are explicit buttons — chat text always goes to AI.",
|
||||
"version": "2.1.0",
|
||||
"publisher": "gositeme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://alfredlinux.com/forge/commander/alfred-ide.git"
|
||||
},
|
||||
"homepage": "https://alfredlinux.com/forge/commander/alfred-ide",
|
||||
"engines": {
|
||||
"vscode": "^1.70.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onStartupFinished"
|
||||
],
|
||||
"main": "./extension.js",
|
||||
"contributes": {
|
||||
"configurationDefaults": {
|
||||
"window.menuBarVisibility": "visible"
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "alfred-commander.open",
|
||||
"title": "Alfred: Open Panel"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.toggle",
|
||||
"title": "Alfred: Toggle Mic"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.showStats",
|
||||
"title": "Alfred: Account & Usage Stats"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.welcome",
|
||||
"title": "Alfred: Getting Started"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.workspaceStatus",
|
||||
"title": "Alfred: Workspace Status"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "alfred-commander.open",
|
||||
"key": "ctrl+shift+alt+o",
|
||||
"mac": "cmd+shift+alt+o"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.toggle",
|
||||
"key": "ctrl+shift+alt+a",
|
||||
"mac": "cmd+shift+alt+a"
|
||||
}
|
||||
],
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "alfred-commander-container",
|
||||
"title": "Alfred",
|
||||
"icon": "media/alfred-icon.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"alfred-commander-container": [
|
||||
{
|
||||
"type": "webview",
|
||||
"id": "alfred-commander.panel",
|
||||
"name": "Alfred",
|
||||
"visibility": "visible"
|
||||
}
|
||||
]
|
||||
},
|
||||
"walkthroughs": [
|
||||
{
|
||||
"id": "alfred-ide-getting-started",
|
||||
"title": "Getting Started with Alfred IDE",
|
||||
"description": "Your sovereign development environment — AI-powered, zero-tracking, fully yours.",
|
||||
"steps": [
|
||||
{
|
||||
"id": "meet-alfred",
|
||||
"title": "Meet Alfred — Your AI Companion",
|
||||
"description": "Alfred lives in the sidebar. Click the Alfred icon in the activity bar to open the chat panel. Ask anything — code questions, file operations, debugging help.\n\n[Open Alfred Panel](command:alfred-commander.open)",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/meet-alfred.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "voice-commands",
|
||||
"title": "Talk to Your IDE",
|
||||
"description": "Alfred supports voice input. Click the microphone button or press ``Ctrl+Shift+Alt+A`` to toggle voice mode. Speak naturally — Alfred transcribes and responds.\n\n[Toggle Voice](command:alfred-commander.toggle)",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/voice.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "choose-model",
|
||||
"title": "Choose Your AI Model",
|
||||
"description": "Switch between AI providers and models using the dropdown at the top of the Alfred panel. Available models include Claude, GPT, local Ollama models, and more.",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/models.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "account-stats",
|
||||
"title": "Check Your Usage & Plan",
|
||||
"description": "Click your username in the status bar (bottom-left) to see your account details, token usage, plan info, and billing.\n\n[View Account Stats](command:alfred-commander.showStats)",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/stats.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "keyboard-shortcuts",
|
||||
"title": "Essential Shortcuts",
|
||||
"description": "Master these shortcuts to work faster:\n- ``Ctrl+Shift+Alt+O`` — Open Alfred Panel\n- ``Ctrl+Shift+Alt+A`` — Toggle Voice\n- ``Ctrl+``` `` — Open Terminal\n- ``Ctrl+P`` — Quick File Open\n- ``Ctrl+Shift+P`` — Command Palette",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/shortcuts.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sovereign-ide",
|
||||
"title": "Your Sovereign IDE",
|
||||
"description": "Alfred IDE tracks nothing. No telemetry, no usage analytics, no data collection. Your code stays on your machine. Your conversations stay private. Welcome to sovereign development.",
|
||||
"media": {
|
||||
"markdown": "media/walkthrough/sovereign.md"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"__metadata": {
|
||||
"installedTimestamp": 1774281381634,
|
||||
"targetPlatform": "undefined",
|
||||
"size": 75665
|
||||
}
|
||||
}
|
||||
28
start.sh
28
start.sh
@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Alfred IDE - Start Script
|
||||
# Launches code-server (rebranded as Alfred IDE)
|
||||
# CRITICAL: unset VSCODE_IPC_HOOK_CLI or code-server detects VS Code and exits silently
|
||||
|
||||
unset VSCODE_IPC_HOOK_CLI
|
||||
|
||||
# Prevent file watcher from consuming all CPU when inotify fills up
|
||||
export VSCODE_FILE_WATCHER_POLLING_INTERVAL=30000
|
||||
export CHOKIDAR_USEPOLLING=0
|
||||
|
||||
PORT=8443
|
||||
HOST=127.0.0.1
|
||||
CODE_SERVER_BIN=/home/gositeme/.local/bin/code-server
|
||||
|
||||
# If Alfred IDE is already bound on the expected port, do not spawn a duplicate.
|
||||
EXISTING_PID=$(ss -ltnp 2>/dev/null | awk -v addr="$HOST:$PORT" '$4 == addr { if (match($0, /pid=([0-9]+)/, m)) print m[1] }' | head -n 1)
|
||||
if [[ -n "$EXISTING_PID" ]] && ps -p "$EXISTING_PID" -o args= 2>/dev/null | grep -q 'code-server'; then
|
||||
echo "Alfred IDE already running on ${HOST}:${PORT} (pid ${EXISTING_PID})"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec nice -n 15 ionice -c 3 /home/gositeme/.local/bin/code-server \
|
||||
--bind-addr ${HOST}:${PORT} \
|
||||
--disable-telemetry \
|
||||
--disable-update-check \
|
||||
--user-data-dir /home/gositeme/.local/share/code-server \
|
||||
/home/gositeme
|
||||
Loading…
Reference in New Issue
Block a user