claude-code-termux 1.0.0 → 1.0.1

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.
@@ -35,29 +35,47 @@ if (isTermux) {
35
35
 
36
36
  // Find the Claude Code CLI entry point
37
37
  let claudeCodePath;
38
+
39
+ // Build list of possible paths for global npm installations
40
+ const possiblePaths = [
41
+ // Nested in our package's node_modules
42
+ path.join(__dirname, '..', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
43
+ // Sibling in global node_modules (npm flattens dependencies)
44
+ path.join(__dirname, '..', '..', '@anthropic-ai', 'claude-code', 'cli.mjs'),
45
+ // Termux global path
46
+ path.join(process.env.PREFIX || '', 'lib', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
47
+ // Standard Linux/Mac global paths
48
+ '/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs',
49
+ '/usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.mjs',
50
+ // Home directory npm global (npm config prefix)
51
+ path.join(process.env.HOME || '', '.npm-global', 'lib', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
52
+ path.join(process.env.HOME || '', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
53
+ ];
54
+
55
+ // Try require.resolve first (works if node can find it)
38
56
  try {
39
- // Try to resolve the claude-code package
40
57
  claudeCodePath = require.resolve('@anthropic-ai/claude-code/cli.mjs');
41
58
  } catch (err) {
42
- // Fallback: look in node_modules
43
- const possiblePaths = [
44
- path.join(__dirname, '..', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
45
- path.join(__dirname, '..', '..', '@anthropic-ai', 'claude-code', 'cli.mjs'),
46
- path.join(process.env.PREFIX || '/usr', 'lib', 'node_modules', '@anthropic-ai', 'claude-code', 'cli.mjs'),
47
- ];
48
-
59
+ // Fallback: manually check paths
49
60
  for (const p of possiblePaths) {
50
- if (fs.existsSync(p)) {
61
+ if (p && fs.existsSync(p)) {
51
62
  claudeCodePath = p;
52
63
  break;
53
64
  }
54
65
  }
66
+ }
55
67
 
56
- if (!claudeCodePath) {
57
- console.error('[claude-code-termux] Error: Could not find @anthropic-ai/claude-code');
58
- console.error('Please ensure it is installed: npm install @anthropic-ai/claude-code');
59
- process.exit(1);
60
- }
68
+ if (!claudeCodePath) {
69
+ console.error('[claude-code-termux] Error: Could not find @anthropic-ai/claude-code');
70
+ console.error('');
71
+ console.error('The Claude Code package was not found. Install it with:');
72
+ console.error(' npm install -g @anthropic-ai/claude-code');
73
+ console.error('');
74
+ console.error('Searched paths:');
75
+ possiblePaths.forEach(p => {
76
+ if (p) console.error(` - ${p}`);
77
+ });
78
+ process.exit(1);
61
79
  }
62
80
 
63
81
  // Import and run Claude Code
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-termux",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Claude Code CLI with Termux/Android compatibility fixes - a wrapper that patches issues with Sharp, ripgrep, and path resolution on ARM64 Android",
5
5
  "author": "Jimoh Ovbiagele <findingjimoh@gmail.com>",
6
6
  "license": "MIT",