@snailer-team/snailer 1.0.7
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.
- package/README.md +151 -0
- package/bin/snailer.js +17 -0
- package/package.json +35 -0
- package/scripts/postinstall.js +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# @felixaihub/snailer
|
|
2
|
+
|
|
3
|
+
> AI-Powered Development Agent for Your Terminal
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@felixaihub/snailer)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## What is Snailer?
|
|
9
|
+
|
|
10
|
+
Snailer is an intelligent AI coding agent that lives in your terminal. This npm package provides a convenient cross-platform installer for the Snailer CLI.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Just describe what you want in plain English
|
|
14
|
+
snailer --prompt "refactor the authentication module to use async/await"
|
|
15
|
+
snailer --prompt "find all TODO comments and create GitHub issues"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Install
|
|
19
|
+
|
|
20
|
+
### Global Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @felixaihub/snailer
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Using npx (No Installation)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @felixaihub/snailer@latest --help
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- 🧠 **Self-Learning**: Improves with every interaction using ACE (Agentic Context Engineering)
|
|
35
|
+
- 🔄 **Multi-Model Support**: Works with Claude, GPT, Grok, and Gemini
|
|
36
|
+
- 🛠️ **Built-in Tools**: File operations, code search, git workflows, and more
|
|
37
|
+
- ⚡ **Fast & Reliable**: Built with Rust for performance
|
|
38
|
+
|
|
39
|
+
## Setup
|
|
40
|
+
|
|
41
|
+
After installation, set up your AI API key:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# For Claude (recommended)
|
|
45
|
+
export CLAUDE_API_KEY="your-api-key"
|
|
46
|
+
|
|
47
|
+
# Or for OpenAI
|
|
48
|
+
export OPENAI_API_KEY="your-api-key"
|
|
49
|
+
|
|
50
|
+
# Or for xAI
|
|
51
|
+
export XAI_API_KEY="your-api-key"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Start interactive mode (REPL)
|
|
58
|
+
snailer
|
|
59
|
+
|
|
60
|
+
# Execute a specific task (one-shot)
|
|
61
|
+
snailer --prompt "Add error handling to the API module"
|
|
62
|
+
|
|
63
|
+
# Get help
|
|
64
|
+
snailer --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## How It Works
|
|
68
|
+
|
|
69
|
+
This npm package is an installer wrapper that:
|
|
70
|
+
|
|
71
|
+
1. Downloads the appropriate Snailer binary from [GitHub Releases](https://github.com/felixaihub/snailer-cli/releases)
|
|
72
|
+
2. Selects the correct binary for your platform (macOS, Linux, Windows)
|
|
73
|
+
3. Installs it in a location accessible via the `snailer` command
|
|
74
|
+
|
|
75
|
+
### Supported Platforms
|
|
76
|
+
|
|
77
|
+
- **macOS**: x64, ARM64 (Apple Silicon)
|
|
78
|
+
- **Linux**: x64, ARM64
|
|
79
|
+
- **Windows**: x64
|
|
80
|
+
|
|
81
|
+
### Binary Download
|
|
82
|
+
|
|
83
|
+
During `npm install`, the package automatically:
|
|
84
|
+
- Detects your platform and architecture
|
|
85
|
+
- Downloads the corresponding binary from GitHub Releases
|
|
86
|
+
- Makes it executable and available in your PATH
|
|
87
|
+
|
|
88
|
+
### Offline Installation
|
|
89
|
+
|
|
90
|
+
To skip the automatic download (useful for air-gapped environments):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
SNAILER_SKIP_POSTINSTALL=1 npm install -g @felixaihub/snailer
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then manually download the binary from [Releases](https://github.com/felixaihub/snailer-cli/releases) and place it in the package's `bin/` directory.
|
|
97
|
+
|
|
98
|
+
## Documentation
|
|
99
|
+
|
|
100
|
+
For detailed documentation, visit the main repository:
|
|
101
|
+
|
|
102
|
+
- [GitHub Repository](https://github.com/felixaihub/snailer-cli)
|
|
103
|
+
- [Architecture Overview](https://github.com/felixaihub/snailer-cli/blob/main/ARCHITECTURE.md)
|
|
104
|
+
- [Agent Documentation](https://github.com/felixaihub/snailer-cli/blob/main/docs/AGENT_ARCHITECTURE.md)
|
|
105
|
+
- [ACE System](https://github.com/felixaihub/snailer-cli/blob/main/docs/ACE_SYSTEM.md)
|
|
106
|
+
- [Contributing Guide](https://github.com/felixaihub/snailer-cli/blob/main/docs/CONTRIBUTING.md)
|
|
107
|
+
|
|
108
|
+
## Troubleshooting
|
|
109
|
+
|
|
110
|
+
### Binary download fails
|
|
111
|
+
|
|
112
|
+
If the automatic download fails, you can:
|
|
113
|
+
|
|
114
|
+
1. Manually download from [Releases](https://github.com/felixaihub/snailer-cli/releases)
|
|
115
|
+
2. Place the binary in the package installation directory under `bin/`
|
|
116
|
+
3. Make it executable: `chmod +x bin/snailer` (Unix-like systems)
|
|
117
|
+
|
|
118
|
+
### Command not found
|
|
119
|
+
|
|
120
|
+
If `snailer` command is not found after global installation:
|
|
121
|
+
|
|
122
|
+
1. Check that npm's global bin directory is in your PATH:
|
|
123
|
+
```bash
|
|
124
|
+
npm config get prefix
|
|
125
|
+
```
|
|
126
|
+
2. Add it to your PATH if needed (usually `~/.npm/bin` or `/usr/local/bin`)
|
|
127
|
+
|
|
128
|
+
### Permission denied
|
|
129
|
+
|
|
130
|
+
On Unix-like systems, if you get "permission denied":
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
chmod +x $(which snailer)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
This installer package is licensed under the MIT License.
|
|
139
|
+
|
|
140
|
+
The Snailer binary is subject to its own [End User License Agreement (EULA)](https://github.com/felixaihub/snailer-cli/blob/main/EULA.md).
|
|
141
|
+
|
|
142
|
+
By installing and using Snailer, you agree to the terms in both licenses.
|
|
143
|
+
|
|
144
|
+
## Support
|
|
145
|
+
|
|
146
|
+
- **Issues**: [GitHub Issues](https://github.com/felixaihub/snailer-cli/issues)
|
|
147
|
+
- **Website**: [snailer.ai](https://snailer.ai)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
**Made with ❤️ by the Snailer Team**
|
package/bin/snailer.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require('node:child_process');
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const os = require('node:os');
|
|
5
|
+
const fs = require('node:fs');
|
|
6
|
+
|
|
7
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
8
|
+
const exe = os.platform() === 'win32' ? 'snailer.exe' : 'snailer';
|
|
9
|
+
const bin = path.join(binDir, exe);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(bin)) {
|
|
12
|
+
console.error('[snailer] Binary is missing. Reinstall or download from Releases.');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
17
|
+
child.on('exit', (code) => process.exit(code));
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@snailer-team/snailer",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "AI-powered development CLI (installer wrapper)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"snailer": "bin/snailer.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"scripts",
|
|
11
|
+
"README.md",
|
|
12
|
+
"../EULA.md",
|
|
13
|
+
"../LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"postinstall": "node scripts/postinstall.js"
|
|
17
|
+
},
|
|
18
|
+
"os": [
|
|
19
|
+
"darwin",
|
|
20
|
+
"linux",
|
|
21
|
+
"win32"
|
|
22
|
+
],
|
|
23
|
+
"cpu": [
|
|
24
|
+
"x64",
|
|
25
|
+
"arm64"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"repository": "https://github.com/felixaihub/snailer-cli",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const { execSync } = require('node:child_process');
|
|
2
|
+
const os = require('node:os');
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
|
|
6
|
+
if (process.env.SNAILER_SKIP_POSTINSTALL === '1') {
|
|
7
|
+
console.log('[snailer] Skipping binary download (SNAILER_SKIP_POSTINSTALL=1).');
|
|
8
|
+
process.exit(0);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const org = process.env.SNAILER_ORG || 'felixaihub';
|
|
12
|
+
const repo = process.env.SNAILER_REPO || 'snailer-cli';
|
|
13
|
+
const version = 'v' + (process.env.npm_package_version || '0.1.0');
|
|
14
|
+
|
|
15
|
+
function triple() {
|
|
16
|
+
const plat = os.platform();
|
|
17
|
+
const arch = os.arch();
|
|
18
|
+
if (plat === 'darwin' && arch === 'arm64') return 'aarch64-apple-darwin';
|
|
19
|
+
if (plat === 'darwin') return 'x86_64-apple-darwin';
|
|
20
|
+
if (plat === 'linux' && arch === 'arm64') return 'aarch64-unknown-linux-musl';
|
|
21
|
+
if (plat === 'linux') return 'x86_64-unknown-linux-musl';
|
|
22
|
+
if (plat === 'win32') return 'x86_64-pc-windows-msvc';
|
|
23
|
+
throw new Error(`Unsupported platform ${plat}/${arch}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const plat = os.platform();
|
|
27
|
+
const isWin = plat === 'win32';
|
|
28
|
+
const asset = `snailer-${version}-${triple()}.${isWin ? 'zip' : 'tar.gz'}`;
|
|
29
|
+
const url = `https://github.com/${org}/${repo}/releases/download/${version}/${asset}`;
|
|
30
|
+
|
|
31
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
32
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
33
|
+
const tmp = path.join(os.tmpdir(), asset);
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
if (isWin) {
|
|
37
|
+
execSync(`powershell -NoProfile -Command \"Invoke-WebRequest -Uri '${url}' -OutFile '${tmp}'; Expand-Archive -LiteralPath '${tmp}' -DestinationPath '${binDir}' -Force\"`, { stdio: 'inherit' });
|
|
38
|
+
} else {
|
|
39
|
+
execSync(`curl -L '${url}' -o '${tmp}'`, { stdio: 'inherit' });
|
|
40
|
+
execSync(`tar -xzf '${tmp}' -C '${binDir}'`, { stdio: 'inherit' });
|
|
41
|
+
execSync(`chmod +x '${path.join(binDir, 'snailer')}'`, { stdio: 'inherit' });
|
|
42
|
+
}
|
|
43
|
+
console.log(`[snailer] Installed binary from ${url}`);
|
|
44
|
+
console.log('[snailer] By installing, you agree to the Snailer EULA: https://github.com/felixaihub/snailer-cli/blob/main/EULA.md');
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.error('[snailer] Failed to download/install binary.');
|
|
47
|
+
console.error(`[snailer] Manual download: ${url}`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|