Lightweight desktop AI chat client built with Java 21, Swing, and Maven. Polished with FlatLaf and bundled IntelliJ themes. Chat transcripts can use native system WebViews via SwingWebView, Chromium through jcefmaven / JCEF, or a Swing fallback.
mvn clean compile
mvn exec:javamvn clean package
mvn testRun packaged jar:
java --enable-preview -jar target/chat4j-<version>.jar# Generate JaCoCo coverage report and enforce core non-UI coverage gates
mvn -Pcoverage verify
# Generate CycloneDX SBOM files in target/bom.xml and target/bom.json
mvn -Psbom verify
# Run OWASP Dependency-Check; fails on CVSS 7+
mvn -Pdependency-audit verify
# Check available dependency/plugin updates
mvn versions:display-dependency-updates versions:display-plugin-updatesDependabot is configured in .github/dependabot.yml for Maven and GitHub Actions updates. The scheduled Security Audit workflow runs OWASP Dependency-Check weekly and uploads HTML/JSON reports.
- Desktop chat UI (Swing + FlatLaf)
- Multi-provider model selection
- Streaming assistant responses
- Local history/settings persistence (SQLite by default, optional H2, Flyway migrations)
- Agent Mode with local workspace tools
ANTHROPIC_API_KEYGEMINI_API_KEY(alias:GOOGLEAI_API_KEY)OPENAI_API_KEYPERPLEXITY_API_KEYOPENROUTER_API_KEYGROQ_API_KEYDEEPSEEK_API_KEYMISTRAL_API_KEYXAI_API_KEY
Replace sk-... with your real API key. Restart Chat4J after changing environment variables.
For the current terminal session:
export OPENAI_API_KEY="sk-..."
mvn exec:javaTo make it persistent, add the export line to your shell profile:
# zsh, default on modern macOS
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.zshrc
# bash
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrcReload the profile or open a new terminal:
source ~/.zshrc # or: source ~/.bashrcOn macOS, apps launched from Finder/Dock may not inherit terminal variables. Chat4J tries to load your login shell environment, but if keys are still missing, either launch Chat4J from Terminal or set the variable for GUI apps:
launchctl setenv OPENAI_API_KEY "sk-..."For the current PowerShell session:
$env:OPENAI_API_KEY = "sk-..."
mvn exec:javaTo make it persistent for your Windows user account:
setx OPENAI_API_KEY "sk-..."Close and reopen PowerShell, Command Prompt, or Chat4J after running setx.
For the current Command Prompt session:
set OPENAI_API_KEY=sk-...
mvn exec:javaTo make it persistent:
setx OPENAI_API_KEY "sk-..."- OpenAI Codex
- GitHub Copilot
- LM Studio — OpenAI-compatible server at
http://localhost:1234/v1(no API key required) - Ollama — OpenAI-compatible endpoint at
http://localhost:11434/v1(no API key required)
- docs/README.md — full documentation index
Native installers are built with jpackage via Maven profiles.
Each profile must run on the target OS (cross-packaging is not supported).
Use OS-specific profiles:
# macOS (.dmg)
mvn -Pjpackage-mac verify
# Windows (.msi) — requires WiX Toolset 3.x
mvn -Pjpackage-win verify
# Linux (.deb) — requires dpkg
mvn -Pjpackage-linux verifyOutput artifacts are written to target/dist/.
GitHub Actions builds unsigned release artifacts for version tags and manual reruns:
git tag v26.6.13
git push origin v26.6.13The release workflow publishes the shaded jar, macOS .dmg, Windows .msi, Linux .deb, SBOM files, and SHA-256 checksums.
Apache License 2.0 — see LICENSE.
