fix(profile): make clone-from a full source selector

This commit is contained in:
Teknium
2026-06-13 07:33:58 -07:00
parent d146b85173
commit 9b5f7b63c6
7 changed files with 32 additions and 22 deletions
+9 -8
View File
@@ -9860,19 +9860,20 @@ def cmd_profile(args):
try:
clone_from = getattr(args, "clone_from", None)
clone_config = clone or clone_from is not None
profile_dir = create_profile(
name=name,
clone_from=clone_from,
clone_all=clone_all,
clone_config=clone,
clone_config=clone_config,
no_alias=no_alias,
no_skills=no_skills,
description=getattr(args, "description", None),
)
print(f"\nProfile '{name}' created at {profile_dir}")
if clone or clone_all:
if clone_config or clone_all:
source_label = (
getattr(args, "clone_from", None) or get_active_profile_name()
)
@@ -9886,8 +9887,8 @@ def cmd_profile(args):
f"Cloned config, .env, SOUL.md, and skills from {source_label}."
)
# Auto-clone Honcho config for the new profile (only with --clone/--clone-all)
if clone or clone_all:
# Auto-clone Honcho config for the new profile (only with clone operations)
if clone_config or clone_all:
try:
from plugins.memory.honcho.cli import clone_honcho_for_profile
@@ -9896,10 +9897,10 @@ def cmd_profile(args):
except Exception:
pass # Honcho plugin not installed or not configured
# Seed bundled skills (skip if --clone-all already copied them, or
# if --no-skills was passed — in which case seed_profile_skills()
# honors the marker file and returns skipped_opt_out=True).
if not clone_all:
# Seed bundled skills for fresh profiles only. Clone operations
# already copied the source profile's skills, including any
# user-installed or intentionally removed skills.
if not (clone_config or clone_all):
result = seed_profile_skills(profile_dir)
if result and result.get("skipped_opt_out"):
print(
+2 -2
View File
@@ -784,9 +784,9 @@ def create_profile(
Path
The newly created profile directory.
"""
if no_skills and (clone_config or clone_all):
if no_skills and (clone_from is not None or clone_config or clone_all):
raise ValueError(
"--no-skills is mutually exclusive with --clone / --clone-all "
"--no-skills is mutually exclusive with --clone / --clone-from / --clone-all "
"(cloning explicitly copies skills from the source profile)."
)
canon = normalize_profile_name(name)
+3 -3
View File
@@ -35,17 +35,17 @@ def build_profile_parser(subparsers, *, cmd_profile: Callable) -> None:
profile_create.add_argument(
"--clone",
action="store_true",
help="Copy config.yaml, .env, SOUL.md from active profile",
help="Copy config.yaml, .env, SOUL.md, and skills from active profile",
)
profile_create.add_argument(
"--clone-all",
action="store_true",
help="Full copy of active profile (all state)",
help="Full copy of active profile (all state, excluding per-profile history)",
)
profile_create.add_argument(
"--clone-from",
metavar="SOURCE",
help="Source profile to clone from (default: active)",
help="Source profile to clone from; implies --clone unless --clone-all is set",
)
profile_create.add_argument(
"--no-alias", action="store_true", help="Skip wrapper script creation"