@esonhugh/claude-code 2.1.165

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 +12 -0
  2. package/bin/claude.js +33 -0
  3. package/package.json +23 -0
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # @esonhugh/claude-code
2
+
3
+ Unofficial Claude Code launch wrappers.
4
+
5
+ This package is not an official Anthropic Claude Code distribution. It installs a small launcher and resolves a platform-specific binary from optional dependency packages such as `@esonhugh/claude-code-darwin-arm64`. It does not publish this repository's source code.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ npm install -g @esonhugh/claude-code
11
+ claude --version
12
+ ```
package/bin/claude.js ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module'
3
+ import { spawnSync } from 'node:child_process'
4
+ import { existsSync } from 'node:fs'
5
+ import { dirname, join } from 'node:path'
6
+ import { fileURLToPath } from 'node:url'
7
+
8
+ const require = createRequire(import.meta.url)
9
+ const packageName = `@esonhugh/claude-code-${process.platform}-${process.arch}`
10
+ const extension = process.platform === 'win32' ? '.exe' : ''
11
+ let packageJsonPath
12
+
13
+ try {
14
+ packageJsonPath = require.resolve(`${packageName}/package.json`)
15
+ } catch {
16
+ console.error(`No @esonhugh/claude-code binary package installed for ${process.platform}-${process.arch}.`)
17
+ console.error(`Expected optional dependency: ${packageName}`)
18
+ process.exit(1)
19
+ }
20
+
21
+ const binary = join(dirname(packageJsonPath), 'bin', `claude${extension}`)
22
+
23
+ if (!existsSync(binary)) {
24
+ console.error(`Binary not found in ${packageName}: ${binary}`)
25
+ process.exit(1)
26
+ }
27
+
28
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' })
29
+ if (result.error) {
30
+ console.error(result.error.message)
31
+ process.exit(1)
32
+ }
33
+ process.exit(result.status ?? 1)
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@esonhugh/claude-code",
3
+ "version": "2.1.165",
4
+ "description": "unofficial claude code launch wrappers",
5
+ "private": false,
6
+ "type": "module",
7
+ "license": "SEE LICENSE IN README.md",
8
+ "bin": {
9
+ "claude": "./bin/claude.js"
10
+ },
11
+ "files": [
12
+ "bin/",
13
+ "README.md"
14
+ ],
15
+ "optionalDependencies": {
16
+ "@esonhugh/claude-code-darwin-arm64": "2.1.165",
17
+ "@esonhugh/claude-code-linux-x64": "2.1.165",
18
+ "@esonhugh/claude-code-win32-x64.exe": "2.1.165"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }