Archon/README.md

1440 lines
39 KiB
Markdown
Raw Normal View History

2025-11-12 15:10:34 +00:00
# Dynamous Remote Coding Agent
2025-11-12 15:10:34 +00:00
Control AI coding assistants (Claude Code, Codex) remotely from Telegram, GitHub, and more. Built for developers who want to code from anywhere with persistent sessions and flexible workflows/systems.
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
**Quick Start:** [CLI Installation](#cli-installation) • [Server Setup](#server-quick-start) • [AI Assistant Setup](#2-ai-assistant-setup-choose-at-least-one) • [Platform Setup](#3-platform-adapter-setup-choose-at-least-one) • [Usage Guide](#usage)
## Features
- **Multi-Platform Support**: Interact via Telegram, Slack, Discord, GitHub issues/PRs, and more
2025-11-12 15:10:34 +00:00
- **Multiple AI Assistants**: Choose between Claude Code or Codex (or both)
- **Persistent Sessions**: Sessions survive container restarts with full context preservation
- **Codebase Management**: Clone and work with any GitHub repository
- **Flexible Streaming**: Real-time or batch message delivery per platform
- **Generic Command System**: User-defined commands versioned with Git
- **Docker Ready**: Simple deployment with Docker Compose
## CLI Usage
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
Archon CLI lets you run AI workflows directly from your terminal, without needing a server or messaging platform.
### Setup
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
**Step 1: Clone and install**
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
git clone https://github.com/dynamous-community/remote-coding-agent
cd remote-coding-agent
bun install
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
**Step 2: Make CLI globally available (optional but recommended)**
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
cd packages/cli
bun link
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
This creates an `archon` command available from anywhere on your system.
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
**Step 3: Authenticate with Claude**
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
claude /login
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
The CLI uses your existing Claude authentication.
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
**Step 4: Run workflows**
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
# If you ran bun link (recommended)
archon workflow list --cwd /path/to/your/repo
archon workflow run assist --cwd /path/to/your/repo "What does this codebase do?"
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
# Without bun link (from the repo directory)
bun run cli workflow list --cwd /path/to/your/repo
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
**Note:** Workflow and isolation commands must be run from within a git repository. Running from subdirectories works (resolves to repo root). Version and help commands work anywhere.
**Detailed documentation:** [CLI User Guide](docs/cli-user-guide.md)
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
---
## Prerequisites
2025-11-12 15:10:34 +00:00
**System Requirements:**
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
- Docker & Docker Compose (for server deployment)
- [Bun](https://bun.sh) 1.0+ (for local development)
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
**Platform Support:**
- **macOS**: Apple Silicon (M1/M2/M3) and Intel - fully supported
- **Linux**: x64 and ARM64 - fully supported
- **Windows**: Requires WSL2 (Windows Subsystem for Linux 2) - see [Windows Setup](#windows-wsl2-setup) below
2025-11-12 15:10:34 +00:00
**Accounts Required:**
- GitHub account (for repository cloning via `/clone` command)
- At least one of: Claude Pro/Max subscription OR Codex account
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
- At least one of: Telegram, Slack, Discord, or GitHub account (for server interaction)
2025-11-12 15:10:34 +00:00
---
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
## Server Quick Start
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
2026-01-17 11:33:35 +00:00
### Option 1: Docker (*Not working yet => works when repo goes public*)
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
```bash
# 1. Get the files
mkdir remote-agent && cd remote-agent
curl -fsSL https://raw.githubusercontent.com/dynamous-community/remote-coding-agent/main/deploy/docker-compose.yml -o docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/dynamous-community/remote-coding-agent/main/deploy/.env.example -o .env
# 2. Configure (edit .env with your tokens)
nano .env
# 3. Run
2026-01-17 11:33:35 +00:00
docker compose up -d --profile <yourprofile>
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
# 4. Check it's working
curl http://localhost:3000/health
```
### Option 2: Local Development
```bash
# 1. Clone and install
git clone https://github.com/dynamous-community/remote-coding-agent
cd remote-coding-agent
bun install
# 2. Configure
cp .env.example .env
nano .env # Add your tokens
# 3. Start database
docker compose --profile with-db up -d postgres
# 4. Run migrations
psql $DATABASE_URL < migrations/000_combined.sql
# 5. Start with hot reload
bun run dev
# 6. Validate setup
bun run validate
```
### Option 3: Self-Hosted Production
See [Cloud Deployment Guide](docs/cloud-deployment.md) for deploying to:
- DigitalOcean, Linode, AWS EC2, or any VPS
- With automatic HTTPS via Caddy
## Directory Structure
The app uses `~/.archon/` for all managed files:
```
~/.archon/
Fix stale workspace: sync before worktree creation (#287) * Investigate issue #285: stale workspace causes outdated worktrees Analyzed root cause and created implementation plan for fixing the workspace sync issue where new worktrees are created from outdated code after PRs are merged. * Fix stale workspace: sync before worktree creation When a PR is merged, subsequent worktrees were created from outdated code because the workspace was never synced after the initial clone. Changes: - Add syncWorkspace() and getDefaultBranch() helpers in git.ts - Call syncWorkspaceBeforeCreate() in WorktreeProvider before creating new worktrees - Make sync non-fatal to handle offline/permission edge cases gracefully The sync happens at the natural boundary of starting new work, ensuring new issues/PRs always start from the latest code without disrupting existing in-progress worktrees. Fixes #285 * Address PR review feedback: data safety and test coverage - Add uncommitted changes check in syncWorkspace() before git reset --hard to prevent accidental data loss (returns false if changes detected) - Add logging to getDefaultBranch() fallback paths for better debugging when symbolic-ref fails and fallback to main/master is used - Add integration tests verifying sync is called during worktree creation - Add tests for sync failure scenarios (non-fatal behavior) - Add test for checkout failure in syncWorkspace() - Update worktree.ts to handle new boolean return from syncWorkspace() * simplify: flatten getDefaultBranch fallback logic Remove verbose logging in getDefaultBranch function. The fallback from symbolic-ref to checking origin/main to defaulting to master is expected behavior that doesn't need logging at the info level. Flatten nested try-catch into sequential blocks for better readability. * docs: document workspace sync behavior before worktree creation * Address PR review feedback: error handling and test coverage - Add logging to empty catch blocks in getDefaultBranch() (critical) - Add operation context to syncWorkspace() error messages - Differentiate error severity in syncWorkspaceBeforeCreate(): - Permission errors and corruption logged at ERROR level - Network/timeout errors logged at WARN level - Update syncWorkspace JSDoc with reset --hard warning - Remove redundant inline comment before sync call - Add tests for: - Non-standard branch names (develop, trunk) - Timeout parameter verification - Operation context in error messages - Sync skipped when adopting existing worktree
2026-01-19 11:07:56 +00:00
├── workspaces/ # Cloned repositories (auto-synced before worktree creation)
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
├── worktrees/ # Git worktrees for isolation
feat: Phase 3 - Database abstraction layer and CLI isolation (#314) * feat: Phase 3 - Database abstraction layer and CLI isolation Part A: Database Abstraction Layer - Add IDatabase interface supporting PostgreSQL and SQLite - Create PostgresAdapter wrapping pg Pool with same interface - Create SqliteAdapter using bun:sqlite with auto-schema init - Add SqlDialect helpers for database-specific SQL generation - Update connection.ts with auto-detection (DATABASE_URL → Postgres, else SQLite) - Update isolation-environments.ts to use dialect helpers - CLI now works without DATABASE_URL (uses ~/.archon/archon.db) Part B: CLI Isolation Integration - Add --branch/-b flag to create/reuse worktrees for workflows - Add --no-worktree flag to run on branch directly without isolation - Add isolation list command to show all active worktrees - Add isolation cleanup command to remove stale environments - Auto-register codebase when using --branch from git repo New git utilities: - findRepoRoot: Find git repository root from any path - getRemoteUrl: Get origin remote URL - checkout: Checkout branch (creating if needed) * docs: Update documentation for Phase 3 - SQLite support and CLI isolation * fix: Address all PR review issues for database abstraction Critical fixes: - Use dialect helpers (now(), jsonMerge, jsonArrayContains) in all DB operations - Replace hardcoded PostgreSQL NOW(), ::jsonb, and JSON operators - Add rowCount validation to updateStatus() and updateMetadata() - Improve PostgreSQL pool error logging with structured context Important fixes: - Add explicit null check in getDialect() instead of non-null assertion - Add warning for unsupported UPDATE/DELETE RETURNING in SQLite - Throw error in extractTableName() on parse failure instead of empty string - Track codebaseLookupError to provide clearer errors when --branch fails - Couple IDatabase with SqlDialect via readonly sql property Code simplifications: - Extract loadWorkflows() helper to DRY duplicate error handling - Fix N+1 query in getCodebases() by including repository_url in JOIN - Cache sql.toUpperCase() to avoid redundant calls All changes verified with: - Type-check passes - All 1082 tests pass - CLI commands tested with both SQLite and PostgreSQL * docs: Add SQLite support to getting-started, configuration, and architecture guides * refactor: Simplify Phase 3 code for clarity and maintainability - sqlite.ts: Remove unused UPDATE branch from extractTableName, consolidate RETURNING clause handling into single condition - isolation.ts: Extract CodebaseInfo interface to reduce type duplication - workflow.ts: Extract actualBranchName variable for clearer intent - isolation-environments.ts: Rename variables for semantic clarity (staleActivityThreshold/staleCreationThreshold vs nowMinusDays1/2) * fix: Address all remaining PR review issues - SQLite: Throw error for UPDATE/DELETE RETURNING instead of warning - SQLite: Replace deprecated db.exec() with db.run() - Worktree: Throw for fatal errors (permission denied, not a git repo) - Types: Add import type for type-only imports in 4 db modules - Codebases: Add null check validation to createCodebase return - WorkflowRunOptions: Add JSDoc documenting constraint behavior - QueryResult: Add comment noting fields should be treated as readonly - Connection: Improve getDialect() error message with actionable details * fix: Complete type safety improvements for Phase 3 - QueryResult: Make rows and rowCount readonly to prevent mutation - WorkflowRunOptions: Use discriminated union to prevent invalid states (noWorktree can only be set when branchName is provided) - Update all database functions to return readonly arrays - Fix CLI call site to properly construct options object * fix: Add getDialect mock to database tests Tests were failing because they expected hardcoded PostgreSQL SQL (NOW(), metadata || $1::jsonb) but the code now uses dialect helpers. - Add mockPostgresDialect to test/mocks/database.ts - Update all db test files to mock getDialect() returning PostgreSQL dialect - Tests now properly verify the SQL generated by dialect helpers
2026-01-21 08:38:57 +00:00
├── archon.db # SQLite database (when DATABASE_URL not set)
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
└── config.yaml # Optional: global configuration
```
On Windows: `C:\Users\<username>\.archon\`
In Docker: `/.archon/`
See [Configuration Guide](docs/configuration.md) for customization options.
2025-11-12 15:51:46 +00:00
---
2025-11-12 15:10:34 +00:00
## Setup Guide
2025-11-15 14:36:33 +00:00
**Get started:**
```bash
git clone https://github.com/dynamous-community/remote-coding-agent
cd remote-coding-agent
bun install
2025-11-15 14:36:33 +00:00
```
2025-11-12 15:10:34 +00:00
### 1. Core Configuration (Required)
2025-11-12 15:10:34 +00:00
**Create environment file:**
```bash
cp .env.example .env
```
2025-11-12 15:10:34 +00:00
**Set these required variables:**
2025-11-12 15:10:34 +00:00
| Variable | Purpose | How to Get |
|----------|---------|------------|
feat: Phase 3 - Database abstraction layer and CLI isolation (#314) * feat: Phase 3 - Database abstraction layer and CLI isolation Part A: Database Abstraction Layer - Add IDatabase interface supporting PostgreSQL and SQLite - Create PostgresAdapter wrapping pg Pool with same interface - Create SqliteAdapter using bun:sqlite with auto-schema init - Add SqlDialect helpers for database-specific SQL generation - Update connection.ts with auto-detection (DATABASE_URL → Postgres, else SQLite) - Update isolation-environments.ts to use dialect helpers - CLI now works without DATABASE_URL (uses ~/.archon/archon.db) Part B: CLI Isolation Integration - Add --branch/-b flag to create/reuse worktrees for workflows - Add --no-worktree flag to run on branch directly without isolation - Add isolation list command to show all active worktrees - Add isolation cleanup command to remove stale environments - Auto-register codebase when using --branch from git repo New git utilities: - findRepoRoot: Find git repository root from any path - getRemoteUrl: Get origin remote URL - checkout: Checkout branch (creating if needed) * docs: Update documentation for Phase 3 - SQLite support and CLI isolation * fix: Address all PR review issues for database abstraction Critical fixes: - Use dialect helpers (now(), jsonMerge, jsonArrayContains) in all DB operations - Replace hardcoded PostgreSQL NOW(), ::jsonb, and JSON operators - Add rowCount validation to updateStatus() and updateMetadata() - Improve PostgreSQL pool error logging with structured context Important fixes: - Add explicit null check in getDialect() instead of non-null assertion - Add warning for unsupported UPDATE/DELETE RETURNING in SQLite - Throw error in extractTableName() on parse failure instead of empty string - Track codebaseLookupError to provide clearer errors when --branch fails - Couple IDatabase with SqlDialect via readonly sql property Code simplifications: - Extract loadWorkflows() helper to DRY duplicate error handling - Fix N+1 query in getCodebases() by including repository_url in JOIN - Cache sql.toUpperCase() to avoid redundant calls All changes verified with: - Type-check passes - All 1082 tests pass - CLI commands tested with both SQLite and PostgreSQL * docs: Add SQLite support to getting-started, configuration, and architecture guides * refactor: Simplify Phase 3 code for clarity and maintainability - sqlite.ts: Remove unused UPDATE branch from extractTableName, consolidate RETURNING clause handling into single condition - isolation.ts: Extract CodebaseInfo interface to reduce type duplication - workflow.ts: Extract actualBranchName variable for clearer intent - isolation-environments.ts: Rename variables for semantic clarity (staleActivityThreshold/staleCreationThreshold vs nowMinusDays1/2) * fix: Address all remaining PR review issues - SQLite: Throw error for UPDATE/DELETE RETURNING instead of warning - SQLite: Replace deprecated db.exec() with db.run() - Worktree: Throw for fatal errors (permission denied, not a git repo) - Types: Add import type for type-only imports in 4 db modules - Codebases: Add null check validation to createCodebase return - WorkflowRunOptions: Add JSDoc documenting constraint behavior - QueryResult: Add comment noting fields should be treated as readonly - Connection: Improve getDialect() error message with actionable details * fix: Complete type safety improvements for Phase 3 - QueryResult: Make rows and rowCount readonly to prevent mutation - WorkflowRunOptions: Use discriminated union to prevent invalid states (noWorktree can only be set when branchName is provided) - Update all database functions to return readonly arrays - Fix CLI call site to properly construct options object * fix: Add getDialect mock to database tests Tests were failing because they expected hardcoded PostgreSQL SQL (NOW(), metadata || $1::jsonb) but the code now uses dialect helpers. - Add mockPostgresDialect to test/mocks/database.ts - Update all db test files to mock getDialect() returning PostgreSQL dialect - Tests now properly verify the SQL generated by dialect helpers
2026-01-21 08:38:57 +00:00
| `DATABASE_URL` | PostgreSQL connection (optional) | See database options below. Omit to use SQLite |
2025-11-12 15:10:34 +00:00
| `GH_TOKEN` | Repository cloning | [Generate token](https://github.com/settings/tokens) with `repo` scope |
| `GITHUB_TOKEN` | Same as `GH_TOKEN` | Use same token value |
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
| `PORT` | HTTP server port | Default: `3090` (optional) |
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
| `ARCHON_HOME` | (Optional) Override base directory | Default: `~/.archon` |
2025-11-12 15:10:34 +00:00
**GitHub Personal Access Token Setup:**
1. Visit [GitHub Settings > Personal Access Tokens](https://github.com/settings/tokens)
2025-11-12 15:51:46 +00:00
2. Click "Generate new token (classic)" → Select scope: **`repo`**
3. Copy token (starts with `ghp_...`) and set both variables:
2025-11-12 15:10:34 +00:00
```env
# .env
GH_TOKEN=ghp_your_token_here
GITHUB_TOKEN=ghp_your_token_here # Same value
```
Add Archon distribution config and directory structure (#101) * Add Archon distribution config and directory structure - Create centralized path resolution in src/utils/archon-paths.ts - Add YAML configuration system (src/config/) with layered loading - Update Dockerfile and docker-compose for /.archon/ directory - Add GHCR publish workflow for multi-arch Docker builds - Create deploy/ directory with end-user docker-compose - Add /init command to create .archon structure in repos - Add docs/configuration.md reference guide - Update README with Quick Start section - Add bun run validate script - Update tests for new path defaults (~/.archon/) Directory structure: - Local: ~/.archon/{workspaces,worktrees,config.yaml} - Docker: /.archon/{workspaces,worktrees} - Repo: .archon/{commands,workflows,config.yaml} Legacy WORKSPACE_PATH and WORKTREE_BASE env vars still supported. * Complete Archon distribution config implementation - Wire up config system in src/index.ts (Task 3.5) - Remove legacy WORKSPACE_PATH and WORKTREE_BASE support - Add logConfig() function to config-loader.ts - Update docker-compose.yml to use ARCHON_DOCKER env var - Remove legacy env vars from .env.example - Update all documentation to reference ARCHON_HOME - Create scripts/validate-setup.sh for setup validation - Add setup:check script to package.json - Create docs/getting-started.md guide - Create docs/archon-architecture.md technical docs - Update tests to use ARCHON_HOME instead of legacy vars - Fix validate.md command template for new paths All plan phases now complete: - Phase 1: Archon Directory Structure - Phase 2: Docker Distribution - Phase 3: YAML Configuration System - Phase 4: Developer Experience - Phase 5: Documentation
2025-12-17 19:45:41 +00:00
**Note:** Repository clones are stored in `~/.archon/workspaces/` by default (or `/.archon/workspaces/` in Docker). Set `ARCHON_HOME` to override the base directory.
2025-11-12 15:10:34 +00:00
**Database Setup - Choose One:**
2025-11-12 15:10:34 +00:00
<details>
feat: Phase 3 - Database abstraction layer and CLI isolation (#314) * feat: Phase 3 - Database abstraction layer and CLI isolation Part A: Database Abstraction Layer - Add IDatabase interface supporting PostgreSQL and SQLite - Create PostgresAdapter wrapping pg Pool with same interface - Create SqliteAdapter using bun:sqlite with auto-schema init - Add SqlDialect helpers for database-specific SQL generation - Update connection.ts with auto-detection (DATABASE_URL → Postgres, else SQLite) - Update isolation-environments.ts to use dialect helpers - CLI now works without DATABASE_URL (uses ~/.archon/archon.db) Part B: CLI Isolation Integration - Add --branch/-b flag to create/reuse worktrees for workflows - Add --no-worktree flag to run on branch directly without isolation - Add isolation list command to show all active worktrees - Add isolation cleanup command to remove stale environments - Auto-register codebase when using --branch from git repo New git utilities: - findRepoRoot: Find git repository root from any path - getRemoteUrl: Get origin remote URL - checkout: Checkout branch (creating if needed) * docs: Update documentation for Phase 3 - SQLite support and CLI isolation * fix: Address all PR review issues for database abstraction Critical fixes: - Use dialect helpers (now(), jsonMerge, jsonArrayContains) in all DB operations - Replace hardcoded PostgreSQL NOW(), ::jsonb, and JSON operators - Add rowCount validation to updateStatus() and updateMetadata() - Improve PostgreSQL pool error logging with structured context Important fixes: - Add explicit null check in getDialect() instead of non-null assertion - Add warning for unsupported UPDATE/DELETE RETURNING in SQLite - Throw error in extractTableName() on parse failure instead of empty string - Track codebaseLookupError to provide clearer errors when --branch fails - Couple IDatabase with SqlDialect via readonly sql property Code simplifications: - Extract loadWorkflows() helper to DRY duplicate error handling - Fix N+1 query in getCodebases() by including repository_url in JOIN - Cache sql.toUpperCase() to avoid redundant calls All changes verified with: - Type-check passes - All 1082 tests pass - CLI commands tested with both SQLite and PostgreSQL * docs: Add SQLite support to getting-started, configuration, and architecture guides * refactor: Simplify Phase 3 code for clarity and maintainability - sqlite.ts: Remove unused UPDATE branch from extractTableName, consolidate RETURNING clause handling into single condition - isolation.ts: Extract CodebaseInfo interface to reduce type duplication - workflow.ts: Extract actualBranchName variable for clearer intent - isolation-environments.ts: Rename variables for semantic clarity (staleActivityThreshold/staleCreationThreshold vs nowMinusDays1/2) * fix: Address all remaining PR review issues - SQLite: Throw error for UPDATE/DELETE RETURNING instead of warning - SQLite: Replace deprecated db.exec() with db.run() - Worktree: Throw for fatal errors (permission denied, not a git repo) - Types: Add import type for type-only imports in 4 db modules - Codebases: Add null check validation to createCodebase return - WorkflowRunOptions: Add JSDoc documenting constraint behavior - QueryResult: Add comment noting fields should be treated as readonly - Connection: Improve getDialect() error message with actionable details * fix: Complete type safety improvements for Phase 3 - QueryResult: Make rows and rowCount readonly to prevent mutation - WorkflowRunOptions: Use discriminated union to prevent invalid states (noWorktree can only be set when branchName is provided) - Update all database functions to return readonly arrays - Fix CLI call site to properly construct options object * fix: Add getDialect mock to database tests Tests were failing because they expected hardcoded PostgreSQL SQL (NOW(), metadata || $1::jsonb) but the code now uses dialect helpers. - Add mockPostgresDialect to test/mocks/database.ts - Update all db test files to mock getDialect() returning PostgreSQL dialect - Tests now properly verify the SQL generated by dialect helpers
2026-01-21 08:38:57 +00:00
<summary><b>Option A: SQLite (Default - No Setup Required)</b></summary>
Simply **omit the `DATABASE_URL` variable** from your `.env` file. The app will automatically:
- Create a SQLite database at `~/.archon/archon.db`
- Initialize the schema on first run
- Use this database for all operations
**Pros:**
- Zero configuration required
- No external database needed
- Perfect for single-user CLI usage
**Cons:**
- Not suitable for multi-container deployments
- No network access (CLI and server can't share database across different hosts)
</details>
<details>
<summary><b>Option B: Remote PostgreSQL (Supabase, Neon)</b></summary>
2025-11-12 15:10:34 +00:00
Set your remote connection string:
2025-11-12 15:10:34 +00:00
```env
DATABASE_URL=postgresql://user:password@host:5432/dbname
```
2025-11-12 05:06:29 +00:00
**For fresh installations**, run the combined migration:
2025-11-12 05:06:29 +00:00
```bash
psql $DATABASE_URL < migrations/000_combined.sql
2025-11-12 15:10:34 +00:00
```
2025-11-12 05:06:29 +00:00
This creates 5 tables:
2025-11-12 15:10:34 +00:00
- `remote_agent_codebases` - Repository metadata
- `remote_agent_conversations` - Platform conversation tracking
- `remote_agent_sessions` - AI session management
- `remote_agent_command_templates` - Global command templates
- `remote_agent_isolation_environments` - Worktree isolation tracking
**For updates to existing installations**, run only the migrations you haven't applied yet:
```bash
# Check which migrations you've already run, then apply new ones:
psql $DATABASE_URL < migrations/002_command_templates.sql
psql $DATABASE_URL < migrations/003_add_worktree.sql
psql $DATABASE_URL < migrations/004_worktree_sharing.sql
psql $DATABASE_URL < migrations/006_isolation_environments.sql
psql $DATABASE_URL < migrations/007_drop_legacy_columns.sql
```
2025-11-12 05:06:29 +00:00
2025-11-12 15:10:34 +00:00
</details>
<details>
feat: Phase 3 - Database abstraction layer and CLI isolation (#314) * feat: Phase 3 - Database abstraction layer and CLI isolation Part A: Database Abstraction Layer - Add IDatabase interface supporting PostgreSQL and SQLite - Create PostgresAdapter wrapping pg Pool with same interface - Create SqliteAdapter using bun:sqlite with auto-schema init - Add SqlDialect helpers for database-specific SQL generation - Update connection.ts with auto-detection (DATABASE_URL → Postgres, else SQLite) - Update isolation-environments.ts to use dialect helpers - CLI now works without DATABASE_URL (uses ~/.archon/archon.db) Part B: CLI Isolation Integration - Add --branch/-b flag to create/reuse worktrees for workflows - Add --no-worktree flag to run on branch directly without isolation - Add isolation list command to show all active worktrees - Add isolation cleanup command to remove stale environments - Auto-register codebase when using --branch from git repo New git utilities: - findRepoRoot: Find git repository root from any path - getRemoteUrl: Get origin remote URL - checkout: Checkout branch (creating if needed) * docs: Update documentation for Phase 3 - SQLite support and CLI isolation * fix: Address all PR review issues for database abstraction Critical fixes: - Use dialect helpers (now(), jsonMerge, jsonArrayContains) in all DB operations - Replace hardcoded PostgreSQL NOW(), ::jsonb, and JSON operators - Add rowCount validation to updateStatus() and updateMetadata() - Improve PostgreSQL pool error logging with structured context Important fixes: - Add explicit null check in getDialect() instead of non-null assertion - Add warning for unsupported UPDATE/DELETE RETURNING in SQLite - Throw error in extractTableName() on parse failure instead of empty string - Track codebaseLookupError to provide clearer errors when --branch fails - Couple IDatabase with SqlDialect via readonly sql property Code simplifications: - Extract loadWorkflows() helper to DRY duplicate error handling - Fix N+1 query in getCodebases() by including repository_url in JOIN - Cache sql.toUpperCase() to avoid redundant calls All changes verified with: - Type-check passes - All 1082 tests pass - CLI commands tested with both SQLite and PostgreSQL * docs: Add SQLite support to getting-started, configuration, and architecture guides * refactor: Simplify Phase 3 code for clarity and maintainability - sqlite.ts: Remove unused UPDATE branch from extractTableName, consolidate RETURNING clause handling into single condition - isolation.ts: Extract CodebaseInfo interface to reduce type duplication - workflow.ts: Extract actualBranchName variable for clearer intent - isolation-environments.ts: Rename variables for semantic clarity (staleActivityThreshold/staleCreationThreshold vs nowMinusDays1/2) * fix: Address all remaining PR review issues - SQLite: Throw error for UPDATE/DELETE RETURNING instead of warning - SQLite: Replace deprecated db.exec() with db.run() - Worktree: Throw for fatal errors (permission denied, not a git repo) - Types: Add import type for type-only imports in 4 db modules - Codebases: Add null check validation to createCodebase return - WorkflowRunOptions: Add JSDoc documenting constraint behavior - QueryResult: Add comment noting fields should be treated as readonly - Connection: Improve getDialect() error message with actionable details * fix: Complete type safety improvements for Phase 3 - QueryResult: Make rows and rowCount readonly to prevent mutation - WorkflowRunOptions: Use discriminated union to prevent invalid states (noWorktree can only be set when branchName is provided) - Update all database functions to return readonly arrays - Fix CLI call site to properly construct options object * fix: Add getDialect mock to database tests Tests were failing because they expected hardcoded PostgreSQL SQL (NOW(), metadata || $1::jsonb) but the code now uses dialect helpers. - Add mockPostgresDialect to test/mocks/database.ts - Update all db test files to mock getDialect() returning PostgreSQL dialect - Tests now properly verify the SQL generated by dialect helpers
2026-01-21 08:38:57 +00:00
<summary><b>Option C: Local PostgreSQL (via Docker)</b></summary>
2025-11-12 15:10:34 +00:00
Use the `with-db` profile for automatic PostgreSQL setup:
2025-11-12 05:06:29 +00:00
2025-11-12 15:10:34 +00:00
```env
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/remote_coding_agent
2025-11-12 05:06:29 +00:00
```
**For fresh installations**, database schema is created automatically when you start with `docker compose --profile with-db`. The combined migration runs on first startup.
**For updates to existing Docker installations**, you need to manually run new migrations:
```bash
# Connect to the running postgres container
docker compose exec postgres psql -U postgres -d remote_coding_agent
# Then run the migrations you haven't applied yet
\i /migrations/002_command_templates.sql
\i /migrations/003_add_worktree.sql
\i /migrations/004_worktree_sharing.sql
\i /migrations/006_isolation_environments.sql
\i /migrations/007_drop_legacy_columns.sql
\q
```
Or from your host machine (requires `psql` installed):
```bash
psql postgresql://postgres:postgres@localhost:5432/remote_coding_agent < migrations/002_command_templates.sql
psql postgresql://postgres:postgres@localhost:5432/remote_coding_agent < migrations/003_add_worktree.sql
psql postgresql://postgres:postgres@localhost:5432/remote_coding_agent < migrations/004_worktree_sharing.sql
psql postgresql://postgres:postgres@localhost:5432/remote_coding_agent < migrations/006_isolation_environments.sql
psql postgresql://postgres:postgres@localhost:5432/remote_coding_agent < migrations/007_drop_legacy_columns.sql
```
2025-11-12 15:10:34 +00:00
</details>
---
2025-11-12 05:06:29 +00:00
2025-11-12 15:10:34 +00:00
### 2. AI Assistant Setup (Choose At Least One)
2025-11-12 05:06:29 +00:00
2025-11-12 15:10:34 +00:00
You must configure **at least one** AI assistant. Both can be configured if desired.
<details>
<summary><b>🤖 Claude Code</b></summary>
**Recommended for Claude Pro/Max subscribers.**
fix: Auto-detect Claude auth when CLAUDE_USE_GLOBAL_AUTH not set (#236) * fix: Auto-detect Claude auth when CLAUDE_USE_GLOBAL_AUTH not set Previously, if CLAUDE_USE_GLOBAL_AUTH was not explicitly set, the code defaulted to filtering out auth tokens. This broke backwards compatibility for users who had explicit tokens in their .env files. New behavior: - CLAUDE_USE_GLOBAL_AUTH=true: Filter tokens, use global auth - CLAUDE_USE_GLOBAL_AUTH=false: Use explicit tokens from env - Not set: Auto-detect - if tokens exist in env, use them This ensures existing deployments with tokens in .env continue to work without requiring configuration changes. * docs: Document auto-detect behavior for Claude authentication Updated documentation to reflect the new three-way authentication behavior: - CLAUDE_USE_GLOBAL_AUTH=true: Use global auth from claude /login - CLAUDE_USE_GLOBAL_AUTH=false: Use explicit tokens from env - Not set: Auto-detect (use tokens if present, otherwise global auth) This ensures users understand the backwards-compatible auto-detect feature that prevents breaking existing deployments with explicit tokens. * fix: Add comprehensive logging for Claude auth detection - Log confirmation for explicit CLAUDE_USE_GLOBAL_AUTH=true/false settings - Log when auto-detect falls back to global auth (no tokens found) - Warn about empty string token values (common misconfiguration) - Warn about unrecognized boolean values (e.g., 'yes', '1') This makes debugging auth issues straightforward by logging every path. --------- Co-authored-by: Rasmus Widing <rasmus.widing@gmail.com>
2026-01-17 19:46:01 +00:00
**Authentication Options:**
Claude Code supports three authentication modes via `CLAUDE_USE_GLOBAL_AUTH`:
fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication (#228) * fix: Remove Claude credentials from .env.example Claude Code uses global auth from `claude /login`, not project .env files. Having tokens in .env.example caused Bun to auto-load them in worktrees, overriding valid user credentials and causing auth failures. - Comment out CLAUDE_CODE_OAUTH_TOKEN placeholder - Comment out CLAUDE_API_KEY placeholder - Add note explaining why these should not be set * fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication Bun auto-loads .env files from the working directory, which caused issues when worktrees contained CLAUDE_CODE_OAUTH_TOKEN - the invalid token would override the user's valid global auth from `claude /login`. Changes: - Add CLAUDE_USE_GLOBAL_AUTH=true option to bypass credential check - Update .env.example to use global auth by default (recommended) - Remove explicit Claude tokens from .env.example template This allows the Claude Code SDK to use its built-in OAuth authentication instead of requiring explicit tokens in environment variables. For Docker/VPS deployments, users can still set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY explicitly via environment variables at runtime. Related: #227 * chore: Upgrade Claude Agent SDK to 0.2.7 Fixes hanging issue when running Claude Code in worktrees with settingSources: ["project"]. The previous version (0.1.57/0.1.69) would hang indefinitely when loading project settings. * docs: Add CLAUDE_USE_GLOBAL_AUTH to documentation Update CLAUDE.md and README.md to document the new recommended authentication method using global auth from `claude /login`. - CLAUDE.md: Updated Environment Variables section - README.md: Restructured Claude Code section with 3 options This addresses the documentation gaps identified in PR review.
2026-01-14 11:55:53 +00:00
fix: Auto-detect Claude auth when CLAUDE_USE_GLOBAL_AUTH not set (#236) * fix: Auto-detect Claude auth when CLAUDE_USE_GLOBAL_AUTH not set Previously, if CLAUDE_USE_GLOBAL_AUTH was not explicitly set, the code defaulted to filtering out auth tokens. This broke backwards compatibility for users who had explicit tokens in their .env files. New behavior: - CLAUDE_USE_GLOBAL_AUTH=true: Filter tokens, use global auth - CLAUDE_USE_GLOBAL_AUTH=false: Use explicit tokens from env - Not set: Auto-detect - if tokens exist in env, use them This ensures existing deployments with tokens in .env continue to work without requiring configuration changes. * docs: Document auto-detect behavior for Claude authentication Updated documentation to reflect the new three-way authentication behavior: - CLAUDE_USE_GLOBAL_AUTH=true: Use global auth from claude /login - CLAUDE_USE_GLOBAL_AUTH=false: Use explicit tokens from env - Not set: Auto-detect (use tokens if present, otherwise global auth) This ensures users understand the backwards-compatible auto-detect feature that prevents breaking existing deployments with explicit tokens. * fix: Add comprehensive logging for Claude auth detection - Log confirmation for explicit CLAUDE_USE_GLOBAL_AUTH=true/false settings - Log when auto-detect falls back to global auth (no tokens found) - Warn about empty string token values (common misconfiguration) - Warn about unrecognized boolean values (e.g., 'yes', '1') This makes debugging auth issues straightforward by logging every path. --------- Co-authored-by: Rasmus Widing <rasmus.widing@gmail.com>
2026-01-17 19:46:01 +00:00
1. **Global Auth** (set to `true`): Uses credentials from `claude /login`
2. **Explicit Tokens** (set to `false`): Uses tokens from env vars below
3. **Auto-Detect** (not set): Uses tokens if present in env, otherwise global auth
**Option 1: Global Auth (Recommended)**
fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication (#228) * fix: Remove Claude credentials from .env.example Claude Code uses global auth from `claude /login`, not project .env files. Having tokens in .env.example caused Bun to auto-load them in worktrees, overriding valid user credentials and causing auth failures. - Comment out CLAUDE_CODE_OAUTH_TOKEN placeholder - Comment out CLAUDE_API_KEY placeholder - Add note explaining why these should not be set * fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication Bun auto-loads .env files from the working directory, which caused issues when worktrees contained CLAUDE_CODE_OAUTH_TOKEN - the invalid token would override the user's valid global auth from `claude /login`. Changes: - Add CLAUDE_USE_GLOBAL_AUTH=true option to bypass credential check - Update .env.example to use global auth by default (recommended) - Remove explicit Claude tokens from .env.example template This allows the Claude Code SDK to use its built-in OAuth authentication instead of requiring explicit tokens in environment variables. For Docker/VPS deployments, users can still set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY explicitly via environment variables at runtime. Related: #227 * chore: Upgrade Claude Agent SDK to 0.2.7 Fixes hanging issue when running Claude Code in worktrees with settingSources: ["project"]. The previous version (0.1.57/0.1.69) would hang indefinitely when loading project settings. * docs: Add CLAUDE_USE_GLOBAL_AUTH to documentation Update CLAUDE.md and README.md to document the new recommended authentication method using global auth from `claude /login`. - CLAUDE.md: Updated Environment Variables section - README.md: Restructured Claude Code section with 3 options This addresses the documentation gaps identified in PR review.
2026-01-14 11:55:53 +00:00
```env
CLAUDE_USE_GLOBAL_AUTH=true
```
**Option 2: OAuth Token**
```bash
2025-11-12 15:10:34 +00:00
# Install Claude Code CLI first: https://docs.claude.com/claude-code/installation
claude setup-token
2025-11-12 15:10:34 +00:00
# Copy the token starting with sk-ant-oat01-...
```
```env
2025-11-12 15:10:34 +00:00
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-xxxxx
```
fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication (#228) * fix: Remove Claude credentials from .env.example Claude Code uses global auth from `claude /login`, not project .env files. Having tokens in .env.example caused Bun to auto-load them in worktrees, overriding valid user credentials and causing auth failures. - Comment out CLAUDE_CODE_OAUTH_TOKEN placeholder - Comment out CLAUDE_API_KEY placeholder - Add note explaining why these should not be set * fix: Add CLAUDE_USE_GLOBAL_AUTH for SDK built-in authentication Bun auto-loads .env files from the working directory, which caused issues when worktrees contained CLAUDE_CODE_OAUTH_TOKEN - the invalid token would override the user's valid global auth from `claude /login`. Changes: - Add CLAUDE_USE_GLOBAL_AUTH=true option to bypass credential check - Update .env.example to use global auth by default (recommended) - Remove explicit Claude tokens from .env.example template This allows the Claude Code SDK to use its built-in OAuth authentication instead of requiring explicit tokens in environment variables. For Docker/VPS deployments, users can still set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY explicitly via environment variables at runtime. Related: #227 * chore: Upgrade Claude Agent SDK to 0.2.7 Fixes hanging issue when running Claude Code in worktrees with settingSources: ["project"]. The previous version (0.1.57/0.1.69) would hang indefinitely when loading project settings. * docs: Add CLAUDE_USE_GLOBAL_AUTH to documentation Update CLAUDE.md and README.md to document the new recommended authentication method using global auth from `claude /login`. - CLAUDE.md: Updated Environment Variables section - README.md: Restructured Claude Code section with 3 options This addresses the documentation gaps identified in PR review.
2026-01-14 11:55:53 +00:00
**Option 3: API Key (Pay-per-use)**
2025-11-12 15:10:34 +00:00
1. Visit [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys)
2. Create a new key (starts with `sk-ant-`)
2025-11-12 15:10:34 +00:00
```env
CLAUDE_API_KEY=sk-ant-xxxxx
```
2025-11-12 15:10:34 +00:00
**Set as default assistant (optional):**
2025-11-12 15:10:34 +00:00
If you want Claude to be the default AI assistant for new conversations without codebase context, set this environment variable:
2025-11-12 15:10:34 +00:00
```env
DEFAULT_AI_ASSISTANT=claude
```
2025-11-12 15:10:34 +00:00
</details>
2025-11-12 15:10:34 +00:00
<details>
<summary><b>🤖 Codex</b></summary>
2025-11-12 15:10:34 +00:00
**Authenticate with Codex CLI:**
```bash
2025-11-12 15:10:34 +00:00
# Install Codex CLI first: https://docs.codex.com/installation
codex login
# Follow browser authentication flow
```
2025-11-12 15:10:34 +00:00
**Extract credentials from auth file:**
2025-11-12 15:10:34 +00:00
On Linux/Mac:
```bash
2025-11-12 15:10:34 +00:00
cat ~/.codex/auth.json
```
2025-11-12 15:10:34 +00:00
On Windows:
```cmd
type %USERPROFILE%\.codex\auth.json
```
2025-11-12 15:10:34 +00:00
**Set all four environment variables:**
2025-11-12 15:10:34 +00:00
```env
CODEX_ID_TOKEN=eyJhbGc...
CODEX_ACCESS_TOKEN=eyJhbGc...
CODEX_REFRESH_TOKEN=rt_...
CODEX_ACCOUNT_ID=6a6a7ba6-...
```
2025-11-12 15:10:34 +00:00
**Set as default assistant (optional):**
2025-11-12 15:10:34 +00:00
If you want Codex to be the default AI assistant for new conversations without codebase context, set this environment variable:
```env
DEFAULT_AI_ASSISTANT=codex
```
2025-11-12 15:10:34 +00:00
</details>
2025-11-12 15:10:34 +00:00
**How Assistant Selection Works:**
feat: Add Ralph-style autonomous iteration loops to workflow engine (#168) * Fix outdated command loading documentation * feat: Add Ralph-style autonomous iteration loops to workflow engine Enable workflows to iterate autonomously until a completion signal is detected (e.g., `<promise>COMPLETE</promise>`) or max iterations reached. Changes: - Add LoopConfig type with until signal, max_iterations, fresh_context - Extend WorkflowDefinition to support loop + prompt (mutually exclusive with steps) - Add executeLoopWorkflow function with completion signal detection - Update loader to parse and validate loop configuration - Add ralph.yaml example workflow demonstrating PRD implementation pattern - Add 22 new tests covering loop execution and parsing Loop workflows allow developers to run long-running tasks (like PRD implementation) without manual phase transitions, following the pattern popularized by Geoffrey Huntley. * Add test-loop workflow for Ralph loop testing * feat: Update worktree config to copy .archon files - Include all .archon files in worktree copy (not just .archon/ralph) - Update ralph.yaml with dynamic path detection for feature directories - Add PR creation step at completion - Use {prd-dir} variable for flexible path handling * feat: Add ralph-prd command for generating PRD files Creates structured PRD files for Ralph autonomous loops: - Outputs to .archon/ralph/{feature-slug}/ directory - Generates prd.md (full context) and prd.json (story tracking) - Feature-based naming to avoid conflicts between projects - Guides user through requirements gathering phases * feat: Add ralph-fresh workflow with fresh_context: true Fresh context mode for Ralph loops where each iteration: - Starts with a clean slate (no memory of previous iterations) - Re-reads progress.txt, prd.json, prd.md to understand current state - Relies on progress.txt "Codebase Patterns" section for learnings - Better for long loops and avoiding context confusion * refactor: Rename ralph workflows with explicit descriptions - Rename ralph.yaml → ralph-stateful.yaml (persistent memory mode) - Update ralph-fresh.yaml description for clarity - Both workflows now require explicit invocation - Clear INVOKE WITH / NOT FOR / HOW IT WORKS / TRADE-OFFS sections - Neither is "default" - user must choose explicitly * chore: Set max_iterations to 10 on ralph workflows * fix: Address PR review feedback for loop workflow - Wrap database metadata update in try-catch to prevent misleading errors - Add dropped message tracking and user warning in loop workflow - Make plain signal detection more restrictive (end of output or own line) - Add context (line number, preview) to YAML parse errors - Make max iterations error message actionable with suggestions - Remove unnecessary type assertions after discriminated union refactor * chore: Remove unrelated plan files from branch
2026-01-12 09:13:21 +00:00
- Assistant type is set per codebase (auto-detected from `.codex/` or `.claude/` folders)
2025-11-12 15:10:34 +00:00
- Once a conversation starts, the assistant type is locked for that conversation
- `DEFAULT_AI_ASSISTANT` (optional) is used only for new conversations without codebase context
2025-11-12 15:10:34 +00:00
---
2025-11-12 15:10:34 +00:00
### 3. Platform Adapter Setup (Choose At Least One)
You must configure **at least one** platform to interact with your AI assistant.
<details>
<summary><b>💬 Telegram</b></summary>
**Create Telegram Bot:**
1. Message [@BotFather](https://t.me/BotFather) on Telegram
2. Send `/newbot` and follow the prompts
3. Copy the bot token (format: `123456789:ABCdefGHIjklMNOpqrsTUVwxyz`)
**Set environment variable:**
```env
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHI...
```
2025-11-12 15:10:34 +00:00
**Configure streaming mode (optional):**
2025-11-12 15:10:34 +00:00
```env
TELEGRAM_STREAMING_MODE=stream # stream (default) | batch
```
2025-11-12 15:51:46 +00:00
**For streaming mode details, see [Advanced Configuration](#advanced-configuration).**
2025-11-12 15:10:34 +00:00
</details>
2025-11-11 18:38:20 +00:00
<details>
<summary><b>💼 Slack</b></summary>
**Create Slack App with Socket Mode:**
See the detailed **[Slack Setup Guide](docs/slack-setup.md)** for step-by-step instructions.
**Quick Overview:**
1. Create app at [api.slack.com/apps](https://api.slack.com/apps)
2. Enable Socket Mode and get App Token (`xapp-...`)
3. Add Bot Token Scopes: `app_mentions:read`, `chat:write`, `channels:history`, `im:history`, `im:write`
4. Subscribe to events: `app_mention`, `message.im`
5. Install to workspace and get Bot Token (`xoxb-...`)
**Set environment variables:**
```env
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token
```
**Optional configuration:**
```env
# Restrict to specific users (comma-separated Slack user IDs)
SLACK_ALLOWED_USER_IDS=U1234ABCD,W5678EFGH
# Streaming mode
SLACK_STREAMING_MODE=batch # batch (default) | stream
```
**Usage:**
Interact by @mentioning your bot in channels or DM directly:
```
@your-bot /clone https://github.com/user/repo
@your-bot /status
```
Thread replies maintain conversation context, enabling workflows like:
1. Clone repo in main channel
2. Continue work in thread
3. Use `/worktree` for parallel development
</details>
2025-11-12 15:10:34 +00:00
<details>
<summary><b>🐙 GitHub Webhooks</b></summary>
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**Requirements:**
2025-11-11 18:38:20 +00:00
- GitHub repository with issues enabled
2025-11-12 15:10:34 +00:00
- `GITHUB_TOKEN` already set in Core Configuration above
- Public endpoint for webhooks (see ngrok setup below for local development)
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**Step 1: Generate Webhook Secret**
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
On Linux/Mac:
```bash
openssl rand -hex 32
```
On Windows (PowerShell):
```powershell
-join ((1..32) | ForEach-Object { '{0:x2}' -f (Get-Random -Maximum 256) })
```
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
Save this secret - you'll need it for steps 3 and 4.
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**Step 2: Expose Local Server (Development Only)**
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
<details>
<summary>Using ngrok (Free Tier)</summary>
2025-11-11 18:38:20 +00:00
```bash
2025-11-12 15:10:34 +00:00
# Install ngrok: https://ngrok.com/download
2025-11-11 18:38:20 +00:00
# Or: choco install ngrok (Windows)
# Or: brew install ngrok (Mac)
2025-11-12 15:10:34 +00:00
# Start tunnel
2025-11-11 18:38:20 +00:00
ngrok http 3000
2025-11-12 15:10:34 +00:00
# Copy the HTTPS URL (e.g., https://abc123.ngrok-free.app)
# ⚠️ Free tier URLs change on restart
```
Keep this terminal open while testing.
</details>
<details>
<summary>Using Cloudflare Tunnel (Persistent URLs)</summary>
```bash
# Install: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/
cloudflared tunnel --url http://localhost:3000
# Get persistent URL from Cloudflare dashboard
2025-11-11 18:38:20 +00:00
```
2025-11-12 15:10:34 +00:00
Persistent URLs survive restarts.
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
</details>
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**For production deployments**, use your deployed server URL (no tunnel needed).
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**Step 3: Configure GitHub Webhook**
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
Go to your repository settings:
- Navigate to: `https://github.com/owner/repo/settings/hooks`
2025-11-11 18:38:20 +00:00
- Click "Add webhook"
2025-11-12 15:10:34 +00:00
- **Note**: For multiple repositories, you'll need to add the webhook to each one individually
**Webhook Configuration:**
| Field | Value |
|-------|-------|
| **Payload URL** | Local: `https://abc123.ngrok-free.app/webhooks/github`<br>Production: `https://your-domain.com/webhooks/github` |
| **Content type** | `application/json` |
| **Secret** | Paste the secret from Step 1 |
| **SSL verification** | Enable SSL verification (recommended) |
| **Events** | Select "Let me select individual events":<br>✓ Issues<br>✓ Issue comments<br>✓ Pull requests |
Click "Add webhook" and verify it shows a green checkmark after delivery.
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
**Step 4: Set Environment Variables**
2025-11-11 18:38:20 +00:00
```env
2025-11-12 15:10:34 +00:00
WEBHOOK_SECRET=your_secret_from_step_1
2025-11-11 18:38:20 +00:00
```
**Important**: The `WEBHOOK_SECRET` must match exactly what you entered in GitHub's webhook configuration.
2025-11-12 15:10:34 +00:00
**Step 5: Configure Streaming (Optional)**
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
```env
GITHUB_STREAMING_MODE=batch # batch (default) | stream
2025-11-11 18:38:20 +00:00
```
2025-11-12 15:51:46 +00:00
**For streaming mode details, see [Advanced Configuration](#advanced-configuration).**
2025-11-12 15:10:34 +00:00
**Usage:**
2025-11-11 18:38:20 +00:00
Fix: Copy git-ignored files to worktrees (#100) (#145) * Fix: Copy git-ignored files to worktrees (#100) Worktrees created via the orchestrator now copy git-ignored files (like .env) based on configuration in .archon/config.yaml. This addresses the issue where applications fail when running in worktrees due to missing environment configuration. Changes: - Add copyFiles option to RepoConfig.worktree in config-types.ts - Create worktree-copy.ts utility for parsing config and copying files - Integrate file copying into WorktreeProvider.createWorktree() - Add comprehensive tests for new functionality Configuration example: ```yaml worktree: copyFiles: - .env.example -> .env # Copy and rename - .env # Copy as-is if exists - data/fixtures/ # Copy entire directory ``` Fixes #100 * Archive investigation for issue #100 * Fix: Add path traversal protection and improve error handling - Add isPathWithinRoot() to block path traversal attacks (works on Unix/Windows) - Add input validation to parseCopyFileEntry() for empty/invalid entries - Improve error logging with structured data and error codes - Separate config loading errors from file copy errors - Use console.error for unexpected errors, console.log for expected skips - Add 34 new tests for security, validation, and error handling - 100% test coverage for worktree-copy.ts * Add worktree copyFiles config for .env files * Update bot mention from @remote-agent to @Archon - Update default botMention in GitHubAdapter to 'Archon' - Update all docs to use @Archon consistently - Update test cases to use @Archon variations - The default botName in config is 'Archon', so this aligns the adapter * Docs: Add worktree app testing instructions to CLAUDE.md
2026-01-06 16:41:37 +00:00
Interact by @mentioning `@Archon` in issues or PRs:
2025-11-11 18:38:20 +00:00
```
Fix: Copy git-ignored files to worktrees (#100) (#145) * Fix: Copy git-ignored files to worktrees (#100) Worktrees created via the orchestrator now copy git-ignored files (like .env) based on configuration in .archon/config.yaml. This addresses the issue where applications fail when running in worktrees due to missing environment configuration. Changes: - Add copyFiles option to RepoConfig.worktree in config-types.ts - Create worktree-copy.ts utility for parsing config and copying files - Integrate file copying into WorktreeProvider.createWorktree() - Add comprehensive tests for new functionality Configuration example: ```yaml worktree: copyFiles: - .env.example -> .env # Copy and rename - .env # Copy as-is if exists - data/fixtures/ # Copy entire directory ``` Fixes #100 * Archive investigation for issue #100 * Fix: Add path traversal protection and improve error handling - Add isPathWithinRoot() to block path traversal attacks (works on Unix/Windows) - Add input validation to parseCopyFileEntry() for empty/invalid entries - Improve error logging with structured data and error codes - Separate config loading errors from file copy errors - Use console.error for unexpected errors, console.log for expected skips - Add 34 new tests for security, validation, and error handling - 100% test coverage for worktree-copy.ts * Add worktree copyFiles config for .env files * Update bot mention from @remote-agent to @Archon - Update default botMention in GitHubAdapter to 'Archon' - Update all docs to use @Archon consistently - Update test cases to use @Archon variations - The default botName in config is 'Archon', so this aligns the adapter * Docs: Add worktree app testing instructions to CLAUDE.md
2026-01-06 16:41:37 +00:00
@Archon can you analyze this bug?
@Archon /command-invoke prime
@Archon review this implementation
2025-11-11 18:38:20 +00:00
```
2025-11-12 15:10:34 +00:00
**First mention behavior:**
- Automatically clones the repository to `/.archon/workspaces/`
feat: Add Ralph-style autonomous iteration loops to workflow engine (#168) * Fix outdated command loading documentation * feat: Add Ralph-style autonomous iteration loops to workflow engine Enable workflows to iterate autonomously until a completion signal is detected (e.g., `<promise>COMPLETE</promise>`) or max iterations reached. Changes: - Add LoopConfig type with until signal, max_iterations, fresh_context - Extend WorkflowDefinition to support loop + prompt (mutually exclusive with steps) - Add executeLoopWorkflow function with completion signal detection - Update loader to parse and validate loop configuration - Add ralph.yaml example workflow demonstrating PRD implementation pattern - Add 22 new tests covering loop execution and parsing Loop workflows allow developers to run long-running tasks (like PRD implementation) without manual phase transitions, following the pattern popularized by Geoffrey Huntley. * Add test-loop workflow for Ralph loop testing * feat: Update worktree config to copy .archon files - Include all .archon files in worktree copy (not just .archon/ralph) - Update ralph.yaml with dynamic path detection for feature directories - Add PR creation step at completion - Use {prd-dir} variable for flexible path handling * feat: Add ralph-prd command for generating PRD files Creates structured PRD files for Ralph autonomous loops: - Outputs to .archon/ralph/{feature-slug}/ directory - Generates prd.md (full context) and prd.json (story tracking) - Feature-based naming to avoid conflicts between projects - Guides user through requirements gathering phases * feat: Add ralph-fresh workflow with fresh_context: true Fresh context mode for Ralph loops where each iteration: - Starts with a clean slate (no memory of previous iterations) - Re-reads progress.txt, prd.json, prd.md to understand current state - Relies on progress.txt "Codebase Patterns" section for learnings - Better for long loops and avoiding context confusion * refactor: Rename ralph workflows with explicit descriptions - Rename ralph.yaml → ralph-stateful.yaml (persistent memory mode) - Update ralph-fresh.yaml description for clarity - Both workflows now require explicit invocation - Clear INVOKE WITH / NOT FOR / HOW IT WORKS / TRADE-OFFS sections - Neither is "default" - user must choose explicitly * chore: Set max_iterations to 10 on ralph workflows * fix: Address PR review feedback for loop workflow - Wrap database metadata update in try-catch to prevent misleading errors - Add dropped message tracking and user warning in loop workflow - Make plain signal detection more restrictive (end of output or own line) - Add context (line number, preview) to YAML parse errors - Make max iterations error message actionable with suggestions - Remove unnecessary type assertions after discriminated union refactor * chore: Remove unrelated plan files from branch
2026-01-12 09:13:21 +00:00
- Detects and loads commands from `.archon/commands/` if present
2025-11-12 15:10:34 +00:00
- Injects full issue/PR context for the AI assistant
**Subsequent mentions:**
- Resumes existing conversation
- Maintains full context across comments
---
**Adding Additional Repositories**
Once your server is running, add more repos by creating a webhook with the same secret:
```bash
# Get your existing webhook secret
WEBHOOK_SECRET=$(grep WEBHOOK_SECRET .env | cut -d= -f2)
# Add webhook to new repo (replace OWNER/REPO)
gh api repos/OWNER/REPO/hooks --method POST \
-f "config[url]=https://YOUR_DOMAIN/webhooks/github" \
-f "config[content_type]=json" \
-f "config[secret]=$WEBHOOK_SECRET" \
-f "events[]=issues" \
-f "events[]=issue_comment" \
-f "events[]=pull_request" \
-f "events[]=pull_request_review_comment"
```
Or via GitHub UI: **Repo Settings → Webhooks → Add webhook**
- **Payload URL**: Your server URL + `/webhooks/github`
- **Content type**: `application/json`
- **Secret**: Same `WEBHOOK_SECRET` from your `.env`
- **Events**: Issues, Issue comments, Pull requests, Pull request review comments
**Important**: The webhook secret must be identical across all repos.
2025-11-12 15:10:34 +00:00
</details>
<details>
<summary><b>💬 Discord</b></summary>
**Create Discord Bot:**
1. Visit [Discord Developer Portal](https://discord.com/developers/applications)
2. Click "New Application" → Enter a name → Click "Create"
3. Go to the "Bot" tab in the left sidebar
4. Click "Add Bot" → Confirm
**Get Bot Token:**
1. Under the Bot tab, click "Reset Token"
2. Copy the token (starts with a long alphanumeric string)
3. **Save it securely** - you won't be able to see it again
**Enable Message Content Intent (Required):**
1. Scroll down to "Privileged Gateway Intents"
2. Enable **"Message Content Intent"** (required for the bot to read messages)
3. Save changes
**Invite Bot to Your Server:**
1. Go to "OAuth2" → "URL Generator" in the left sidebar
2. Under "Scopes", select:
-`bot`
3. Under "Bot Permissions", select:
- ✓ Send Messages
- ✓ Read Message History
- ✓ Create Public Threads (optional, for thread support)
- ✓ Send Messages in Threads (optional, for thread support)
4. Copy the generated URL at the bottom
5. Paste it in your browser and select your server
6. Click "Authorize"
**Note:** You need "Manage Server" permission to add bots.
**Set environment variable:**
```env
DISCORD_BOT_TOKEN=your_bot_token_here
```
**Configure user whitelist (optional):**
To restrict bot access to specific users, enable Developer Mode in Discord:
1. User Settings → Advanced → Enable "Developer Mode"
2. Right-click on users → "Copy User ID"
3. Add to environment:
```env
DISCORD_ALLOWED_USER_IDS=123456789012345678,987654321098765432
```
**Configure streaming mode (optional):**
```env
DISCORD_STREAMING_MODE=batch # batch (default) | stream
```
**For streaming mode details, see [Advanced Configuration](#advanced-configuration).**
**Usage:**
The bot responds to:
- **Direct Messages**: Just send messages directly
- **Server Channels**: @mention the bot (e.g., `@YourBotName help me with this code`)
- **Threads**: Bot maintains context in thread conversations
</details>
2025-11-12 15:10:34 +00:00
---
### 4. Start the Application
2025-11-11 18:38:20 +00:00
2025-11-12 15:10:34 +00:00
Choose the Docker Compose profile based on your database setup:
2025-11-11 18:38:20 +00:00
**Option A: With Remote PostgreSQL (Supabase, Neon, etc.)**
2025-11-11 18:38:20 +00:00
Starts only the app container (requires `DATABASE_URL` set to remote database in `.env`):
2025-11-12 15:10:34 +00:00
```bash
# Start app container
docker compose --profile external-db up -d --build
2025-11-12 15:10:34 +00:00
# View logs
2025-11-12 15:51:46 +00:00
docker compose logs -f app
```
**Option B: With Local PostgreSQL (Docker)**
2025-11-12 15:10:34 +00:00
Starts both the app and PostgreSQL containers:
```bash
# Start containers
2025-11-12 15:51:46 +00:00
docker compose --profile with-db up -d --build
2025-11-12 15:10:34 +00:00
# Wait for startup (watch logs)
docker compose logs -f app-with-db
2025-11-12 15:10:34 +00:00
# Database tables are created automatically via init script
```
**Option C: Local Development (No Docker)**
Migrate from Node.js/npm/Jest to Bun runtime (#85) * Migrate from Node.js/npm/Jest to Bun runtime - Replace npm with bun for package management (bun.lock) - Replace Jest with bun:test for testing - Update tsconfig for Bun (ESNext module, bundler resolution) - Update Dockerfile to use oven/bun:1-slim - Update CI workflow to use oven-sh/setup-bun@v2 - Remove dynamic import hack from codex.ts (direct ESM imports) - Fix test mocking for Bun (export execFileAsync, use spyOn) - Update all documentation (CLAUDE.md, README.md, CONTRIBUTING.md) All 395 tests pass, type-check passes, E2E validated with curl. * ci: retrigger CI build * fix: make execFileAsync a function for better Bun mockability * fix: ensure execFileAsync returns string not Buffer * fix: rename _execFileAsync to comply with naming convention * fix: make mkdirAsync mockable for Bun tests * fix: update engines to bun>=1.0.0 and add mkdirAsync mock * fix: pin Bun to 1.3.4 in CI to fix mock.module test failures Newer Bun versions have different mock.module() behavior that causes cross-test module pollution, resulting in 71 test failures in CI while tests pass locally. Pinning to 1.3.4 ensures consistent behavior. * fix: run orchestrator tests last to avoid mock.module pollution Bun's mock.module() pollutes the global module cache, causing tests to fail when orchestrator.test.ts (which mocks command-handler and factory) runs before those modules' own test files. Fix by running tests in two batches: 1. All tests except orchestrator 2. Orchestrator tests last This ensures orchestrator's mocks don't affect other test files.
2025-12-16 13:34:58 +00:00
Run directly with Bun (requires local PostgreSQL or remote `DATABASE_URL` in `.env`):
```bash
bun install # First time only
Migrate from Node.js/npm/Jest to Bun runtime (#85) * Migrate from Node.js/npm/Jest to Bun runtime - Replace npm with bun for package management (bun.lock) - Replace Jest with bun:test for testing - Update tsconfig for Bun (ESNext module, bundler resolution) - Update Dockerfile to use oven/bun:1-slim - Update CI workflow to use oven-sh/setup-bun@v2 - Remove dynamic import hack from codex.ts (direct ESM imports) - Fix test mocking for Bun (export execFileAsync, use spyOn) - Update all documentation (CLAUDE.md, README.md, CONTRIBUTING.md) All 395 tests pass, type-check passes, E2E validated with curl. * ci: retrigger CI build * fix: make execFileAsync a function for better Bun mockability * fix: ensure execFileAsync returns string not Buffer * fix: rename _execFileAsync to comply with naming convention * fix: make mkdirAsync mockable for Bun tests * fix: update engines to bun>=1.0.0 and add mkdirAsync mock * fix: pin Bun to 1.3.4 in CI to fix mock.module test failures Newer Bun versions have different mock.module() behavior that causes cross-test module pollution, resulting in 71 test failures in CI while tests pass locally. Pinning to 1.3.4 ensures consistent behavior. * fix: run orchestrator tests last to avoid mock.module pollution Bun's mock.module() pollutes the global module cache, causing tests to fail when orchestrator.test.ts (which mocks command-handler and factory) runs before those modules' own test files. Fix by running tests in two batches: 1. All tests except orchestrator 2. Orchestrator tests last This ensures orchestrator's mocks don't affect other test files.
2025-12-16 13:34:58 +00:00
bun run dev
```
2025-11-12 15:10:34 +00:00
**Stop the application:**
```bash
docker compose --profile external-db down # If using Option A
docker compose --profile with-db down # If using Option B
2025-11-12 15:10:34 +00:00
```
---
## Usage
### Available Commands
Once your platform adapter is running, you can use these commands. Type `/help` to see this list.
2025-11-12 15:10:34 +00:00
#### Command Templates (Global)
2025-11-12 15:10:34 +00:00
| Command | Description |
|---------|-------------|
| `/<name> [args]` | Invoke a template directly (e.g., `/plan "Add dark mode"`) |
| `/templates` | List all available templates |
| `/template-add <name> <path>` | Add template from file |
| `/template-delete <name>` | Remove a template |
#### Codebase Commands (Per-Project)
2025-11-12 15:10:34 +00:00
| Command | Description |
|---------|-------------|
| `/command-set <name> <path> [text]` | Register a command from file |
| `/load-commands <folder>` | Bulk load commands (recursive) |
| `/command-invoke <name> [args]` | Execute a codebase command |
| `/commands` | List registered commands |
2025-11-12 15:10:34 +00:00
> **Note:** Commands use relative paths (e.g., `.archon/commands/plan.md`)
#### Codebase Management
2025-11-12 15:10:34 +00:00
| Command | Description |
|---------|-------------|
| `/clone <repo-url>` | Clone repository |
| `/repos` | List repositories (numbered) |
| `/repo <#\|name> [pull]` | Switch repo (auto-loads commands) |
| `/repo-remove <#\|name>` | Remove repo and codebase record |
| `/getcwd` | Show working directory |
| `/setcwd <path>` | Set working directory |
2025-11-12 15:10:34 +00:00
> **Tip:** Use `/repo` for quick switching between cloned repos, `/setcwd` for manual paths.
#### Worktrees (Isolation)
| Command | Description |
|---------|-------------|
| `/worktree create <branch>` | Create isolated worktree |
| `/worktree list` | Show worktrees for this repo |
| `/worktree remove [--force]` | Remove current worktree |
| `/worktree cleanup merged\|stale` | Clean up worktrees |
| `/worktree orphans` | Show all worktrees from git |
#### Workflows
| Command | Description |
|---------|-------------|
| `/workflow list` | Show available workflows |
| `/workflow reload` | Reload workflow definitions |
| `/workflow status` | Show running workflow details |
| `/workflow cancel` | Cancel running workflow |
> **Note:** Workflows are YAML files in `.archon/workflows/`
#### Session Management
| Command | Description |
|---------|-------------|
| `/status` | Show conversation state |
| `/reset` | Clear session completely |
| `/reset-context` | Reset AI context, keep worktree |
| `/help` | Show all commands |
#### Setup
| Command | Description |
|---------|-------------|
| `/init` | Create `.archon` structure in current repo |
### Example Workflow (Telegram)
2025-11-12 15:10:34 +00:00
**Clone a Repository**
2025-11-12 15:10:34 +00:00
```
You: /clone https://github.com/user/my-project
Bot: Repository cloned successfully!
Fix: Show repo identifier instead of server filesystem path (#152) (#175) * Investigate issue #152: GitHub UX - Show repo identifier instead of filesystem path * Fix: Show repo identifier instead of server filesystem path (#152) Commands were exposing server's internal filesystem paths (e.g., /Users/rasmus/.archon/workspaces/owner/repo) to users, which is a security concern and provides no value. Users need to know what repo and branch they're working in, not the server's internal directory structure. Changes: - Added formatRepoContext() helper to show "owner/repo @ branch" format - Updated /status to display "Repository: owner/repo @ branch (worktree)" - Updated /getcwd to show repo context instead of filesystem path - Updated /setcwd response to show repo context with fallback to path - Updated /clone response to remove "Path:" line entirely - Updated tests to match new output format Fixes #152 * Archive investigation for issue #152 * Simplify formatRepoContext by extracting getCurrentBranch helper - Extract git branch lookup into standalone getCurrentBranch() function - Remove mutable variables (branchName, isWorktree) - Simplify control flow with early returns - Reduce JSDoc verbosity (function signature is self-documenting) - Comment now explains WHY git failures fallback to 'main' All 84 tests pass. No functional changes. * docs: Update command output examples to show repo identifier instead of filesystem paths * Address PR review feedback: improve error handling and simplify code - Fix duplicate "Repository:" label in /status - now shows "URL:" for repo URL - Add error logging to getCurrentBranch() when git fails - Handle detached HEAD state explicitly (shows "detached HEAD" not "HEAD") - Add try-catch around DB call in formatRepoContext() with logging - Remove unnecessary isolationDb parameter (uses already-imported module) - Fix /setcwd fallback to show folder name only, not full filesystem path - Update tests to match new output format * Add warning log for orphaned isolation envs and improve test coverage - Add console.warn() when isolation_env_id exists but DB record not found - Document no-throw guarantees in getCurrentBranch() and formatRepoContext() - Add tests for worktree branch lookup and orphaned isolation env fallback
2026-01-18 12:29:20 +00:00
Repository: my-project
feat: Runtime loading of default commands/workflows (#324) * feat: Runtime loading of default commands/workflows Instead of copying default commands and workflows to target repos on clone, load them at runtime from the app's bundled defaults directory. Changes: - Fix getAppArchonBasePath() to resolve to repo root (not packages/core) - Add loadDefaultCommands and loadDefaultWorkflows config options - Update workflow loader to search app defaults then repo (repo wins) - Update command executor to search app defaults after repo paths - Remove copyDefaultsToRepo() calls from /clone and GitHub adapter - Fix lint-staged to not warn on ignored test files Benefits: - Defaults always up-to-date (no sync issues) - Clean repos (no 24+ files copied per clone) - User's local clone stays in sync with what Archon uses Closes #322 * docs: Update documentation for runtime loading of defaults - Update CLAUDE.md to explain runtime loading behavior - Fix README.md example output and note about defaults - Update docs/configuration.md with new config options - Mark copyDefaults as deprecated in favor of loadDefaultCommands/loadDefaultWorkflows * fix: Address PR review findings for runtime loading - Fix silent error swallowing in loadConfig catch blocks (loader.ts, executor.ts) - Now logs warning with context before falling back to defaults - Users will know when their config has syntax errors - Fix config merging bug in mergeRepoConfig - Now includes loadDefaultCommands and loadDefaultWorkflows in merge - Repo config opt-out now works correctly - Add consistent empty file handling for app defaults - Returns explicit empty_file error instead of falling through - Add debug logging for ENOENT cases - Helps troubleshoot when app defaults aren't found - Add startup validation for app defaults paths - validateAppDefaultsPaths() checks and logs verification status - Called during server startup after logArchonPaths() - Add comprehensive tests for app defaults command loading - Test loading from app defaults when not in repo - Test repo commands override app defaults - Test loadDefaultCommands: false opt-out - Test empty file handling - Test graceful handling of missing paths - Test config error fallback behavior * fix: Use namespace imports for archonPaths to fix test mocking in CI The loader.ts used destructured imports for getDefaultWorkflowsPath and getWorkflowFolderSearchPaths, but the tests use spyOn which only works with namespace imports (import * as). This caused the mocks to not work in CI where tests run in parallel, causing 48 test failures. * fix: Restore spyOn approach with namespace imports for loader tests The key fix is that loader.ts uses namespace imports (import * as archonPaths) which shares the same module instance with the test file. This allows spyOn to work correctly without using mock.module() which pollutes other tests. * fix: Use loadDefaultWorkflows: false to avoid app defaults in tests Instead of mocking archon-paths (which pollutes other tests), we: 1. Only mock config-loader with loadDefaultWorkflows: false by default 2. This prevents app defaults from being loaded during tests 3. For multi-source loading tests, enable loadDefaultWorkflows: true and use spyOn to set the path to a temp directory * fix: Use namespace imports and spyOn for all loader dependencies Key changes: 1. loader.ts now uses namespace imports for both archonPaths and configLoader 2. loader.test.ts uses spyOn instead of mock.module 3. This avoids polluting other test files (archon-paths.test.ts, config-loader.test.ts) The spyOn approach works because: - Both loader.ts and loader.test.ts import the modules as namespaces - They share the same module instance in Bun's module cache - spyOn modifies the shared namespace object * fix: Use namespace imports in executor.ts for test mocking Change executor.ts to use namespace imports for archon-paths and config-loader, matching the fix already applied to loader.ts. The previous fix commits (491fa94, c3a68dd) only updated loader.ts but missed executor.ts, which has the same pattern of tests using spyOn() that requires namespace imports to work correctly. Changes: - import * as archonPaths from '../utils/archon-paths' - import * as configLoader from '../config/config-loader' - Update all usage sites to use namespace prefix * refactor: Prefix app defaults with archon-* and simplify override logic Changes: - Rename all default workflow files to archon-*.yaml - Rename all default command files to archon-*.md - Update workflow name: fields to match filenames - Update command references in workflows to use archon-* names - Simplify loader.ts to use exact filename match for overrides (not workflow name) - Remove path mocking from tests - use real app defaults instead - Simplify tests to be more reliable in CI Benefits: - No accidental collisions with user workflows/commands - Clear intent when users override (must use exact filename) - Simpler deduplication logic (filename-based) - More reliable tests (no spyOn issues in CI parallel execution) * feat: Add deprecation warning for old defaults and update docs - Add warning in loader.ts when old non-prefixed defaults found in repo - Update CLAUDE.md with migration instructions for old repos - Document the archon-* prefix naming convention - Document exact filename match override behavior * docs: Move migration docs to docs/migration-guide.md - Revert CLAUDE.md changes (keep it focused on development) - Create dedicated migration guide for version upgrades - Document runtime loading defaults migration steps - Add commands for full fresh start cleanup * docs: Add getting started section after cleanup * docs: Fix stale references to command loading behavior - Update CLAUDE.md to say 'auto-detected' instead of 'loaded via /clone (auto)' - Clarify in architecture.md that defaults are loaded at runtime, not copied - Update GitHub webhook flow to say 'detect and register' instead of 'load commands' * refactor: Use early return in validateAppDefaultsPaths for cleaner flow * fix: Improve error handling for silent failure cases - Add ENOENT check to empty catch block in loader.ts (critical) - Distinguish between 'not found' and other errors in validateAppDefaultsPaths - Add errorType to config load fallback logging in loader.ts and executor.ts
2026-01-21 21:08:23 +00:00
✓ App defaults available at runtime
Session reset - starting fresh on next message.
2025-11-12 15:10:34 +00:00
You can now start asking questions about the code.
2025-11-12 15:10:34 +00:00
```
feat: Runtime loading of default commands/workflows (#324) * feat: Runtime loading of default commands/workflows Instead of copying default commands and workflows to target repos on clone, load them at runtime from the app's bundled defaults directory. Changes: - Fix getAppArchonBasePath() to resolve to repo root (not packages/core) - Add loadDefaultCommands and loadDefaultWorkflows config options - Update workflow loader to search app defaults then repo (repo wins) - Update command executor to search app defaults after repo paths - Remove copyDefaultsToRepo() calls from /clone and GitHub adapter - Fix lint-staged to not warn on ignored test files Benefits: - Defaults always up-to-date (no sync issues) - Clean repos (no 24+ files copied per clone) - User's local clone stays in sync with what Archon uses Closes #322 * docs: Update documentation for runtime loading of defaults - Update CLAUDE.md to explain runtime loading behavior - Fix README.md example output and note about defaults - Update docs/configuration.md with new config options - Mark copyDefaults as deprecated in favor of loadDefaultCommands/loadDefaultWorkflows * fix: Address PR review findings for runtime loading - Fix silent error swallowing in loadConfig catch blocks (loader.ts, executor.ts) - Now logs warning with context before falling back to defaults - Users will know when their config has syntax errors - Fix config merging bug in mergeRepoConfig - Now includes loadDefaultCommands and loadDefaultWorkflows in merge - Repo config opt-out now works correctly - Add consistent empty file handling for app defaults - Returns explicit empty_file error instead of falling through - Add debug logging for ENOENT cases - Helps troubleshoot when app defaults aren't found - Add startup validation for app defaults paths - validateAppDefaultsPaths() checks and logs verification status - Called during server startup after logArchonPaths() - Add comprehensive tests for app defaults command loading - Test loading from app defaults when not in repo - Test repo commands override app defaults - Test loadDefaultCommands: false opt-out - Test empty file handling - Test graceful handling of missing paths - Test config error fallback behavior * fix: Use namespace imports for archonPaths to fix test mocking in CI The loader.ts used destructured imports for getDefaultWorkflowsPath and getWorkflowFolderSearchPaths, but the tests use spyOn which only works with namespace imports (import * as). This caused the mocks to not work in CI where tests run in parallel, causing 48 test failures. * fix: Restore spyOn approach with namespace imports for loader tests The key fix is that loader.ts uses namespace imports (import * as archonPaths) which shares the same module instance with the test file. This allows spyOn to work correctly without using mock.module() which pollutes other tests. * fix: Use loadDefaultWorkflows: false to avoid app defaults in tests Instead of mocking archon-paths (which pollutes other tests), we: 1. Only mock config-loader with loadDefaultWorkflows: false by default 2. This prevents app defaults from being loaded during tests 3. For multi-source loading tests, enable loadDefaultWorkflows: true and use spyOn to set the path to a temp directory * fix: Use namespace imports and spyOn for all loader dependencies Key changes: 1. loader.ts now uses namespace imports for both archonPaths and configLoader 2. loader.test.ts uses spyOn instead of mock.module 3. This avoids polluting other test files (archon-paths.test.ts, config-loader.test.ts) The spyOn approach works because: - Both loader.ts and loader.test.ts import the modules as namespaces - They share the same module instance in Bun's module cache - spyOn modifies the shared namespace object * fix: Use namespace imports in executor.ts for test mocking Change executor.ts to use namespace imports for archon-paths and config-loader, matching the fix already applied to loader.ts. The previous fix commits (491fa94, c3a68dd) only updated loader.ts but missed executor.ts, which has the same pattern of tests using spyOn() that requires namespace imports to work correctly. Changes: - import * as archonPaths from '../utils/archon-paths' - import * as configLoader from '../config/config-loader' - Update all usage sites to use namespace prefix * refactor: Prefix app defaults with archon-* and simplify override logic Changes: - Rename all default workflow files to archon-*.yaml - Rename all default command files to archon-*.md - Update workflow name: fields to match filenames - Update command references in workflows to use archon-* names - Simplify loader.ts to use exact filename match for overrides (not workflow name) - Remove path mocking from tests - use real app defaults instead - Simplify tests to be more reliable in CI Benefits: - No accidental collisions with user workflows/commands - Clear intent when users override (must use exact filename) - Simpler deduplication logic (filename-based) - More reliable tests (no spyOn issues in CI parallel execution) * feat: Add deprecation warning for old defaults and update docs - Add warning in loader.ts when old non-prefixed defaults found in repo - Update CLAUDE.md with migration instructions for old repos - Document the archon-* prefix naming convention - Document exact filename match override behavior * docs: Move migration docs to docs/migration-guide.md - Revert CLAUDE.md changes (keep it focused on development) - Create dedicated migration guide for version upgrades - Document runtime loading defaults migration steps - Add commands for full fresh start cleanup * docs: Add getting started section after cleanup * docs: Fix stale references to command loading behavior - Update CLAUDE.md to say 'auto-detected' instead of 'loaded via /clone (auto)' - Clarify in architecture.md that defaults are loaded at runtime, not copied - Update GitHub webhook flow to say 'detect and register' instead of 'load commands' * refactor: Use early return in validateAppDefaultsPaths for cleaner flow * fix: Improve error handling for silent failure cases - Add ENOENT check to empty catch block in loader.ts (critical) - Distinguish between 'not found' and other errors in validateAppDefaultsPaths - Add errorType to config load fallback logging in loader.ts and executor.ts
2026-01-21 21:08:23 +00:00
> **Note:** Default commands and workflows are loaded at runtime and merged with repo-specific ones. Repo commands/workflows override app defaults by name. To disable defaults, set `defaults.loadDefaultCommands: false` or `defaults.loadDefaultWorkflows: false` in the repo's `.archon/config.yaml`.
2025-11-12 15:10:34 +00:00
**Ask Questions Directly**
```
You: What's the structure of this repo?
2025-11-12 15:10:34 +00:00
Bot: [Claude analyzes and responds...]
```
**Create Custom Commands (Optional)**
```
You: /init
2025-11-12 15:10:34 +00:00
Bot: Created .archon structure:
.archon/
├── config.yaml
└── commands/
└── example.md
Use /load-commands .archon/commands to register commands.
2025-11-12 15:10:34 +00:00
```
You can then create your own commands in `.archon/commands/` and load them with `/load-commands`.
**Check Status**
2025-11-12 15:10:34 +00:00
```
You: /status
Bot: Platform: telegram
AI Assistant: claude
2025-11-12 15:10:34 +00:00
Codebase: my-project
Repository: https://github.com/user/my-project
2025-11-12 15:10:34 +00:00
Fix: Show repo identifier instead of server filesystem path (#152) (#175) * Investigate issue #152: GitHub UX - Show repo identifier instead of filesystem path * Fix: Show repo identifier instead of server filesystem path (#152) Commands were exposing server's internal filesystem paths (e.g., /Users/rasmus/.archon/workspaces/owner/repo) to users, which is a security concern and provides no value. Users need to know what repo and branch they're working in, not the server's internal directory structure. Changes: - Added formatRepoContext() helper to show "owner/repo @ branch" format - Updated /status to display "Repository: owner/repo @ branch (worktree)" - Updated /getcwd to show repo context instead of filesystem path - Updated /setcwd response to show repo context with fallback to path - Updated /clone response to remove "Path:" line entirely - Updated tests to match new output format Fixes #152 * Archive investigation for issue #152 * Simplify formatRepoContext by extracting getCurrentBranch helper - Extract git branch lookup into standalone getCurrentBranch() function - Remove mutable variables (branchName, isWorktree) - Simplify control flow with early returns - Reduce JSDoc verbosity (function signature is self-documenting) - Comment now explains WHY git failures fallback to 'main' All 84 tests pass. No functional changes. * docs: Update command output examples to show repo identifier instead of filesystem paths * Address PR review feedback: improve error handling and simplify code - Fix duplicate "Repository:" label in /status - now shows "URL:" for repo URL - Add error logging to getCurrentBranch() when git fails - Handle detached HEAD state explicitly (shows "detached HEAD" not "HEAD") - Add try-catch around DB call in formatRepoContext() with logging - Remove unnecessary isolationDb parameter (uses already-imported module) - Fix /setcwd fallback to show folder name only, not full filesystem path - Update tests to match new output format * Add warning log for orphaned isolation envs and improve test coverage - Add console.warn() when isolation_env_id exists but DB record not found - Document no-throw guarantees in getCurrentBranch() and formatRepoContext() - Add tests for worktree branch lookup and orphaned isolation env fallback
2026-01-18 12:29:20 +00:00
Repository: my-project @ main
Worktrees: 0/10
```
**Work in Isolation with Worktrees**
2025-11-12 15:10:34 +00:00
```
You: /worktree create feature-auth
2025-11-12 15:10:34 +00:00
Bot: Worktree created!
Branch: feature-auth
Path: feature-auth/
This conversation now works in isolation.
Run dependency install if needed (e.g., bun install).
```
**Reset Session**
2025-11-12 15:10:34 +00:00
```
You: /reset
2025-11-12 15:10:34 +00:00
Bot: Session cleared. Starting fresh on next message.
Codebase configuration preserved.
```
2025-11-12 15:10:34 +00:00
### Example Workflow (GitHub)
2025-11-12 15:10:34 +00:00
Create an issue or comment on an existing issue/PR:
2025-11-12 15:10:34 +00:00
```
@your-bot-name can you help me understand the authentication flow?
```
2025-11-12 15:10:34 +00:00
Bot responds with analysis. Continue the conversation:
2025-11-12 15:10:34 +00:00
```
@your-bot-name can you create a sequence diagram for this?
```
2025-11-12 15:10:34 +00:00
Bot maintains context and provides the diagram.
---
2025-11-12 15:10:34 +00:00
## Advanced Configuration
2025-11-12 15:10:34 +00:00
<details>
<summary><b>Streaming Modes Explained</b></summary>
2025-11-12 15:10:34 +00:00
### Stream Mode
2025-11-12 15:10:34 +00:00
Messages are sent in real-time as the AI generates responses.
**Configuration:**
```env
TELEGRAM_STREAMING_MODE=stream
2025-11-12 15:10:34 +00:00
GITHUB_STREAMING_MODE=stream
```
**Pros:**
2025-11-12 15:10:34 +00:00
- Real-time feedback and progress indication
- More interactive and engaging
- See AI reasoning as it works
**Cons:**
2025-11-12 15:10:34 +00:00
- More API calls to platform
- May hit rate limits with very long responses
- Creates many messages/comments
**Best for:** Interactive chat platforms (Telegram)
### Batch Mode
2025-11-12 15:10:34 +00:00
Only the final summary message is sent after AI completes processing.
2025-11-12 15:10:34 +00:00
**Configuration:**
```env
TELEGRAM_STREAMING_MODE=batch
2025-11-12 15:10:34 +00:00
GITHUB_STREAMING_MODE=batch
```
**Pros:**
2025-11-12 15:10:34 +00:00
- Single coherent message/comment
- Fewer API calls
2025-11-12 15:10:34 +00:00
- No spam or clutter
**Cons:**
2025-11-12 15:10:34 +00:00
- No progress indication during processing
- Longer wait for first response
- Can't see intermediate steps
2025-11-12 15:10:34 +00:00
**Best for:** Issue trackers and async platforms (GitHub)
</details>
<details>
<summary><b>Concurrency Settings</b></summary>
Control how many conversations the system processes simultaneously:
```env
MAX_CONCURRENT_CONVERSATIONS=10 # Default: 10
```
**How it works:**
- Conversations are processed with a lock manager
- If max concurrent limit reached, new messages are queued
- Prevents resource exhaustion and API rate limits
- Each conversation maintains its own independent context
2025-11-12 15:10:34 +00:00
**Check current load:**
```bash
curl http://localhost:3000/health/concurrency
```
2025-11-12 15:10:34 +00:00
**Response:**
```json
{
"status": "ok",
"active": 3,
"queued": 0,
"maxConcurrent": 10
}
```
2025-11-12 15:10:34 +00:00
**Tuning guidance:**
- **Low resources**: Set to 3-5
- **Standard**: Default 10 works well
- **High resources**: Can increase to 20-30 (monitor API limits)
2025-11-12 15:10:34 +00:00
</details>
2025-11-12 15:10:34 +00:00
<details>
<summary><b>Health Check Endpoints</b></summary>
The application exposes health check endpoints for monitoring:
**Basic Health Check:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
curl http://localhost:3090/health
2025-11-12 15:10:34 +00:00
```
Returns: `{"status":"ok"}`
2025-11-12 15:10:34 +00:00
**Database Connectivity:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
curl http://localhost:3090/health/db
```
2025-11-12 15:10:34 +00:00
Returns: `{"status":"ok","database":"connected"}`
**Concurrency Status:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
curl http://localhost:3090/health/concurrency
```
2025-11-12 15:10:34 +00:00
Returns: `{"status":"ok","active":0,"queued":0,"maxConcurrent":10}`
**Use cases:**
- Docker healthcheck configuration
- Load balancer health checks
- Monitoring and alerting systems (Prometheus, Datadog, etc.)
- CI/CD deployment verification
</details>
<details>
<summary><b>Custom Command System</b></summary>
Create your own commands by adding markdown files to your codebase:
**1. Create command file:**
```bash
mkdir -p .archon/commands
cat > .archon/commands/analyze.md << 'EOF'
2025-11-12 15:10:34 +00:00
You are an expert code analyzer.
Analyze the following aspect of the codebase: $1
Provide:
1. Current implementation analysis
2. Potential issues or improvements
3. Best practices recommendations
Focus area: $ARGUMENTS
EOF
```
**2. Load commands:**
```
/load-commands .archon/commands
2025-11-12 15:10:34 +00:00
```
**3. Invoke your command:**
```
/command-invoke analyze "security vulnerabilities"
```
**Variable substitution:**
- `$1`, `$2`, `$3`, etc. - Positional arguments
- `$ARGUMENTS` - All arguments as a single string
- `$PLAN` - Previous plan from session metadata
- `$IMPLEMENTATION_SUMMARY` - Previous execution summary
Commands are version-controlled with your codebase, not stored in the database.
</details>
<details>
<summary><b>Workflows (Multi-Step Automation)</b></summary>
Workflows are YAML files that define multi-step AI processes. They can be step-based (sequential commands) or loop-based (autonomous iteration).
**Location:** `.archon/workflows/`
**Example step-based workflow** (`.archon/workflows/fix-github-issue.yaml`):
```yaml
name: fix-github-issue
description: |
Use when: User wants to FIX or RESOLVE a GitHub issue.
Does: Investigates root cause -> creates plan -> makes code changes -> creates PR.
feat: Config-based provider selection for workflows (#283) * feat: Use config-based provider selection for workflows - Workflow executor now uses config.assistant as fallback instead of hardcoded 'claude' when workflow doesn't specify provider - Remove provider: claude from all default workflow files so they inherit from config - Add assistant: codex to repo config for testing - Add implementation plan for model validation feature (#281) This allows users to switch default provider via config without modifying workflow files. Workflows can still override by specifying provider explicitly. * feat: Add logging for resolved provider and model at workflow execution Log which provider and model is being used at: - Each workflow step execution - Each loop workflow iteration This helps debug config-based provider selection and verify the correct provider/model combination is being used. Related to #281 * docs: Document config-based workflow provider inheritance * refactor: Hoist config loading outside of loops in workflow executor - Load config once at workflow start instead of on each step/iteration - Pass resolvedProvider and resolvedModel as parameters to internal functions - Remove now-unused workflow parameter from executeStepInternal and executeParallelBlock - Eliminates redundant filesystem reads during workflow execution * fix: Add provider source tracking and enhanced error context - Add source tracking to provider log messages (shows "from workflow definition" vs "from config") for easier debugging - Wrap getAssistantClient calls with try-catch that provides actionable error messages pointing users to check their workflow YAML or .archon/config.yaml assistant setting Addresses review feedback from PR #283
2026-01-19 09:08:02 +00:00
model: sonnet # Optional: provider inherited from .archon/config.yaml
steps:
- command: investigate-issue
- command: implement-issue
clearContext: true
```
**Example loop-based workflow** (autonomous iteration):
```yaml
name: ralph-loop
description: Execute plan until all validations pass
feat: Config-based provider selection for workflows (#283) * feat: Use config-based provider selection for workflows - Workflow executor now uses config.assistant as fallback instead of hardcoded 'claude' when workflow doesn't specify provider - Remove provider: claude from all default workflow files so they inherit from config - Add assistant: codex to repo config for testing - Add implementation plan for model validation feature (#281) This allows users to switch default provider via config without modifying workflow files. Workflows can still override by specifying provider explicitly. * feat: Add logging for resolved provider and model at workflow execution Log which provider and model is being used at: - Each workflow step execution - Each loop workflow iteration This helps debug config-based provider selection and verify the correct provider/model combination is being used. Related to #281 * docs: Document config-based workflow provider inheritance * refactor: Hoist config loading outside of loops in workflow executor - Load config once at workflow start instead of on each step/iteration - Pass resolvedProvider and resolvedModel as parameters to internal functions - Remove now-unused workflow parameter from executeStepInternal and executeParallelBlock - Eliminates redundant filesystem reads during workflow execution * fix: Add provider source tracking and enhanced error context - Add source tracking to provider log messages (shows "from workflow definition" vs "from config") for easier debugging - Wrap getAssistantClient calls with try-catch that provides actionable error messages pointing users to check their workflow YAML or .archon/config.yaml assistant setting Addresses review feedback from PR #283
2026-01-19 09:08:02 +00:00
model: sonnet # Optional: provider inherited from .archon/config.yaml
loop:
until: "All validations pass"
max_iterations: 10
fresh_context: true
prompt: |
Continue implementing the plan. Run validation after each change.
Signal completion with: "All validations pass"
```
**How workflows are invoked:**
- AI routes to workflows automatically based on user intent
- Workflows use commands defined in `.archon/commands/`
- Only one workflow can run per conversation at a time
**Managing workflows:**
```
/workflow list # Show available workflows
/workflow reload # Reload definitions after editing
/workflow cancel # Cancel a running workflow
```
</details>
2025-11-12 15:10:34 +00:00
---
## Architecture
### System Overview
```
┌─────────────────────────────────────────────────────────┐
│ Platform Adapters (Telegram, Slack, Discord, GitHub) │
└──────────────────────────┬──────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ Orchestrator │
│ (Message Routing & Context Management) │
└─────────────┬───────────────────────────┬───────────────┘
│ │
┌───────┴────────┐ ┌───────┴────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌───────────┐ ┌────────────┐ ┌──────────────────────────┐
│ Command │ │ Workflow │ │ AI Assistant Clients │
│ Handler │ │ Executor │ │ (Claude / Codex) │
│ (Slash) │ │ (YAML) │ │ │
└───────────┘ └────────────┘ └──────────────────────────┘
│ │ │
└──────────────┴──────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ PostgreSQL (6 Tables) │
│ Codebases • Conversations • Sessions • Workflow Runs │
│ Command Templates • Isolation Environments │
└─────────────────────────────────────────────────────────┘
2025-11-12 15:10:34 +00:00
```
### Key Design Patterns
- **Adapter Pattern**: Platform-agnostic via `IPlatformAdapter` interface
- **Strategy Pattern**: Swappable AI assistants via `IAssistantClient` interface
- **Session Persistence**: AI context survives restarts via database storage
- **Generic Commands**: User-defined markdown commands versioned with Git
- **Workflow Engine**: YAML-based multi-step automation with step and loop modes
Fix stale workspace: sync before worktree creation (#287) * Investigate issue #285: stale workspace causes outdated worktrees Analyzed root cause and created implementation plan for fixing the workspace sync issue where new worktrees are created from outdated code after PRs are merged. * Fix stale workspace: sync before worktree creation When a PR is merged, subsequent worktrees were created from outdated code because the workspace was never synced after the initial clone. Changes: - Add syncWorkspace() and getDefaultBranch() helpers in git.ts - Call syncWorkspaceBeforeCreate() in WorktreeProvider before creating new worktrees - Make sync non-fatal to handle offline/permission edge cases gracefully The sync happens at the natural boundary of starting new work, ensuring new issues/PRs always start from the latest code without disrupting existing in-progress worktrees. Fixes #285 * Address PR review feedback: data safety and test coverage - Add uncommitted changes check in syncWorkspace() before git reset --hard to prevent accidental data loss (returns false if changes detected) - Add logging to getDefaultBranch() fallback paths for better debugging when symbolic-ref fails and fallback to main/master is used - Add integration tests verifying sync is called during worktree creation - Add tests for sync failure scenarios (non-fatal behavior) - Add test for checkout failure in syncWorkspace() - Update worktree.ts to handle new boolean return from syncWorkspace() * simplify: flatten getDefaultBranch fallback logic Remove verbose logging in getDefaultBranch function. The fallback from symbolic-ref to checking origin/main to defaulting to master is expected behavior that doesn't need logging at the info level. Flatten nested try-catch into sequential blocks for better readability. * docs: document workspace sync behavior before worktree creation * Address PR review feedback: error handling and test coverage - Add logging to empty catch blocks in getDefaultBranch() (critical) - Add operation context to syncWorkspace() error messages - Differentiate error severity in syncWorkspaceBeforeCreate(): - Permission errors and corruption logged at ERROR level - Network/timeout errors logged at WARN level - Update syncWorkspace JSDoc with reset --hard warning - Remove redundant inline comment before sync call - Add tests for: - Non-standard branch names (develop, trunk) - Timeout parameter verification - Operation context in error messages - Sync skipped when adopting existing worktree
2026-01-19 11:07:56 +00:00
- **Worktree Isolation**: Git worktrees enable parallel work per conversation, auto-synced with origin before creation
2025-11-12 15:10:34 +00:00
- **Concurrency Control**: Lock manager prevents race conditions
### Database Schema
2025-11-12 15:51:46 +00:00
<details>
<summary><b>6 tables with `remote_agent_` prefix</b></summary>
2025-11-12 15:10:34 +00:00
1. **`remote_agent_codebases`** - Repository metadata
- Commands stored as JSONB: `{command_name: {path, description}}`
- AI assistant type per codebase
- Default working directory
2. **`remote_agent_conversations`** - Platform conversation tracking
- Platform type + conversation ID (unique constraint)
- Linked to codebase via foreign key
- AI assistant type locked at creation
3. **`remote_agent_sessions`** - AI session management
- Active session flag (one per conversation)
- Session ID for resume capability
- Metadata JSONB for command context
4. **`remote_agent_command_templates`** - Global command templates
- Shared command definitions (like `/plan`, `/commit`)
- Available across all codebases
5. **`remote_agent_isolation_environments`** - Worktree isolation
- Tracks git worktrees per issue/PR
- Enables worktree sharing between linked issues and PRs
6. **`remote_agent_workflow_runs`** - Workflow execution tracking
- Tracks active workflows per conversation
- Prevents concurrent workflow execution
- Stores workflow state and step progress
2025-11-12 15:51:46 +00:00
</details>
2025-11-12 15:10:34 +00:00
---
## Troubleshooting
### Bot Not Responding
2025-11-12 15:10:34 +00:00
**Check if application is running:**
```bash
2025-11-12 15:51:46 +00:00
docker compose ps
# Should show 'app' or 'app-with-db' with state 'Up'
2025-11-12 15:10:34 +00:00
```
2025-11-12 15:10:34 +00:00
**Check application logs:**
```bash
docker compose logs -f app # If using --profile external-db
docker compose logs -f app-with-db # If using --profile with-db
2025-11-12 15:10:34 +00:00
```
2025-11-12 15:10:34 +00:00
**Verify bot token:**
```bash
# In your .env file
cat .env | grep TELEGRAM_BOT_TOKEN
```
**Test with health check:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
curl http://localhost:3090/health
2025-11-12 15:10:34 +00:00
# Expected: {"status":"ok"}
```
### Database Connection Errors
2025-11-12 15:10:34 +00:00
**Check database health:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
curl http://localhost:3090/health/db
2025-11-12 15:10:34 +00:00
# Expected: {"status":"ok","database":"connected"}
```
2025-11-12 15:10:34 +00:00
**For local PostgreSQL (`with-db` profile):**
```bash
# Check if postgres container is running
2025-11-12 15:51:46 +00:00
docker compose ps postgres
2025-11-12 15:10:34 +00:00
# Check postgres logs
2025-11-12 15:51:46 +00:00
docker compose logs -f postgres
2025-11-12 15:10:34 +00:00
# Test direct connection
2025-11-12 15:51:46 +00:00
docker compose exec postgres psql -U postgres -c "SELECT 1"
2025-11-12 15:10:34 +00:00
```
**For remote PostgreSQL:**
```bash
# Verify DATABASE_URL
echo $DATABASE_URL
2025-11-12 15:10:34 +00:00
# Test connection directly
psql $DATABASE_URL -c "SELECT 1"
```
**Verify tables exist:**
```bash
# For local postgres
2025-11-12 15:51:46 +00:00
docker compose exec postgres psql -U postgres -d remote_coding_agent -c "\dt"
2025-11-12 15:10:34 +00:00
# Should show: remote_agent_codebases, remote_agent_conversations, remote_agent_sessions,
# remote_agent_command_templates, remote_agent_isolation_environments
```
### Clone Command Fails
2025-11-12 15:10:34 +00:00
**Verify GitHub token:**
```bash
2025-11-12 15:10:34 +00:00
cat .env | grep GH_TOKEN
# Should have both GH_TOKEN and GITHUB_TOKEN set
```
2025-11-12 15:10:34 +00:00
**Test token validity:**
```bash
# Test GitHub API access
curl -H "Authorization: token $GH_TOKEN" https://api.github.com/user
```
**Check workspace permissions:**
```bash
# Use the service name matching your profile
docker compose exec app ls -la /.archon/workspaces # --profile external-db
docker compose exec app-with-db ls -la /.archon/workspaces # --profile with-db
2025-11-12 15:10:34 +00:00
```
**Try manual clone:**
```bash
docker compose exec app git clone https://github.com/user/repo /.archon/workspaces/test-repo
# Or app-with-db if using --profile with-db
2025-11-12 15:10:34 +00:00
```
### GitHub Webhook Not Triggering
**Verify webhook delivery:**
1. Go to your webhook settings in GitHub
2. Click on the webhook
3. Check "Recent Deliveries" tab
4. Look for successful deliveries (green checkmark)
**Check webhook secret:**
```bash
cat .env | grep WEBHOOK_SECRET
# Must match exactly what you entered in GitHub
```
2025-11-12 15:10:34 +00:00
**Verify ngrok is running (local dev):**
```bash
# Check ngrok status
curl http://localhost:4040/api/tunnels
# Or visit http://localhost:4040 in browser
```
**Check application logs for webhook processing:**
```bash
docker compose logs -f app | grep GitHub # --profile external-db
docker compose logs -f app-with-db | grep GitHub # --profile with-db
```
### TypeScript Compilation Errors
2025-11-12 15:10:34 +00:00
**Clean and rebuild:**
```bash
# Stop containers (use the profile you started with)
docker compose --profile external-db down # or --profile with-db
2025-11-12 15:10:34 +00:00
# Clean build
rm -rf dist node_modules
Migrate from Node.js/npm/Jest to Bun runtime (#85) * Migrate from Node.js/npm/Jest to Bun runtime - Replace npm with bun for package management (bun.lock) - Replace Jest with bun:test for testing - Update tsconfig for Bun (ESNext module, bundler resolution) - Update Dockerfile to use oven/bun:1-slim - Update CI workflow to use oven-sh/setup-bun@v2 - Remove dynamic import hack from codex.ts (direct ESM imports) - Fix test mocking for Bun (export execFileAsync, use spyOn) - Update all documentation (CLAUDE.md, README.md, CONTRIBUTING.md) All 395 tests pass, type-check passes, E2E validated with curl. * ci: retrigger CI build * fix: make execFileAsync a function for better Bun mockability * fix: ensure execFileAsync returns string not Buffer * fix: rename _execFileAsync to comply with naming convention * fix: make mkdirAsync mockable for Bun tests * fix: update engines to bun>=1.0.0 and add mkdirAsync mock * fix: pin Bun to 1.3.4 in CI to fix mock.module test failures Newer Bun versions have different mock.module() behavior that causes cross-test module pollution, resulting in 71 test failures in CI while tests pass locally. Pinning to 1.3.4 ensures consistent behavior. * fix: run orchestrator tests last to avoid mock.module pollution Bun's mock.module() pollutes the global module cache, causing tests to fail when orchestrator.test.ts (which mocks command-handler and factory) runs before those modules' own test files. Fix by running tests in two batches: 1. All tests except orchestrator 2. Orchestrator tests last This ensures orchestrator's mocks don't affect other test files.
2025-12-16 13:34:58 +00:00
bun install
bun run build
# Restart (use the profile you need)
docker compose --profile external-db up -d --build # or --profile with-db
2025-11-12 15:10:34 +00:00
```
**Check for type errors:**
```bash
Migrate from Node.js/npm/Jest to Bun runtime (#85) * Migrate from Node.js/npm/Jest to Bun runtime - Replace npm with bun for package management (bun.lock) - Replace Jest with bun:test for testing - Update tsconfig for Bun (ESNext module, bundler resolution) - Update Dockerfile to use oven/bun:1-slim - Update CI workflow to use oven-sh/setup-bun@v2 - Remove dynamic import hack from codex.ts (direct ESM imports) - Fix test mocking for Bun (export execFileAsync, use spyOn) - Update all documentation (CLAUDE.md, README.md, CONTRIBUTING.md) All 395 tests pass, type-check passes, E2E validated with curl. * ci: retrigger CI build * fix: make execFileAsync a function for better Bun mockability * fix: ensure execFileAsync returns string not Buffer * fix: rename _execFileAsync to comply with naming convention * fix: make mkdirAsync mockable for Bun tests * fix: update engines to bun>=1.0.0 and add mkdirAsync mock * fix: pin Bun to 1.3.4 in CI to fix mock.module test failures Newer Bun versions have different mock.module() behavior that causes cross-test module pollution, resulting in 71 test failures in CI while tests pass locally. Pinning to 1.3.4 ensures consistent behavior. * fix: run orchestrator tests last to avoid mock.module pollution Bun's mock.module() pollutes the global module cache, causing tests to fail when orchestrator.test.ts (which mocks command-handler and factory) runs before those modules' own test files. Fix by running tests in two batches: 1. All tests except orchestrator 2. Orchestrator tests last This ensures orchestrator's mocks don't affect other test files.
2025-12-16 13:34:58 +00:00
bun run type-check
```
### Container Won't Start
2025-11-12 15:10:34 +00:00
**Check logs for specific errors:**
```bash
docker compose logs app # If using --profile external-db
docker compose logs app-with-db # If using --profile with-db
2025-11-12 15:10:34 +00:00
```
2025-11-12 15:10:34 +00:00
**Verify environment variables:**
```bash
# Check if .env is properly formatted (include your profile)
docker compose --profile external-db config # or --profile with-db
2025-11-12 15:10:34 +00:00
```
2025-11-12 15:10:34 +00:00
**Rebuild without cache:**
```bash
docker compose --profile external-db build --no-cache # or --profile with-db
docker compose --profile external-db up -d # or --profile with-db
```
2025-11-12 15:10:34 +00:00
**Check port conflicts:**
```bash
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
# See if port 3090 is already in use
2025-11-12 15:10:34 +00:00
# Linux/Mac:
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
lsof -i :3090
2025-11-12 15:10:34 +00:00
# Windows:
feat: Phase 4 - Express to Hono migration (#318) * feat: Phase 4 - Express to Hono migration Replace Express with Hono in @archon/server for improved performance and better Bun integration. This is a focused HTTP layer migration that preserves all existing API functionality. Changes: - Replace express with hono dependency - Migrate all endpoints to Hono context-based handlers - Use Bun.serve() for native Bun server integration - Update optional parameter syntax from Express 5 to Hono style - Remove express.json()/express.raw() middleware (Hono handles natively) - Change default port from 3000 to 3090 - Update log prefixes from [Express] to [Hono] - Update CLAUDE.md documentation references All endpoints verified working: - GET /health, /health/db, /health/concurrency - POST /test/message, GET /test/messages/:id - DELETE /test/messages/:id?, PUT /test/mode - POST /webhooks/github (signature verification) * refactor: Simplify Hono endpoint handlers - Remove unnecessary try/catch from /health/concurrency endpoint (getStats() is a simple sync operation that doesn't need error handling) - Remove outer try/catch from /test/message endpoint (validation returns early, processing is fire-and-forget with its own error handler) - Consolidate validation checks with clearer error messages - Reduce nesting depth for improved readability Total: 12 lines removed while maintaining identical functionality * docs: Update port references from 3000 to 3090 after Hono migration * fix: Improve error handling in Hono endpoints - Add global app.onError() handler for consistent unhandled exception responses - Add explicit JSON parsing error handling to /test/message endpoint (returns 400 instead of 500) - Add explicit JSON parsing error handling to /test/mode endpoint (was completely unhandled) - Fix CLAUDE.md worktree port example to use correct port (3637 with base 3090)
2026-01-21 11:23:34 +00:00
netstat -ano | findstr :3090
2025-11-12 15:10:34 +00:00
```
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
---
## Windows (WSL2 Setup)
Archon CLI requires WSL2 (Windows Subsystem for Linux 2) on Windows. Native Windows binaries are not currently supported.
### Why WSL2?
The Archon CLI relies on Unix-specific features and tools:
- Git worktree operations with symlinks
- Shell scripting for AI agent execution
- File system operations that differ between Windows and Unix
WSL2 provides a full Linux environment that runs seamlessly on Windows.
### Quick WSL2 Setup
1. **Install WSL2** (requires Windows 10 version 2004+ or Windows 11):
```powershell
wsl --install
```
This installs Ubuntu by default. Restart your computer when prompted.
2. **Set up Ubuntu**:
Open "Ubuntu" from the Start menu and create a username/password.
3. **Install Bun in WSL2**:
```bash
curl -fsSL https://bun.sh/install | bash
source ~/.bashrc
```
4. **Clone and install Archon**:
```bash
git clone https://github.com/dynamous-community/remote-coding-agent
cd remote-coding-agent
bun install
```
5. **Make CLI globally available**:
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
cd packages/cli
bun link
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
6. **Verify installation**:
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```bash
archon version
```
### Working with Windows Files
WSL2 can access your Windows files at `/mnt/c/` (for C: drive):
```bash
archon workflow run assist --cwd /mnt/c/Users/YourName/Projects/my-repo "What does this code do?"
feat: Phase 5 - CLI binary distribution (#325) * docs: Add Phase 5 CLI binary distribution plan - Create detailed implementation plan for binary distribution - Add Phase 5.0: Bundle defaults for binary (depends on #322) - Add Phase 5.1-5.7: Build scripts, GitHub Actions, curl install, Homebrew formula, Windows docs, version command, release guide - Update research doc with Phase 6 (auto-update command) - Renumber dashboard to Phase 7, workflow builder to Phase 8 - Mark Phases 1-4 as complete in research doc * feat: Phase 5 - CLI binary distribution Implement standalone binary distribution for Archon CLI: - Bundle default commands and workflows into binaries at compile time - Add build scripts for cross-platform compilation (macOS/Linux, ARM64/x64) - Create GitHub Actions release workflow triggered on version tags - Add curl install script with checksum verification - Create Homebrew formula for macOS/Linux installation - Update version command to show platform, build type, and database info - Add developer release guide documentation - Update README with CLI installation instructions Binary compilation uses Bun's --compile flag to create standalone executables that include the Bun runtime and all dependencies. Default workflows and commands are imported as text at compile time and embedded directly into the binary. * fix: Pin Dockerfile to Bun 1.3.4 to match lockfile version The Docker build was failing because oven/bun:1-slim resolved to 1.3.6 while the lockfile was created with 1.3.4, causing --frozen-lockfile to fail. * docs: Clarify binary vs source builds for default commands/workflows * fix: Address PR review issues for CLI binary distribution Security fixes: - install.sh: Require SKIP_CHECKSUM=true to bypass checksum verification instead of silently skipping (addresses security vulnerability) - install.sh: Show actual error output when version check fails instead of falsely reporting success Validation improvements: - checksums.sh: Validate all 4 expected binaries exist before generating checksums to prevent releasing incomplete builds - build-binaries.sh: Verify binary exists and has reasonable size (>1MB) after each build step - update-homebrew.sh: Validate extracted checksums are non-empty and look like valid SHA256 hashes (64 hex chars) - update-homebrew.sh: Fix sed patterns to use URL context for updating checksums on subsequent runs Bug fixes: - homebrew/archon.rb: Fix test to expect exit code 0 (success) instead of 1 for `archon version` - loader.ts: Log error when bundled workflow fails to parse (indicates build-time corruption) Test coverage: - Add bundled-defaults.test.ts for isBinaryBuild() and content validation - Add connection.test.ts for getDatabaseType() function - Add binary build bundled workflow tests to loader.test.ts - Add binary build bundled command tests to executor.test.ts All 959 tests pass.
2026-01-21 21:51:51 +00:00
```
For best performance, keep projects inside the WSL2 file system (`~/projects/`) rather than `/mnt/c/`.
### Tips
- **VS Code Integration**: Install "Remote - WSL" extension to edit WSL2 files from VS Code
- **Terminal**: Windows Terminal provides excellent WSL2 support
- **Git**: Use Git inside WSL2 for consistent behavior with Archon