feat: CLI commands, always-on Unix socket, and log file tailing#1
Merged
sylvesterdamgaard merged 18 commits intomainfrom Apr 17, 2026
Merged
feat: CLI commands, always-on Unix socket, and log file tailing#1sylvesterdamgaard merged 18 commits intomainfrom
sylvesterdamgaard merged 18 commits intomainfrom
Conversation
… use Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The daemon now always starts a Unix socket listener regardless of the api_enabled config setting. This ensures local CLI tools and the TUI can communicate with the daemon even when the TCP API port is not exposed. When api_enabled is true, both TCP and socket start as before. When api_enabled is false, only the socket listener starts (socket-only mode) with no ACL or rate limiting since file permissions provide security. Socket permissions changed from 0600 to 0660 to allow group access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `cbox-init list` to display a table of all managed processes with state, scale, restart count, and uptime. Add `cbox-init status <name>` for detailed single-process info including instances, resource usage, and schedule state. Both commands use the shared apiclient with auto-discovery of Unix sockets and --url flag override. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add process control commands that connect to the running daemon via API: - `cbox-init start <name>` / `stop <name>` / `restart <name>` - `cbox-init scale <name> <count>` with input validation - `cbox-init reload-config` to hot-reload configuration All commands share the newClient() helper from list.go, supporting --url flag and CBOX_INIT_API_AUTH env var. Also updates root.go to register all new commands and refresh the help examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add LogFileConfig and RotateConfig structs to support per-process log file tailing configuration. Each log file gets its own pipeline config for level detection, multiline handling, JSON parsing, and filtering. Also adds ParseSize helper for human-readable size strings and a Files map field to LoggingConfig. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add validation for log file path (required), rotate.max_size (ParseSize), and rotate.max_files (non-negative). Add defaults for file-level multiline (max_lines=100, timeout=1s), level detection (default_level=info), and rotation (max_files=5). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire file tailers into the Supervisor so that configured log files are tailed when the supervisor starts and stopped on shutdown. Tailers are config-bound (survive process restarts) and each gets a ProcessWriter with inherited redaction config plus per-file logging settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add specs and plans for: - CLI commands & always-on Unix socket - Log file tailing with rotation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
api_enabled, enabling local management (cbox-init tui, CLI commands) without exposing a TCP portlist,status,start,stop,restart,scale,reload-config, and reworkedlogswith SSE streaming (-fflag)internal/tui/client.gotointernal/apiclient/for shared CLI/TUI use/api/v1/logs/streamendpoint + client for real-time log tailinglogging.filesconfig to tail local app log files (e.g., Laravel'sstorage/logs/laravel.log) through the same pipeline as stdout/stderr (JSON parsing, level detection, filtering, redaction)rotateconfig per log file (max_size,max_files)New CLI commands
Log file tailing config example
Test plan
go test ./... -count=1)internal/logtail/package: 11 tests (rotator + tailer)internal/apiclient/package: 31 tests (client + SSE stream)internal/logger/subscriber_test.go: 5 broadcaster testscheck-configvalidates log file tailing config correctly--helpshows all new commandsdocker execinto container, runcbox-init tuivia socketcbox-init logs -fstreams real-time entries