skillpull 0.2.1 → 0.3.0

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 +39 -1
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.0",
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.0"
5
5
  MANIFEST_FILE=".skillpull.json"
6
6
  TMPDIR_PREFIX="skillpull"
7
7
  CONFIG_DIR="$HOME/.config/skillpull"
@@ -669,6 +669,38 @@ cmd_push() {
669
669
  info "Done. $pushed skill(s) pushed to $resolved"
670
670
  }
671
671
 
672
+ cmd_init() {
673
+ ensure_config
674
+ local current; current="$(read_config_key "registry")"
675
+
676
+ printf "\n ${CYAN}skillpull init${RESET}\n\n"
677
+
678
+ if [[ -n "$current" ]]; then
679
+ printf " Current registry: ${GREEN}%s${RESET}\n\n" "$current"
680
+ printf " Enter new skill repo (blank to keep current): "
681
+ else
682
+ printf " ${DIM}Set a default skill repository so you can run 'skillpull <skill-name>' directly.${RESET}\n"
683
+ printf " ${DIM}Supports: user/repo, full URL, or SSH.${RESET}\n\n"
684
+ printf " Skill repo: "
685
+ fi
686
+
687
+ read -r repo_input
688
+
689
+ if [[ -n "$repo_input" ]]; then
690
+ local resolved; resolved="$(resolve_repo_url "$repo_input")" || return 1
691
+ set_registry "$resolved"
692
+ elif [[ -z "$current" ]]; then
693
+ warn "No registry set. Run 'skillpull init' again or 'skillpull registry <repo>'."
694
+ return 0
695
+ else
696
+ dim "Keeping current registry: $current"
697
+ fi
698
+
699
+ echo ""
700
+ info "You're all set. Try: skillpull list"
701
+ echo ""
702
+ }
703
+
672
704
  cmd_alias() {
673
705
  local subcmd="${1:-list}" name="${2:-}" url="${3:-}"
674
706
  case "$subcmd" in
@@ -737,6 +769,7 @@ usage() {
737
769
  skillpull — Sync AI agent skills from Git repositories
738
770
 
739
771
  USAGE:
772
+ skillpull init
740
773
  skillpull <source> [skill-name] [options]
741
774
  skillpull list <source>
742
775
  skillpull search <keyword>
@@ -773,6 +806,7 @@ OPTIONS:
773
806
  --version Show version
774
807
 
775
808
  EXAMPLES:
809
+ skillpull init # Setup default skill repo
776
810
  skillpull tianhaocui/ai-skills # GitHub shortname
777
811
  skillpull @work plan-first-development --global # From alias
778
812
  skillpull search coding-standards # Search GitHub
@@ -815,6 +849,7 @@ main() {
815
849
  remove) cmd="remove"; shift ;;
816
850
  update) cmd="update"; shift ;;
817
851
  push) cmd="push"; shift ;;
852
+ init) cmd="init"; shift ;;
818
853
  search) cmd="search"; shift ;;
819
854
  alias) cmd="alias"; shift
820
855
  # Collect remaining args for alias subcommand
@@ -874,6 +909,9 @@ main() {
874
909
  search)
875
910
  cmd_search "${skill_name:-}"
876
911
  ;;
912
+ init)
913
+ cmd_init
914
+ ;;
877
915
  alias)
878
916
  cmd_alias "${alias_args[@]}"
879
917
  ;;