hmanlab 0.1.2
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 +47 -0
- package/bin/hmanlab.js +53 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# hmanlab
|
|
2
|
+
|
|
3
|
+
A terminal UI for chatting with local [Ollama](https://ollama.com) models — plus BYOK providers (z.ai, Ollama Cloud, OpenCode Go) — built in Rust with [ratatui](https://ratatui.rs).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Global install
|
|
7
|
+
npm install -g hmanlab
|
|
8
|
+
|
|
9
|
+
# Run once without installing
|
|
10
|
+
npx hmanlab
|
|
11
|
+
|
|
12
|
+
# Per-project (e.g. add to a repo's dev deps)
|
|
13
|
+
npm install --save-dev hmanlab
|
|
14
|
+
npx hmanlab
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- Streaming replies, agentic tool calls (`read_file`, `edit_file`, `run_command`, git, find), foldable `<think>` blocks
|
|
20
|
+
- BYOK providers: z.ai (subscription + usage), Ollama Cloud, OpenCode Go
|
|
21
|
+
- Session persistence via `hmanlab-api`, with `/sessions`, `/load`, `/more`
|
|
22
|
+
- Workspace sidebar with click-to-expand folders, scroll, click-to-open file viewer
|
|
23
|
+
- `/compact` slash command + automatic compaction at high context tokens; compactions are persisted to `<workspace>/.hmanlab/memory/compact-current.md` so the model can resume across sessions
|
|
24
|
+
- Memory store at `~/.hmanlab/memory/` (user-scope) and `<workspace>/.hmanlab/memory/` (project-scope), surfaced to the model every turn
|
|
25
|
+
|
|
26
|
+
## Supported platforms
|
|
27
|
+
|
|
28
|
+
Prebuilt binaries ship for:
|
|
29
|
+
|
|
30
|
+
- `linux-x64`, `linux-arm64` (musl, statically-linked)
|
|
31
|
+
- `darwin-x64`, `darwin-arm64`
|
|
32
|
+
- `win32-x64`
|
|
33
|
+
|
|
34
|
+
On other platforms, `npm install` will succeed but `hmanlab` will print a friendly "no prebuilt binary" message and exit. Build from source via `cargo install --git https://github.com/rekabytes/hmanlab`.
|
|
35
|
+
|
|
36
|
+
## Where does `.hmanlab/` live?
|
|
37
|
+
|
|
38
|
+
Wherever you launch `hmanlab` from — that becomes the **workspace**:
|
|
39
|
+
|
|
40
|
+
- Project install: `npx hmanlab` from a project dir → `<project>/.hmanlab/`
|
|
41
|
+
- Global install: `cd ~/myrepo && hmanlab` → `~/myrepo/.hmanlab/`. `cd ~ && hmanlab` → `~/.hmanlab/`
|
|
42
|
+
|
|
43
|
+
User-scope state (cross-project preferences, identity) always lives at `~/.hmanlab/`.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT. See https://github.com/rekabytes/hmanlab for source.
|
package/bin/hmanlab.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// hmanlab launcher. Resolves the matching prebuilt binary from the
|
|
3
|
+
// per-arch optional dependency and execs it with the user's args. The
|
|
4
|
+
// binary itself is a self-contained Rust executable — this shim just
|
|
5
|
+
// figures out which one to run and forwards stdio + signals.
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const { spawn } = require('node:child_process');
|
|
10
|
+
|
|
11
|
+
const { platform, arch } = process;
|
|
12
|
+
// npm normalises win32 platforms to 'win32', x64/arm64 are already the
|
|
13
|
+
// arch names we use in the subpackage names — match them 1:1.
|
|
14
|
+
const pkg = `@hmanlab/${platform}-${arch}`;
|
|
15
|
+
const exe = platform === 'win32' ? 'hmanlab.exe' : 'hmanlab';
|
|
16
|
+
|
|
17
|
+
let binPath;
|
|
18
|
+
try {
|
|
19
|
+
binPath = require.resolve(`${pkg}/bin/${exe}`);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(
|
|
22
|
+
`hmanlab: no prebuilt binary for ${platform}-${arch}.\n` +
|
|
23
|
+
'Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64.\n' +
|
|
24
|
+
'Install Rust and build from source: https://github.com/rekabytes/hmanlab'
|
|
25
|
+
);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const child = spawn(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
30
|
+
|
|
31
|
+
// Forward signals to the child so Ctrl+C in the parent shell shuts down
|
|
32
|
+
// the TUI cleanly instead of orphaning it with a half-painted terminal.
|
|
33
|
+
for (const sig of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT']) {
|
|
34
|
+
process.on(sig, () => {
|
|
35
|
+
try { child.kill(sig); } catch (_) { /* child already gone */ }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
child.on('error', (err) => {
|
|
40
|
+
console.error(`hmanlab: failed to launch binary (${binPath}): ${err.message}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
child.on('exit', (code, signal) => {
|
|
45
|
+
// If the child died by signal, re-raise it on ourselves so the parent
|
|
46
|
+
// shell's exit-code reporting (e.g. 130 for SIGINT) stays consistent
|
|
47
|
+
// with running the native binary directly.
|
|
48
|
+
if (signal) {
|
|
49
|
+
process.kill(process.pid, signal);
|
|
50
|
+
} else {
|
|
51
|
+
process.exit(code ?? 0);
|
|
52
|
+
}
|
|
53
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hmanlab",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "hmanlab — a terminal UI for chatting with Ollama, z.ai, Ollama Cloud, and OpenCode Go from your shell.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"agent",
|
|
8
|
+
"ollama",
|
|
9
|
+
"tui",
|
|
10
|
+
"terminal",
|
|
11
|
+
"rust",
|
|
12
|
+
"llm"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/rekabytes/hmanlab",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/rekabytes/hmanlab/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "rekabytes <hello@rekabytes.com>",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/rekabytes/hmanlab.git"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"hmanlab": "bin/hmanlab.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin/hmanlab.js",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
},
|
|
34
|
+
"optionalDependencies": {
|
|
35
|
+
"@hmanlab/linux-x64": "0.1.2",
|
|
36
|
+
"@hmanlab/linux-arm64": "0.1.2",
|
|
37
|
+
"@hmanlab/darwin-x64": "0.1.2",
|
|
38
|
+
"@hmanlab/darwin-arm64": "0.1.2",
|
|
39
|
+
"@hmanlab/win32-x64": "0.1.2"
|
|
40
|
+
}
|
|
41
|
+
}
|