Skip to content

feat/configurable paths#12

Open
jcyamo wants to merge 3 commits into
blacksiders:mainfrom
jcyamo:feat/configurable-paths
Open

feat/configurable paths#12
jcyamo wants to merge 3 commits into
blacksiders:mainfrom
jcyamo:feat/configurable-paths

Conversation

@jcyamo

@jcyamo jcyamo commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Adds --skills-dir and --vault-dir flags so users can point setup.py at any paths instead of being locked to the --agent presets. The existing --agent flag remains as a shorthand; explicit path flags override it.

Also ships --dry-run, --force, and --no-color flags, and a significant internal refactor that separates the read-only planning phase from the destructive move phase.

New flags:

Flag What it does
--skills-dir PATH Override the preset's skills directory
--vault-dir PATH Override the preset's vault directory
-n / --dry-run Preview the full categorization plan without moving anything
-f / -y / --force Skip the confirmation prompt
--no-color Disable ANSI color output

Changes

  • setup.pymigrate_skills() split into build_migration_plan() (read-only scan), print_migration_summary(), print_migration_detail() (per-skill breakdown, shown in --dry-run), and execute_migration(). setup_directories() replaced by validate_directories() (no side effects). main() now returns proper exit codes. Non-interactive sessions refuse to migrate without --force.
  • README.md — Documents the new flags with examples.

Test plan

  • python setup.py --dry-run prints plan and exits without moving anything
  • python setup.py --skills-dir ~/custom/skills --vault-dir ~/custom/vault --dry-run respects both overrides
  • python setup.py --force skips confirmation and migrates
  • Running in a non-interactive context (e.g. piped stdin) without --force exits with an error
  • --no-color produces plain text output
  • --agent claude preset still works as before

jcyamo added 2 commits June 3, 2026 23:56
Add --skills-dir and --vault-dir flags so paths are no longer locked to
the two hardcoded --agent presets. --agent now provides base defaults that
explicit path flags override (additive, backward-compatible).

Harden the destructive migration (shutil.move/rmtree) per CLI guidelines:
- --dry-run previews the plan without moving or writing anything
- confirmation prompt before migrating, with --force/--yes to skip and a
  non-interactive guard that refuses without --force
- path validation: reject identical skills/vault paths or a vault nested
  inside the skills dir
- respect --no-color, NO_COLOR, TERM=dumb, and non-TTY for color output
- proper exit codes (0 success, 1 failure, 130 on Ctrl-C)

Legacy 'python setup.py install' (Install.bat/vbs) still works via
parse_known_args. Document the new flags and a custom-path example in
the README.
Dry-run previously reported only per-category counts. The skill -> category
mapping was already computed in build_migration_plan() but never printed, so
skills falling into _uncategorized vanished into a number.

Add print_migration_detail(), called from the dry-run branch, which groups the
plan by category and lists each skill folder under its destination. The
_uncategorized bucket is forced last and highlighted so unmatched skills are
easy to spot and fix before the destructive move. The interactive confirm path
keeps the compact count summary to avoid spamming the prompt at scale.
@jcyamo jcyamo marked this pull request as ready for review June 4, 2026 14:10
Ported from PR blacksiders#7 by @redlotusaustin. shutil.rmtree on a symlink
follows it into the target and destroys its contents; use unlink()
instead. Also pass the explicit dest path to shutil.move rather than
the parent category dir to remove ambiguity.
@jcyamo

jcyamo commented Jun 4, 2026

Copy link
Copy Markdown
Author

Hey @redlotusaustin — I only just noticed #7 after opening this one, and I wanted to acknowledge that you got there first. Apologies for the overlap.

Your PR had two solid fixes I hadn't included — the symlink-safe deletion and the explicit shutil.move destination. I've since ported both into this branch (crediting you in the commit message), so they'll land regardless of which PR the maintainer prefers.

Since this PR is a superset of yours — same custom path flags, plus --dry-run, --force, --no-color, path validation, proper exit codes, and a refactor that separates the read-only planning phase from the destructive move — I'm keeping it open rather than closing it in favor of yours.

I'd suggest the maintainer close #7 in favor of this one. Either way, thanks for the groundwork. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant