figma-local 1.1.0 → 1.2.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/README.md +8 -2
  2. package/bin/fig-start +28 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -51,6 +51,12 @@ npm install -g figma-local
51
51
 
52
52
  Gives you `fig` and `fig-start` globally on your PATH.
53
53
 
54
+ **Update to latest:**
55
+
56
+ ```bash
57
+ npm update -g figma-local
58
+ ```
59
+
54
60
  ### curl (one-line)
55
61
 
56
62
  ```bash
@@ -74,7 +80,7 @@ npx figma-local read
74
80
 
75
81
  ```bash
76
82
  git clone https://github.com/thepreakerebi/figma-local.git
77
- cd figma-cli
83
+ cd figma-local
78
84
  npm install && npm install -g .
79
85
  ```
80
86
 
@@ -392,7 +398,7 @@ Issues and PRs welcome. For major changes, open an issue first to discuss.
392
398
 
393
399
  ```bash
394
400
  git clone https://github.com/thepreakerebi/figma-local.git
395
- cd figma-cli
401
+ cd figma-local
396
402
  npm install
397
403
  node src/index.js --help
398
404
  npm test
package/bin/fig-start CHANGED
@@ -123,11 +123,14 @@ for arg in "$@"; do
123
123
  done
124
124
 
125
125
  if [ "$1" = "--setup" ]; then
126
- printf "${BOLD}Enter the path to your figma-cli repo:${NC} "
126
+ printf "${BOLD}Enter the absolute path to your figma-local folder:${NC} "
127
127
  read -r repo_path < /dev/tty
128
128
  repo_path="${repo_path/#\~/$HOME}"
129
- if [ ! -f "$repo_path/src/index.js" ]; then
130
- echo -e "${RED}Not a valid figma-cli repo:${NC} $repo_path"
129
+ if [[ "$repo_path" != /* ]]; then
130
+ repo_path="$(cd "$repo_path" 2>/dev/null && pwd)"
131
+ fi
132
+ if [ -z "$repo_path" ] || [ ! -f "$repo_path/src/index.js" ]; then
133
+ echo -e "${RED}Not a valid figma-local folder.${NC} Expected src/index.js inside it."
131
134
  exit 1
132
135
  fi
133
136
  save_repo_path "$repo_path"
@@ -139,21 +142,34 @@ fi
139
142
  REPO_PATH=$(get_repo_path)
140
143
 
141
144
  if [ -z "$REPO_PATH" ] || [ ! -d "$REPO_PATH" ]; then
142
- # Try to find it relative to this script
145
+ # Try to find it relative to this script (works for both git clone and npm -g installs)
143
146
  SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
144
147
  if [ -f "$SCRIPT_DIR/src/index.js" ]; then
145
148
  REPO_PATH="$SCRIPT_DIR"
146
149
  save_repo_path "$REPO_PATH"
147
150
  else
148
- echo -e "${YELLOW}figma-cli repo not configured.${NC}"
149
- printf "${BOLD}Enter the path to your figma-cli repo:${NC} "
150
- read -r REPO_PATH < /dev/tty
151
- REPO_PATH="${REPO_PATH/#\~/$HOME}"
152
- if [ ! -f "$REPO_PATH/src/index.js" ]; then
153
- echo -e "${RED}Not a valid figma-cli repo:${NC} $REPO_PATH"
154
- exit 1
151
+ # Try npm global install location
152
+ NPM_GLOBAL="$(npm root -g 2>/dev/null)/figma-local"
153
+ if [ -f "$NPM_GLOBAL/src/index.js" ]; then
154
+ REPO_PATH="$NPM_GLOBAL"
155
+ save_repo_path "$REPO_PATH"
156
+ else
157
+ echo -e "${YELLOW}figma-local repo not configured.${NC}"
158
+ echo -e "${DIM}If you installed via npm, run: fig-start --setup${NC}"
159
+ printf "${BOLD}Enter the absolute path to your figma-local folder:${NC} "
160
+ read -r REPO_PATH < /dev/tty
161
+ REPO_PATH="${REPO_PATH/#\~/$HOME}"
162
+ # Convert relative paths to absolute
163
+ if [[ "$REPO_PATH" != /* ]]; then
164
+ REPO_PATH="$(cd "$REPO_PATH" 2>/dev/null && pwd)"
165
+ fi
166
+ if [ -z "$REPO_PATH" ] || [ ! -f "$REPO_PATH/src/index.js" ]; then
167
+ echo -e "${RED}Not a valid figma-local folder.${NC} Expected src/index.js inside it."
168
+ echo -e "${DIM}Tip: use the full path, e.g. /Users/yourname/figma-local${NC}"
169
+ exit 1
170
+ fi
171
+ save_repo_path "$REPO_PATH"
155
172
  fi
156
- save_repo_path "$REPO_PATH"
157
173
  fi
158
174
  fi
159
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figma-local",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Control Figma Desktop with Claude Code. Smart read, write, and AI-prompt export. No API key required.",
5
5
  "author": "elvke",
6
6
  "license": "MIT",