skillpull 0.2.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/install.sh +4 -35
  2. package/package.json +1 -1
  3. package/skillpull +113 -2
package/install.sh CHANGED
@@ -3,10 +3,8 @@ set -euo pipefail
3
3
 
4
4
  INSTALL_DIR="${SKILLPULL_INSTALL_DIR:-$HOME/.local/bin}"
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
- CONFIG_DIR="$HOME/.config/skillpull"
7
- CONFIG_FILE="$CONFIG_DIR/config.json"
8
6
 
9
- GREEN='\033[1;32m'; CYAN='\033[1;36m'; DIM='\033[2m'; RESET='\033[0m'
7
+ GREEN='\033[1;32m'; DIM='\033[2m'; RESET='\033[0m'
10
8
 
11
9
  mkdir -p "$INSTALL_DIR"
12
10
  cp "$SCRIPT_DIR/skillpull" "$INSTALL_DIR/skillpull"
@@ -19,36 +17,7 @@ if ! echo "$PATH" | tr ':' '\n' | grep -qx "$INSTALL_DIR"; then
19
17
  echo " Add to PATH: export PATH=\"$INSTALL_DIR:\$PATH\""
20
18
  fi
21
19
 
22
- # ── Setup default skill repository ──
23
20
  echo ""
24
- printf " ${CYAN}Set up a default skill repository?${RESET}\n"
25
- printf " ${DIM}This lets you run 'skillpull <skill-name>' without typing the full URL.${RESET}\n"
26
- printf " ${DIM}Supports: user/repo, full URL, or leave blank to skip.${RESET}\n"
27
- echo ""
28
- printf " Skill repo: "
29
- read -r repo_input
30
-
31
- if [[ -n "$repo_input" ]]; then
32
- # Resolve shortname to full URL
33
- resolved="$repo_input"
34
- if [[ "$repo_input" != *"://"* && "$repo_input" != git@* ]]; then
35
- if [[ "$repo_input" == */* && "$(echo "$repo_input" | tr -cd '/' | wc -c)" == "1" ]]; then
36
- resolved="https://github.com/${repo_input}.git"
37
- fi
38
- fi
39
-
40
- mkdir -p "$CONFIG_DIR"
41
- if [[ -f "$CONFIG_FILE" ]]; then
42
- sed -i "s|\"registry\":\"[^\"]*\"|\"registry\":\"${resolved}\"|" "$CONFIG_FILE"
43
- else
44
- echo "{\"aliases\":{},\"registry\":\"${resolved}\"}" > "$CONFIG_FILE"
45
- fi
46
-
47
- printf " ${GREEN}✓${RESET} Default registry set to: %s\n" "$resolved"
48
- printf " ${DIM}Now you can run: skillpull <skill-name>${RESET}\n"
49
- else
50
- printf " ${DIM}Skipped. You can set it later: skillpull registry <user/repo>${RESET}\n"
51
- fi
52
-
53
- echo ""
54
- printf " ${GREEN}Done!${RESET} Run 'skillpull --help' to get started.\n"
21
+ printf " ${DIM}Get started:${RESET}\n"
22
+ printf " ${DIM} skillpull init # Setup default skill repo${RESET}\n"
23
+ printf " ${DIM} skillpull --help # See all commands${RESET}\n"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillpull",
3
- "version": "0.2.1",
3
+ "version": "0.3.2",
4
4
  "description": "Sync AI agent skills from Git repositories to Claude, Codex, Kiro, and Cursor",
5
5
  "bin": {
6
6
  "skillpull": "./skillpull"
package/skillpull CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- VERSION="0.2.1"
4
+ VERSION="0.3.2"
5
5
  MANIFEST_FILE=".skillpull.json"
6
6
  TMPDIR_PREFIX="skillpull"
7
7
  CONFIG_DIR="$HOME/.config/skillpull"
@@ -669,6 +669,89 @@ cmd_push() {
669
669
  info "Done. $pushed skill(s) pushed to $resolved"
670
670
  }
671
671
 
672
+ cmd_uninstall() {
673
+ local global_bin="${SKILLPULL_INSTALL_DIR:-$HOME/.local/bin}/skillpull"
674
+
675
+ printf "\n ${CYAN}Uninstall skillpull${RESET}\n\n"
676
+
677
+ # Remove binary
678
+ if [[ -f "$global_bin" ]]; then
679
+ rm -f "$global_bin"
680
+ info "Removed $global_bin"
681
+ else
682
+ dim "Binary not found at $global_bin"
683
+ fi
684
+
685
+ # Ask about config
686
+ if [[ -d "$CONFIG_DIR" ]]; then
687
+ printf " Remove config (~/.config/skillpull)? (y/n) "
688
+ read -r yn
689
+ if [[ "$yn" == "y" || "$yn" == "Y" ]]; then
690
+ rm -rf "$CONFIG_DIR"
691
+ info "Removed $CONFIG_DIR"
692
+ else
693
+ dim "Config kept at $CONFIG_DIR"
694
+ fi
695
+ fi
696
+
697
+ # npm global
698
+ if command -v npm &>/dev/null && npm ls -g skillpull &>/dev/null 2>&1; then
699
+ printf " Also run 'npm uninstall -g skillpull'? (y/n) "
700
+ read -r yn
701
+ if [[ "$yn" == "y" || "$yn" == "Y" ]]; then
702
+ npm uninstall -g skillpull
703
+ info "npm global package removed"
704
+ fi
705
+ fi
706
+
707
+ echo ""
708
+ info "skillpull uninstalled."
709
+ }
710
+
711
+ cmd_init() {
712
+ ensure_config
713
+ local current; current="$(read_config_key "registry")"
714
+
715
+ printf "\n ${CYAN}Welcome to skillpull!${RESET}\n\n"
716
+ printf " Set a default skill repository so you can pull skills by name.\n\n"
717
+ printf " ${DIM}Examples:${RESET}\n"
718
+ printf " ${DIM} tianhaocui/ai-skills GitHub shortname${RESET}\n"
719
+ printf " ${DIM} https://github.com/user/repo Full URL${RESET}\n"
720
+ printf " ${DIM} git@github.com:user/repo.git SSH URL${RESET}\n"
721
+ echo ""
722
+
723
+ if [[ -n "$current" ]]; then
724
+ printf " Current: ${GREEN}%s${RESET}\n\n" "$current"
725
+ printf " New skill repo (Enter to keep current): "
726
+ else
727
+ printf " Skill repo: "
728
+ fi
729
+
730
+ read -r repo_input
731
+
732
+ # Trim whitespace and control characters
733
+ repo_input="$(echo "$repo_input" | tr -d '[:cntrl:]' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
734
+
735
+ if [[ -z "$repo_input" ]]; then
736
+ if [[ -n "$current" ]]; then
737
+ dim "Keeping current registry: $current"
738
+ else
739
+ warn "No registry set. Run 'skillpull init' again when ready."
740
+ return 0
741
+ fi
742
+ else
743
+ local resolved; resolved="$(resolve_repo_url "$repo_input")" || return 1
744
+ set_registry "$resolved"
745
+ fi
746
+
747
+ echo ""
748
+ printf " ${CYAN}What's next:${RESET}\n"
749
+ printf " skillpull list List available skills\n"
750
+ printf " skillpull <skill-name> Pull a skill into your project\n"
751
+ printf " skillpull --help See all commands\n"
752
+ echo ""
753
+ }
754
+
672
755
  cmd_alias() {
673
756
  local subcmd="${1:-list}" name="${2:-}" url="${3:-}"
674
757
  case "$subcmd" in
@@ -737,6 +820,7 @@ usage() {
737
820
  skillpull — Sync AI agent skills from Git repositories
738
821
 
739
822
  USAGE:
823
+ skillpull init
740
824
  skillpull <source> [skill-name] [options]
741
825
  skillpull list <source>
742
826
  skillpull search <keyword>
@@ -748,6 +832,7 @@ USAGE:
748
832
  skillpull push [target-repo] [options]
749
833
  skillpull installed [--global]
750
834
  skillpull remove <skill-name> [--global]
835
+ skillpull uninstall
751
836
 
752
837
  SOURCE FORMATS:
753
838
  https://github.com/user/repo Full URL (GitHub, GitLab, any Git host)
@@ -773,6 +858,7 @@ OPTIONS:
773
858
  --version Show version
774
859
 
775
860
  EXAMPLES:
861
+ skillpull init # Setup default skill repo
776
862
  skillpull tianhaocui/ai-skills # GitHub shortname
777
863
  skillpull @work plan-first-development --global # From alias
778
864
  skillpull search coding-standards # Search GitHub
@@ -793,7 +879,24 @@ main() {
793
879
  local alias_args=()
794
880
  QUIET=0; BRANCH=""
795
881
 
796
- [[ $# -eq 0 ]] && { usage; exit 0; }
882
+ if [[ $# -eq 0 ]]; then
883
+ # If running via npx or not installed globally, auto-install
884
+ local self; self="$(realpath "$0" 2>/dev/null || echo "$0")"
885
+ local global_bin="${SKILLPULL_INSTALL_DIR:-$HOME/.local/bin}/skillpull"
886
+
887
+ if [[ "$self" != "$global_bin" && ! -f "$global_bin" ]]; then
888
+ mkdir -p "$(dirname "$global_bin")"
889
+ cp "$self" "$global_bin"
890
+ chmod +x "$global_bin"
891
+ info "Installed skillpull to $global_bin"
892
+ if ! echo "$PATH" | tr ':' '\n' | grep -qx "$(dirname "$global_bin")"; then
893
+ warn "Add to PATH: export PATH=\"$(dirname "$global_bin"):\$PATH\""
894
+ fi
895
+ else
896
+ usage
897
+ fi
898
+ exit 0
899
+ fi
797
900
 
798
901
  while [[ $# -gt 0 ]]; do
799
902
  case "$1" in
@@ -815,6 +918,8 @@ main() {
815
918
  remove) cmd="remove"; shift ;;
816
919
  update) cmd="update"; shift ;;
817
920
  push) cmd="push"; shift ;;
921
+ init) cmd="init"; shift ;;
922
+ uninstall) cmd="uninstall"; shift ;;
818
923
  search) cmd="search"; shift ;;
819
924
  alias) cmd="alias"; shift
820
925
  # Collect remaining args for alias subcommand
@@ -874,6 +979,12 @@ main() {
874
979
  search)
875
980
  cmd_search "${skill_name:-}"
876
981
  ;;
982
+ init)
983
+ cmd_init
984
+ ;;
985
+ uninstall)
986
+ cmd_uninstall
987
+ ;;
877
988
  alias)
878
989
  cmd_alias "${alias_args[@]}"
879
990
  ;;