xray-code 0.1.3 → 0.1.4

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 (2) hide show
  1. package/dist/cli.js +27 -0
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -140,6 +140,33 @@ program
140
140
  process.exit(1);
141
141
  }
142
142
  });
143
+ // ─── Install (standalone) ───────────────────────────────────────
144
+ program
145
+ .command("install")
146
+ .description("Install XRay hooks and CLAUDE.md in the current project directory")
147
+ .action(async () => {
148
+ const { existsSync, readFileSync } = await import("node:fs");
149
+ const { join } = await import("node:path");
150
+ const { homedir } = await import("node:os");
151
+ // Load config
152
+ const configPath = join(homedir(), ".xray", "config.json");
153
+ if (!existsSync(configPath)) {
154
+ console.error(" Not activated yet. Run 'npx xray-code activate <invite-code>' first.\n");
155
+ process.exit(1);
156
+ }
157
+ const config = JSON.parse(readFileSync(configPath, "utf-8"));
158
+ const client = new client_js_1.XRayClient(config.server, config.apiKey);
159
+ try {
160
+ const health = await client.health();
161
+ console.log(`\n Installing XRay into ${process.cwd()}...\n`);
162
+ (0, install_js_1.installClaude)(process.cwd(), config.server, config.apiKey, config.space || "default", health.symbols, health.uses);
163
+ console.log(`\n Done! Start a new Claude Code session to get ambient code intelligence.\n`);
164
+ }
165
+ catch (e) {
166
+ console.error(` Install failed: ${e}\n`);
167
+ process.exit(1);
168
+ }
169
+ });
143
170
  // ─── Onboarding ─────────────────────────────────────────────────
144
171
  program
145
172
  .command("init [filter]")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xray-code",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "XRay — code intelligence CLI. X-ray your codebase with instant cross-references.",
5
5
  "bin": {
6
6
  "xray": "dist/cli.js"