Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ agents_lineup.svg
docs/
goals.py
pr-reviews/
AGENTS.md
agentchattr-*.zip
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ A local chat server for real-time coordination between AI coding agents and huma

Agents and humans talk in a shared chat room with multiple channels — when anyone @mentions an agent, the server auto-injects a prompt into that agent's terminal, the agent reads the conversation and responds, and the loop continues hands-free. No copy-pasting between ugly terminals. No manual prompting.

## What's New
- **Agent Identity**: Agents are now informed of their name (e.g., "You are claude-2") when triggered, improving coordination in multi-instance sessions.
- **Custom Agent Parameters**:
- **CLI Agents**: Support for custom `args` and `env` per agent in `config.toml`.
- **API Agents**: Support for `custom_params` to pass extra parameters to model endpoints.

*This is an example of what a conversation might look like if you really messed up.*

![screenshot](screenshot.png)
Expand Down Expand Up @@ -64,7 +70,7 @@ On first launch, the script auto-creates a virtual environment, installs Python
<details>
<summary>All agent launchers (click to expand)</summary>

- `sh start.sh` — starts the chat server only
- `sh start.sh` — starts the chat server only (and cleans up existing tmux sessions)
- `sh start_claude.sh` — starts Claude
- `sh start_codex.sh` — starts Codex
- `sh start_gemini.sh` — starts Gemini
Expand Down
11 changes: 11 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
port = 8300
host = "127.0.0.1"
data_dir = "./data"
project_root = "/home/hamdan/Desktop/Password_Library/" # Global root directory for all agents. If set, agent 'cwd' is relative to this.

# Add agents here. Each gets a status pill, @mention routing, and color.
# "cwd" is the working directory for the agent's terminal session.
Expand Down Expand Up @@ -47,6 +48,16 @@ cwd = ".."
color = "#f7f677"
label = "Kilo"

[agents.opencode]
command = "opencode"
args = ["-m google/gemma-4-26b-a4b-it"]
cwd = ".."
color = "#808080"
label = "OpenCode"
mcp_inject = "opencode_json"
mcp_settings_path = "opencode.json"
mcp_transport = "http"

