@alius-tech/alius 0.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.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/bin/alius.js +160 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 WeiXuG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# @alius-tech/alius
|
|
2
|
+
|
|
3
|
+
**Hermes Agent 工程实践** - 探索 LLM Agent 的工业化落地与软件自进化范式。
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@alius-tech/alius)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/AliusTech/alius)
|
|
8
|
+
|
|
9
|
+
## 关于 Alius
|
|
10
|
+
|
|
11
|
+
Alius 是一个交互式的 LLM 命令行工具,作为 **Hermes Agent 工程实践**和**软件自进化**的探索平台:
|
|
12
|
+
|
|
13
|
+
- **工具调用架构** - 模块化、可扩展的工具系统设计
|
|
14
|
+
- **交互范式** - REPL 模式下的自然语言交互
|
|
15
|
+
- **工程化落地** - 从原型到生产级的演进路径
|
|
16
|
+
- **软件自进化** - AI 辅助下的代码改进、测试生成、文档维护
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Install globally via npm
|
|
22
|
+
npm install -g @alius-tech/alius
|
|
23
|
+
|
|
24
|
+
# Or using yarn
|
|
25
|
+
yarn global add @alius-tech/alius
|
|
26
|
+
|
|
27
|
+
# Or using pnpm
|
|
28
|
+
pnpm add -g @alius-tech/alius
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Start interactive REPL mode
|
|
35
|
+
alius
|
|
36
|
+
|
|
37
|
+
# Run a single prompt
|
|
38
|
+
alius run "What files are in this directory?"
|
|
39
|
+
|
|
40
|
+
# Show help
|
|
41
|
+
alius --help
|
|
42
|
+
|
|
43
|
+
# Show version
|
|
44
|
+
alius version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- 🤖 **AI-Powered Assistant** - Powered by LLM models (OpenAI GPT, Anthropic Claude)
|
|
50
|
+
- 🔧 **Built-in Tools** - File operations, shell commands, git, HTTP requests, and more
|
|
51
|
+
- 💬 **Interactive REPL** - Conversation-style interface with session management
|
|
52
|
+
- 🔐 **Permission System** - Granular control over tool execution permissions
|
|
53
|
+
- 📝 **Session Persistence** - Save and resume conversations
|
|
54
|
+
- 🎯 **Smart Tool Calling** - Automatic tool selection based on context
|
|
55
|
+
|
|
56
|
+
## Built-in Tools
|
|
57
|
+
|
|
58
|
+
| Tool | Description |
|
|
59
|
+
|------|-------------|
|
|
60
|
+
| `read_file` | Read file contents |
|
|
61
|
+
| `write_file` | Write/create files |
|
|
62
|
+
| `edit_file` | Edit existing files |
|
|
63
|
+
| `list_dir` | List directory contents |
|
|
64
|
+
| `shell` | Execute shell commands |
|
|
65
|
+
| `git_status` | Check git repository status |
|
|
66
|
+
| `git_diff` | View git differences |
|
|
67
|
+
| `http_request` | Make HTTP requests |
|
|
68
|
+
| `json` | Parse and query JSON data |
|
|
69
|
+
| `code_stats` | Analyze code statistics |
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
Create a config file at `~/.alius/config.toml`:
|
|
74
|
+
|
|
75
|
+
```toml
|
|
76
|
+
[llm]
|
|
77
|
+
provider = "openai" # or "anthropic"
|
|
78
|
+
model = "gpt-4o-mini" # or "claude-3-haiku-20240307"
|
|
79
|
+
|
|
80
|
+
[ui]
|
|
81
|
+
theme = "dark"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Supported Platforms
|
|
85
|
+
|
|
86
|
+
| Platform | Architecture | Package |
|
|
87
|
+
|----------|-------------|---------|
|
|
88
|
+
| macOS | Intel x64 | `@alius-tech/alius-darwin-x64` |
|
|
89
|
+
| macOS | Apple Silicon arm64 | `@alius-tech/alius-darwin-arm64` |
|
|
90
|
+
| Linux | x64 | `@alius-tech/alius-linux-x64` |
|
|
91
|
+
| Linux | arm64 | `@alius-tech/alius-linux-arm64` |
|
|
92
|
+
| Windows | x64 | `@alius-tech/alius-win32-x64` |
|
|
93
|
+
| Windows | arm64 | `@alius-tech/alius-win32-arm64` |
|
|
94
|
+
|
|
95
|
+
The correct platform package is automatically installed as an optional dependency.
|
|
96
|
+
|
|
97
|
+
## Alternative Installation Methods
|
|
98
|
+
|
|
99
|
+
### Homebrew (macOS)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
brew tap AliusTech/alius
|
|
103
|
+
brew install alius
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Direct Download
|
|
107
|
+
|
|
108
|
+
Download pre-built binaries from [GitHub Releases](https://github.com/AliusTech/alius/releases):
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# macOS/Linux
|
|
112
|
+
curl -sSL https://github.com/AliusTech/alius/releases/latest/download/alius-$(uname -s)-$(uname -m).tar.gz | tar xz
|
|
113
|
+
|
|
114
|
+
# Windows (PowerShell)
|
|
115
|
+
Invoke-WebRequest -Uri "https://github.com/AliusTech/alius/releases/latest/download/alius-windows-x64.zip" -OutFile "alius.zip"
|
|
116
|
+
Expand-Archive alius.zip
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### From Source
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
git clone https://github.com/AliusTech/alius.git
|
|
123
|
+
cd alius
|
|
124
|
+
cargo build --release
|
|
125
|
+
cargo install --path crates/alius-cli
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## API Keys
|
|
129
|
+
|
|
130
|
+
Alius requires API keys to communicate with LLM providers:
|
|
131
|
+
|
|
132
|
+
- **OpenAI**: Set `OPENAI_API_KEY` environment variable or configure in config file
|
|
133
|
+
- **Anthropic**: Set `ANTHROPIC_API_KEY` environment variable or configure in config file
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
export OPENAI_API_KEY="your-api-key"
|
|
137
|
+
alius
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Requirements
|
|
141
|
+
|
|
142
|
+
- Node.js >= 16 (for npm installation)
|
|
143
|
+
- Rust >= 1.70 (for building from source)
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
Contributions are welcome! See [CONTRIBUTING.md](https://github.com/AliusTech/alius/blob/main/CONTRIBUTING.md).
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License - see [LICENSE](https://github.com/AliusTech/alius/blob/main/LICENSE).
|
|
152
|
+
|
|
153
|
+
## Links
|
|
154
|
+
|
|
155
|
+
- [GitHub Repository](https://github.com/AliusTech/alius)
|
|
156
|
+
- [Issue Tracker](https://github.com/AliusTech/alius/issues)
|
|
157
|
+
- [Changelog](https://github.com/AliusTech/alius/blob/main/CHANGELOG.md)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
Made with ❤️ by **Alius Tech**
|
package/bin/alius.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Platform detection and binary execution wrapper for Alius CLI
|
|
4
|
+
* Automatically selects and runs the correct native binary for the current platform
|
|
5
|
+
*
|
|
6
|
+
* @author Alius Tech
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn } = require('child_process');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const os = require('os');
|
|
13
|
+
|
|
14
|
+
// Platform detection
|
|
15
|
+
const PLATFORM = os.platform();
|
|
16
|
+
const ARCH = os.arch();
|
|
17
|
+
|
|
18
|
+
// Platform to npm package mapping
|
|
19
|
+
const PLATFORM_PACKAGES = {
|
|
20
|
+
'darwin-x64': '@alius-tech/alius-darwin-x64',
|
|
21
|
+
'darwin-arm64': '@alius-tech/alius-darwin-arm64',
|
|
22
|
+
'linux-x64': '@alius-tech/alius-linux-x64',
|
|
23
|
+
'linux-arm64': '@alius-tech/alius-linux-arm64',
|
|
24
|
+
'win32-x64': '@alius-tech/alius-win32-x64',
|
|
25
|
+
'win32-arm64': '@alius-tech/alius-win32-arm64',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Binary names per platform
|
|
29
|
+
const BINARY_NAMES = {
|
|
30
|
+
darwin: 'alius',
|
|
31
|
+
linux: 'alius',
|
|
32
|
+
win32: 'alius.exe',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the platform key for current system
|
|
37
|
+
*/
|
|
38
|
+
function getPlatformKey() {
|
|
39
|
+
return `${PLATFORM}-${ARCH}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the binary name for current platform
|
|
44
|
+
*/
|
|
45
|
+
function getBinaryName() {
|
|
46
|
+
return BINARY_NAMES[PLATFORM] || 'alius';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Find the native binary path
|
|
51
|
+
* Tries multiple locations to handle different installation scenarios
|
|
52
|
+
*/
|
|
53
|
+
function findBinary() {
|
|
54
|
+
const platformKey = getPlatformKey();
|
|
55
|
+
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
56
|
+
const binaryName = getBinaryName();
|
|
57
|
+
|
|
58
|
+
if (!packageName) {
|
|
59
|
+
console.error(`\n✗ Unsupported platform: ${platformKey}`);
|
|
60
|
+
console.error('\nSupported platforms:');
|
|
61
|
+
console.error(' - darwin-x64 (macOS Intel)');
|
|
62
|
+
console.error(' - darwin-arm64 (macOS Apple Silicon)');
|
|
63
|
+
console.error(' - linux-x64 (Linux x86_64)');
|
|
64
|
+
console.error(' - linux-arm64 (Linux ARM64)');
|
|
65
|
+
console.error(' - win32-x64 (Windows x86_64)');
|
|
66
|
+
console.error(' - win32-arm64 (Windows ARM64)');
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Possible binary locations
|
|
71
|
+
const possiblePaths = [
|
|
72
|
+
// Try platform package's index.js export
|
|
73
|
+
(() => {
|
|
74
|
+
try {
|
|
75
|
+
const platformPkg = require(packageName);
|
|
76
|
+
return platformPkg.binaryPath || platformPkg.getBinaryPath?.();
|
|
77
|
+
} catch { return null; }
|
|
78
|
+
})(),
|
|
79
|
+
|
|
80
|
+
// Sibling package directory (npm scoped package and local monorepo layouts)
|
|
81
|
+
path.join(__dirname, '..', '..', packageName.split('/').pop(), 'bin', binaryName),
|
|
82
|
+
|
|
83
|
+
// Vendor directory (for bundled distribution)
|
|
84
|
+
path.join(__dirname, '..', 'vendor', platformKey, 'bin', binaryName),
|
|
85
|
+
|
|
86
|
+
// Adjacent to this script (development)
|
|
87
|
+
path.join(__dirname, binaryName),
|
|
88
|
+
].filter(Boolean);
|
|
89
|
+
|
|
90
|
+
// Find existing binary
|
|
91
|
+
for (const binaryPath of possiblePaths) {
|
|
92
|
+
if (binaryPath && fs.existsSync(binaryPath)) {
|
|
93
|
+
return binaryPath;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Binary not found - show helpful error message
|
|
98
|
+
console.error(`\n✗ Alius binary not found for platform: ${platformKey}`);
|
|
99
|
+
console.error(`\nThis could mean:`);
|
|
100
|
+
console.error(' 1. The platform package was not installed correctly');
|
|
101
|
+
console.error(' 2. The binary download failed');
|
|
102
|
+
console.error(' 3. An incompatible version was installed');
|
|
103
|
+
console.error('\nTroubleshooting:');
|
|
104
|
+
console.error(' 1. Clear npm cache: npm cache clean --force');
|
|
105
|
+
console.error(' 2. Reinstall: npm uninstall -g @alius-tech/alius && npm install -g @alius-tech/alius');
|
|
106
|
+
console.error(' 3. Check platform: node -e "console.log(process.platform + "-" + process.arch)"');
|
|
107
|
+
console.error('\nOr download manually from:');
|
|
108
|
+
console.error(' https://github.com/AliusTech/alius/releases');
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Run the native binary with forwarded arguments and signals
|
|
114
|
+
*/
|
|
115
|
+
function run() {
|
|
116
|
+
const binaryPath = findBinary();
|
|
117
|
+
const args = process.argv.slice(2);
|
|
118
|
+
|
|
119
|
+
// Spawn the native binary
|
|
120
|
+
const child = spawn(binaryPath, args, {
|
|
121
|
+
stdio: 'inherit',
|
|
122
|
+
env: {
|
|
123
|
+
...process.env,
|
|
124
|
+
// Pass platform info to the binary
|
|
125
|
+
ALIUS_PLATFORM: getPlatformKey(),
|
|
126
|
+
ALIUS_WRAPPER: 'true',
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Forward termination signals to child process
|
|
131
|
+
const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
132
|
+
signals.forEach((signal) => {
|
|
133
|
+
process.on(signal, () => {
|
|
134
|
+
// Only forward if child is alive
|
|
135
|
+
if (!child.killed) {
|
|
136
|
+
child.kill(signal);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Handle child process exit
|
|
142
|
+
child.on('exit', (code, signal) => {
|
|
143
|
+
if (signal) {
|
|
144
|
+
// Re-emit signal so parent exits the same way
|
|
145
|
+
process.kill(process.pid, signal);
|
|
146
|
+
} else {
|
|
147
|
+
process.exit(code ?? 0);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Handle child process error
|
|
152
|
+
child.on('error', (err) => {
|
|
153
|
+
console.error(`\n✗ Failed to run Alius: ${err.message}`);
|
|
154
|
+
console.error(`\nBinary path: ${binaryPath}`);
|
|
155
|
+
process.exit(1);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Run CLI
|
|
160
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alius-tech/alius",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Alius CLI - An AI-powered assistant with intelligent tool calling capabilities",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"cli",
|
|
8
|
+
"assistant",
|
|
9
|
+
"llm",
|
|
10
|
+
"agent",
|
|
11
|
+
"openai",
|
|
12
|
+
"anthropic",
|
|
13
|
+
"claude",
|
|
14
|
+
"tools",
|
|
15
|
+
"repl"
|
|
16
|
+
],
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Alius Tech",
|
|
19
|
+
"email": "alius@aliustech.com",
|
|
20
|
+
"url": "https://aliustech.com"
|
|
21
|
+
},
|
|
22
|
+
"contributors": [
|
|
23
|
+
{
|
|
24
|
+
"name": "WeiXuG",
|
|
25
|
+
"url": "https://github.com/weixug"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/AliusTech/alius.git",
|
|
32
|
+
"directory": "npm-packages/alius"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/AliusTech/alius/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/AliusTech/alius#readme",
|
|
38
|
+
"bin": {
|
|
39
|
+
"alius": "./bin/alius.js"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"bin",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
],
|
|
46
|
+
"optionalDependencies": {
|
|
47
|
+
"@alius-tech/alius-darwin-x64": "0.0.1",
|
|
48
|
+
"@alius-tech/alius-darwin-arm64": "0.0.1",
|
|
49
|
+
"@alius-tech/alius-linux-x64": "0.0.1",
|
|
50
|
+
"@alius-tech/alius-win32-x64": "0.0.1"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=16"
|
|
54
|
+
},
|
|
55
|
+
"funding": {
|
|
56
|
+
"type": "github",
|
|
57
|
+
"url": "https://github.com/AliusTech/alius?sponsor=1"
|
|
58
|
+
}
|
|
59
|
+
}
|