@udara-kavindu/hik-cli 0.1.0 → 0.1.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/README.md +97 -8
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,106 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hik CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Your unified AI workspace, right in your terminal.
|
|
4
|
+
|
|
5
|
+
**Hik CLI** brings the power of your unified AI backend to your command line. Chat with local or cloud models, generate conventional commit messages, explain complex code, and debug errors—all without leaving your shell.
|
|
6
|
+
|
|
7
|
+
## ✨ Features
|
|
8
|
+
- **💬 Interactive Chat**: Have persistent, multi-turn conversations with context retention.
|
|
9
|
+
- **⚡ Git Integration**: Generate semantic commit messages from your staged changes (`hik commit`).
|
|
10
|
+
- **🔍 Code Analysis**: Explain any file or snippet instantly (`hik explain`).
|
|
11
|
+
- **🛠️ Debugging**: Paste error logs or code to get instant fixes (`hik fix`).
|
|
12
|
+
- **🔄 Unified Context**: Sessions sync across Obsidian, Web, and CLI via your Hik backend.
|
|
13
|
+
- **🏠 Local-First**: Works seamlessly with LM Studio or any OpenAI-compatible endpoint.
|
|
14
|
+
|
|
15
|
+
## 🚀 Installation
|
|
16
|
+
|
|
17
|
+
Install globally using npm or Bun:
|
|
4
18
|
|
|
5
19
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
20
|
+
npm install -g @udara-kavindu/hik-cli
|
|
21
|
+
# or
|
|
22
|
+
bun add -g @udara-kavindu/hik-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ⚙️ Configuration
|
|
26
|
+
|
|
27
|
+
Before using Hik, you need to link it to your Hik backend.
|
|
28
|
+
|
|
29
|
+
### 1. Login
|
|
30
|
+
Generate an API key from your Hik Dashboard and save it locally:
|
|
31
|
+
```bash
|
|
32
|
+
hik login hik_xxxxxxxxxxxxxxxx
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Set Backend URL (Optional)
|
|
36
|
+
By default, Hik points to `http://localhost:3000`. To change it:
|
|
37
|
+
```bash
|
|
38
|
+
hik config --url https://api.your-hik-instance.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 📖 Usage
|
|
42
|
+
|
|
43
|
+
### Interactive Mode
|
|
44
|
+
Start a persistent chat session where Hik remembers your conversation history:
|
|
45
|
+
```bash
|
|
46
|
+
hik interactive
|
|
47
|
+
# or use the alias
|
|
48
|
+
hik i
|
|
8
49
|
```
|
|
50
|
+
*Type `/exit` to quit.*
|
|
9
51
|
|
|
10
|
-
|
|
52
|
+
### One-off Chat
|
|
53
|
+
Send a single message and get a response:
|
|
54
|
+
```bash
|
|
55
|
+
hik chat "Write a Python script to sort a list"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Git Commit Generator
|
|
59
|
+
Analyze your staged changes and generate a Conventional Commit message:
|
|
60
|
+
```bash
|
|
61
|
+
git add .
|
|
62
|
+
hik commit
|
|
63
|
+
# Use -y to automatically commit
|
|
64
|
+
hik commit -y
|
|
65
|
+
```
|
|
11
66
|
|
|
67
|
+
### Code Explainer
|
|
68
|
+
Get a breakdown of what a specific file does:
|
|
12
69
|
```bash
|
|
13
|
-
|
|
14
|
-
hik --help
|
|
70
|
+
hik explain src/main.ts
|
|
15
71
|
```
|
|
16
72
|
|
|
17
|
-
|
|
73
|
+
### Bug Fixer
|
|
74
|
+
Find solutions for error logs or buggy code:
|
|
75
|
+
```bash
|
|
76
|
+
hik fix error.log
|
|
77
|
+
# Or pipe input directly
|
|
78
|
+
cat crash.log | hik fix
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 🛠️ Commands Reference
|
|
82
|
+
|
|
83
|
+
| Command | Description |
|
|
84
|
+
| :--- | :--- |
|
|
85
|
+
| `hik login <key>` | Save your Hik API key locally. |
|
|
86
|
+
| `hik chat <msg>` | Send a one-time message to the AI. |
|
|
87
|
+
| `hik interactive` | Start a multi-turn chat session. |
|
|
88
|
+
| `hik commit` | Generate a commit message from staged git changes. |
|
|
89
|
+
| `hik explain <file>` | Explain the contents of a code file. |
|
|
90
|
+
| `hik fix <file>` | Analyze an error log or code snippet for fixes. |
|
|
91
|
+
| `hik config` | Manage backend URL and other settings. |
|
|
92
|
+
|
|
93
|
+
## 🏗️ Development
|
|
94
|
+
|
|
95
|
+
If you want to contribute or run Hik CLI locally:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git clone https://github.com/your-username/hik.ai.git
|
|
99
|
+
cd hik.ai/hik-cli
|
|
100
|
+
bun install
|
|
101
|
+
bun run dev
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 📄 License
|
|
105
|
+
|
|
106
|
+
MIT © Kavindu Udara
|
package/dist/index.js
CHANGED
|
@@ -11,9 +11,15 @@ import * as path from "path";
|
|
|
11
11
|
import { startInteractiveChat } from "./interactive.js";
|
|
12
12
|
const program = new Command();
|
|
13
13
|
program
|
|
14
|
-
.name(
|
|
15
|
-
.description(
|
|
16
|
-
.version(pkg.version)
|
|
14
|
+
.name('hik')
|
|
15
|
+
.description(chalk.bold('Your unified AI workspace CLI'))
|
|
16
|
+
.version(pkg.version)
|
|
17
|
+
.addHelpText('after', `\n${chalk.dim('Examples:')}
|
|
18
|
+
${chalk.cyan('$')} hik login hik_...
|
|
19
|
+
${chalk.cyan('$')} hik commit -y
|
|
20
|
+
${chalk.cyan('$')} hik explain src/app.ts
|
|
21
|
+
${chalk.cyan('$')} hik interactive
|
|
22
|
+
`);
|
|
17
23
|
program
|
|
18
24
|
.command("login")
|
|
19
25
|
.argument("<api-key>", "Your Hik API key (hik_...)")
|