[agents.codebuddy]
command = "codebuddy"
cwd = ".."
Expand Down
3 changes: 3 additions & 0 deletions macos-linux/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ ensure_venv() {

ensure_venv

# Kill any existing tmux sessions to ensure a clean start
tmux kill-server 2>/dev/null

.venv/bin/python run.py
code=$?
echo ""
Expand Down
64 changes: 64 additions & 0 deletions macos-linux/start_opencode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env sh
# agentchattr - starts server (if not running) + OpenCode wrapper
cd "$(dirname "$0")/.."

PYTHON_BIN=""
if command -v python3 >/dev/null 2>&1; then
PYTHON_BIN="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_BIN="python"
else
echo "Python 3 is required but was not found on PATH."
exit 1
fi

ensure_venv() {
if [ -d ".venv" ] && [ ! -x ".venv/bin/python" ]; then
echo "Recreating .venv for this platform..."
rm -rf .venv
fi

if [ ! -x ".venv/bin/python" ]; then
echo "Creating virtual environment..."
"$PYTHON_BIN" -m venv .venv || {
echo "Error: failed to create .venv with $PYTHON_BIN."
exit 1
}
.venv/bin/python -m pip install -q -r requirements.txt || {
echo "Error: failed to install Python dependencies."
exit 1
}
fi
}

is_server_running() {
lsof -i :8300 -sTCP:LISTEN >/dev/null 2>&1 || \
ss -tlnp 2>/dev/null | grep -q ':8300 '
}

ensure_venv

if ! is_server_running; then
if [ "$(uname -s)" = "Darwin" ]; then
osascript -e "tell app \"Terminal\" to do script \"cd '$(pwd)' && .venv/bin/python run.py\"" > /dev/null 2>&1
else
if command -v gnome-terminal >/dev/null 2>&1; then
gnome-terminal -- sh -c "cd '$(pwd)' && .venv/bin/python run.py; printf 'Press Enter to close... '; read _"
elif command -v xterm >/dev/null 2>&1; then
xterm -e sh -c "cd '$(pwd)' && .venv/bin/python run.py" &
else
.venv/bin/python run.py > data/server.log 2>&1 &
fi
fi

i=0
while [ "$i" -lt 30 ]; do
if is_server_running; then
break
fi
sleep 0.5
i=$((i + 1))
done
fi

.venv/bin/python wrapper.py opencode
64 changes: 64 additions & 0 deletions macos-linux/start_opencode_yolo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env sh
# agentchattr - starts server (if not running) + OpenCode wrapper (yolo mode)
cd "$(dirname "$0")/.."

PYTHON_BIN=""
if command -v python3 >/dev/null 2>&1; then
PYTHON_BIN="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_BIN="python"
else
echo "Python 3 is required but was not found on PATH."
exit 1
fi

ensure_venv() {
if [ -d ".venv" ] && [ ! -x ".venv/bin/python" ]; then
echo "Recreating .venv for this platform..."
rm -rf .venv
fi

if [ ! -x ".venv/bin/python" ]; then
echo "Creating virtual environment..."
"$PYTHON_BIN" -m venv .venv || {
echo "Error: failed to create .venv with $PYTHON_BIN."
exit 1
}
.venv/bin/python -m pip install -q -r requirements.txt || {
echo "Error: failed to install Python dependencies."
exit 1
}
fi
}

is_server_running() {
lsof -i :8300 -sTCP:LISTEN >/dev/null 2>&1 || \
ss -tlnp 2>/dev/null | grep -q ':8300 '
}

ensure_venv

if ! is_server_running; then
if [ "$(uname -s)" = "Darwin" ]; then
osascript -e "tell app \"Terminal\" to do script \"cd '$(pwd)' && .venv/bin/python run.py\"" > /dev/null 2>&1
else
if command -v gnome-terminal >/dev/null 2>&1; then
gnome-terminal -- sh -c "cd '$(pwd)' && .venv/bin/python run.py; printf 'Press Enter to close... '; read _"
elif command -v xterm >/dev/null 2>&1; then
xterm -e sh -c "cd '$(pwd)' && .venv/bin/python run.py" &
else
.venv/bin/python run.py > data/server.log 2>&1 &
fi
fi

i=0
while [ "$i" -lt 30 ]; do
if is_server_running; then
break
fi
sleep 0.5
i=$((i + 1))
done
fi

.venv/bin/python wrapper.py opencode -- --dangerously-skip-permissions
40 changes: 40 additions & 0 deletions windows/start_opencode.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@echo off
REM agentchattr — starts server (if not running) + OpenCode wrapper
cd /d "%~dp0.."

REM Auto-create venv and install deps on first run
if not exist ".venv" (
python -m venv .venv
.venv\Scripts\pip install -q -r requirements.txt >nul 2>nul
)
call .venv\Scripts\activate.bat

REM Pre-flight: check that opencode CLI is installed
where opencode >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo Error: "opencode" was not found on PATH.
echo Install it first, then try again.
echo.
pause
exit /b 1
)

REM Start server if not already running, then wait for it
netstat -ano | findstr :8300 | findstr LISTENING >nul 2>&1
if %errorlevel% neq 0 (
start "agentchattr server" cmd /c "python run.py"
)
:wait_server
netstat -ano | findstr :8300 | findstr LISTENING >nul 2>&1
if %errorlevel% neq 0 (
timeout /t 1 /nobreak >nul
goto :wait_server
)

python wrapper.py opencode
if %errorlevel% neq 0 (
echo.
echo Agent exited unexpectedly. Check the output above.
pause
)
40 changes: 40 additions & 0 deletions windows/start_opencode_yolo.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@echo off
REM agentchattr — starts server (if not running) + OpenCode wrapper (yolo mode)
cd /d "%~dp0.."

REM Auto-create venv and install deps on first run
if not exist ".venv" (
python -m venv .venv
.venv\Scripts\pip install -q -r requirements.txt >nul 2>nul
)
call .venv\Scripts\activate.bat

REM Pre-flight: check that opencode CLI is installed
where opencode >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo Error: "opencode" was not found on PATH.
echo Install it first, then try again.
echo.
pause
exit /b 1
)

REM Start server if not already running, then wait for it
netstat -ano | findstr :8300 | findstr LISTENING >nul 2>&1
if %errorlevel% neq 0 (
start "agentchattr server" cmd /c "python run.py"
)
:wait_server
netstat -ano | findstr :8300 | findstr LISTENING >nul 2>&1
if %errorlevel% neq 0 (
timeout /t 1 /nobreak >nul
goto :wait_server
)

python wrapper.py opencode -- --dangerously-skip-permissions
if %errorlevel% neq 0 (
echo.
echo Agent exited unexpectedly. Check the output above.
pause
)
Loading