1717
1818const fs = require ( 'fs' ) ;
1919const path = require ( 'path' ) ;
20+ const os = require ( 'os' ) ;
2021const https = require ( 'https' ) ;
2122
2223const REPO_RAW = 'https://raw.githubusercontent.com/Aryanpanwar10005/seo-geo-optimizer/main/skill/SEO_GEO_SKILL.md' ;
@@ -59,6 +60,13 @@ const IDE_TARGETS = {
5960 fallback : null ,
6061 note : 'Appended to your Bolt project prompt file.'
6162 } ,
63+ antigravity : {
64+ name : 'antigravity' ,
65+ detection : [ '.gemini' ] ,
66+ primary : path . join ( os . homedir ( ) , '.gemini' , 'GEMINI.md' ) ,
67+ fallback : null ,
68+ note : 'Global installation - available in all projects'
69+ } ,
6270 generic : {
6371 name : 'Generic / Any AI IDE' ,
6472 detection : [ ] ,
@@ -113,9 +121,16 @@ ${c.bold}OPTIONS${c.reset}
113121 ${ c . cyan } --copilot${ c . reset } Install for GitHub Copilot (VS Code)
114122 ${ c . cyan } --lovable${ c . reset } Install for Lovable
115123 ${ c . cyan } --bolt${ c . reset } Install for Bolt
124+ ${ c . cyan } --antigravity${ c . reset } Install for Google Antigravity (Global)
116125 ${ c . cyan } --all${ c . reset } Install for all supported IDEs at once
117126 ${ c . cyan } --help${ c . reset } Show this help
118127
128+ ${ c . bold } EXAMPLES${ c . reset }
129+ npx seo-geo-optimizer # Auto-detect and install
130+ npx seo-geo-optimizer --cursor # Install for Cursor only
131+ npx seo-geo-optimizer --antigravity # Install globally for Antigravity
132+ npx seo-geo-optimizer --all # Install for all IDEs
133+
119134${ c . bold } MANUAL INSTALL${ c . reset }
120135 Copy the raw skill file from:
121136 ${ c . gray } https://raw.githubusercontent.com/Aryanpanwar10005/seo-geo-optimizer/main/skill/SEO_GEO_SKILL.md${ c . reset }
@@ -166,7 +181,17 @@ function downloadSkill(url) {
166181
167182function installToTarget ( ideKey , skillContent , cwd ) {
168183 const ide = IDE_TARGETS [ ideKey ] ;
169- const targetPath = path . join ( cwd , ide . primary ) ;
184+ let targetPath = ide . primary ;
185+
186+ if ( targetPath . includes ( os . homedir ( ) ) ) {
187+ // Path already contains homedir (from path.join)
188+ targetPath = ide . primary ;
189+ } else if ( targetPath . startsWith ( '~' ) ) {
190+ targetPath = path . join ( os . homedir ( ) , targetPath . slice ( 1 ) ) ;
191+ } else if ( ! path . isAbsolute ( targetPath ) ) {
192+ targetPath = path . join ( cwd , targetPath ) ;
193+ }
194+
170195 const targetDir = path . dirname ( targetPath ) ;
171196 if ( ! fs . existsSync ( targetDir ) ) {
172197 fs . mkdirSync ( targetDir , { recursive : true } ) ;
@@ -178,8 +203,14 @@ function installToTarget(ideKey, skillContent, cwd) {
178203 log . warn ( `Existing file backed up → ${ c . gray } ${ path . relative ( cwd , backup ) } ${ c . reset } ` ) ;
179204 }
180205 fs . writeFileSync ( targetPath , skillContent , 'utf8' ) ;
181- log . success ( `${ c . bold } ${ ide . name } ${ c . reset } → ${ c . green } ${ path . relative ( cwd , targetPath ) } ${ c . reset } ` ) ;
182- log . info ( `${ c . gray } ${ ide . note } ${ c . reset } ` ) ;
206+ log . success ( `${ c . bold } ${ ide . name } ${ c . reset } → ${ c . green } ${ path . isAbsolute ( targetPath ) ? targetPath : path . relative ( cwd , targetPath ) } ${ c . reset } ` ) ;
207+
208+ if ( ideKey === 'antigravity' ) {
209+ log . info ( `${ c . yellow } ℹ Global installation - available in all projects${ c . reset } ` ) ;
210+ } else {
211+ log . info ( `${ c . gray } ${ ide . note } ${ c . reset } ` ) ;
212+ }
213+
183214 return targetPath ;
184215}
185216
@@ -198,7 +229,7 @@ async function main() {
198229 let targets = [ ] ;
199230
200231 if ( args . includes ( '--all' ) ) {
201- targets = [ 'cursor' , 'windsurf' , 'copilot' , 'lovable' , 'bolt' ] ;
232+ targets = [ 'cursor' , 'windsurf' , 'copilot' , 'lovable' , 'bolt' , 'antigravity' ] ;
202233 log . title ( 'Installing for ALL supported IDEs' ) ;
203234 } else if ( args . includes ( '--cursor' ) ) {
204235 targets = [ 'cursor' ] ;
@@ -215,6 +246,9 @@ async function main() {
215246 } else if ( args . includes ( '--bolt' ) ) {
216247 targets = [ 'bolt' ] ;
217248 log . title ( 'Installing for Bolt' ) ;
249+ } else if ( args . includes ( '--antigravity' ) ) {
250+ targets = [ 'antigravity' ] ;
251+ log . title ( 'Installing for Google Antigravity' ) ;
218252 } else {
219253 log . title ( 'Auto-detecting your IDE...' ) ;
220254 targets = detectIDE ( cwd ) ;
@@ -252,11 +286,13 @@ async function main() {
252286 for ( const ideKey of targets ) {
253287 try {
254288 const filePath = installToTarget ( ideKey , skillContent , cwd ) ;
255- installed . push ( { ide : IDE_TARGETS [ ideKey ] . name , path : path . relative ( cwd , filePath ) } ) ;
289+ const displayPath = path . isAbsolute ( IDE_TARGETS [ ideKey ] . primary ) ? filePath : path . relative ( cwd , filePath ) ;
290+ installed . push ( { ide : IDE_TARGETS [ ideKey ] . name , path : displayPath } ) ;
256291 log . blank ( ) ;
257292 } catch ( err ) {
258293 log . error ( `Failed to install for ${ IDE_TARGETS [ ideKey ] . name } : ${ err . message } ` ) ;
259294 failed . push ( IDE_TARGETS [ ideKey ] . name ) ;
295+ if ( ideKey === 'antigravity' ) process . exit ( 1 ) ;
260296 }
261297 }
262298
0 commit comments