feat: unify mosaic CLI — single binary, no PATH conflict
- Rename framework bash launcher: mosaic → mosaic-launch
- npm CLI (@mosaic/cli) is now the single 'mosaic' binary on PATH
- Add launcher delegation: mosaic {claude,codex,opencode,pi,yolo}
delegates to mosaic-launch via execFileSync with inherited stdio
- Add delegated management commands: init, doctor, sync, seq,
bootstrap, coord, upgrade
- install.sh: remove framework bin PATH requirement, clean up old
mosaic binary on upgrade, simplified summary output
- framework install.sh: preserve sources/ dir (fixes rsync noise
about agent-skills)
- session-run.sh: update references to mosaic-launch
Users now only need ~/.npm-global/bin on PATH. The npm CLI finds
mosaic-launch at its absolute path (~/.config/mosaic/bin/mosaic-launch).
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# mosaic — Unified agent launcher and management CLI
|
||||
# mosaic-launch — Framework agent launcher (called by the mosaic npm CLI)
|
||||
#
|
||||
# AGENTS.md is the global policy source for all agent sessions.
|
||||
# The launcher injects a composed runtime contract (AGENTS + runtime reference).
|
||||
#
|
||||
# Usage:
|
||||
# Usage (via mosaic CLI):
|
||||
# mosaic claude [args...] Launch Claude Code with runtime contract injected
|
||||
# mosaic opencode [args...] Launch OpenCode with runtime contract injected
|
||||
# mosaic codex [args...] Launch Codex with runtime contract injected
|
||||
# mosaic opencode [args...] Launch OpenCode with runtime contract injected
|
||||
# mosaic pi [args...] Launch Pi with runtime contract injected
|
||||
# mosaic yolo <runtime> [args...] Launch runtime in dangerous-permissions mode
|
||||
# mosaic --yolo <runtime> [args...] Alias for yolo
|
||||
# mosaic init [args...] Generate SOUL.md interactively
|
||||
# mosaic doctor [args...] Health audit
|
||||
# mosaic sync [args...] Sync skills
|
||||
# mosaic seq [subcommand] sequential-thinking MCP management (check/fix/start)
|
||||
# mosaic bootstrap <path> Bootstrap a repo
|
||||
# mosaic upgrade release Upgrade installed Mosaic release
|
||||
# mosaic upgrade check Check release upgrade status (no changes)
|
||||
# mosaic upgrade project [args] Upgrade project-local stale files
|
||||
#
|
||||
# Direct usage:
|
||||
# mosaic-launch claude [args...]
|
||||
# mosaic-launch yolo claude [args...]
|
||||
|
||||
MOSAIC_HOME="${MOSAIC_HOME:-$HOME/.config/mosaic}"
|
||||
VERSION="0.1.0"
|
||||
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
TARGET_DIR="${MOSAIC_HOME:-$HOME/.config/mosaic}"
|
||||
INSTALL_MODE="${MOSAIC_INSTALL_MODE:-prompt}" # prompt|keep|overwrite
|
||||
PRESERVE_PATHS=("SOUL.md" "USER.md" "TOOLS.md" "memory")
|
||||
PRESERVE_PATHS=("SOUL.md" "USER.md" "TOOLS.md" "memory" "sources")
|
||||
|
||||
# Colors (disabled if not a terminal)
|
||||
if [[ -t 1 ]]; then
|
||||
@@ -21,7 +21,7 @@ step() { echo -e "\n${BOLD}$1${RESET}"; }
|
||||
|
||||
is_existing_install() {
|
||||
[[ -d "$TARGET_DIR" ]] || return 1
|
||||
[[ -f "$TARGET_DIR/bin/mosaic" || -f "$TARGET_DIR/AGENTS.md" || -f "$TARGET_DIR/SOUL.md" ]]
|
||||
[[ -f "$TARGET_DIR/bin/mosaic-launch" || -f "$TARGET_DIR/bin/mosaic" || -f "$TARGET_DIR/AGENTS.md" || -f "$TARGET_DIR/SOUL.md" ]]
|
||||
}
|
||||
|
||||
select_install_mode() {
|
||||
|
||||
@@ -80,11 +80,11 @@ echo -e "${C_CYAN}Capsule:${C_RESET} $(next_task_capsule_path "$PROJECT")"
|
||||
|
||||
cd "$PROJECT"
|
||||
if [[ "$YOLO" == true ]]; then
|
||||
exec "$MOSAIC_HOME/bin/mosaic" yolo "$runtime" "$launch_prompt"
|
||||
exec "$MOSAIC_HOME/bin/mosaic-launch" yolo "$runtime" "$launch_prompt"
|
||||
elif [[ "$runtime" == "claude" ]]; then
|
||||
exec "$MOSAIC_HOME/bin/mosaic" claude "$launch_prompt"
|
||||
exec "$MOSAIC_HOME/bin/mosaic-launch" claude "$launch_prompt"
|
||||
elif [[ "$runtime" == "codex" ]]; then
|
||||
exec "$MOSAIC_HOME/bin/mosaic" codex "$launch_prompt"
|
||||
exec "$MOSAIC_HOME/bin/mosaic-launch" codex "$launch_prompt"
|
||||
fi
|
||||
|
||||
echo -e "${C_RED}Unsupported coord runtime: $runtime${C_RESET}" >&2
|
||||
|
||||
Reference in New Issue
Block a user