hejaz-ai-cli 1.0.0
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 +88 -0
- package/dist/cli.js +270 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @hejaz/ai-cli
|
|
2
|
+
|
|
3
|
+
A Claude Code-like terminal AI assistant powered by the Hejaz AI Gateway.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Streaming Chat** — Real-time SSE streaming with tool call display
|
|
8
|
+
- **OS Agent** — Read/write/edit files, search code (glob/grep), execute shell commands
|
|
9
|
+
- **MCP Integration** — Connect to Model Context Protocol servers (stdio transport)
|
|
10
|
+
- **Knowledge Base** — Bind and query enterprise knowledge bases
|
|
11
|
+
- **Sub-Agent Display** — Parallel agent execution visualization
|
|
12
|
+
- **Slash Commands** — `/model`, `/kb`, `/mcp`, `/session`, `/config`, `/help`
|
|
13
|
+
- **Permission System** — Three-level access control (auto/confirm/dangerous)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @hejaz/ai-cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Start with API key
|
|
25
|
+
hejaz --api-key gw_YOUR_KEY --base-url https://your-gateway.com
|
|
26
|
+
|
|
27
|
+
# Or configure once
|
|
28
|
+
hejaz --api-key gw_YOUR_KEY --base-url https://your-gateway.com
|
|
29
|
+
# Config saved to ~/.hejaz/config.json — subsequent runs just:
|
|
30
|
+
hejaz
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Chat with AI
|
|
37
|
+
> Tell me about this project structure
|
|
38
|
+
|
|
39
|
+
# Use slash commands
|
|
40
|
+
> /model gemini-3-flash-preview
|
|
41
|
+
> /kb islamic-knowledge, sales
|
|
42
|
+
> /session new
|
|
43
|
+
> /help
|
|
44
|
+
|
|
45
|
+
# AI can use OS tools (with permission prompts)
|
|
46
|
+
> Read the package.json and suggest improvements
|
|
47
|
+
> Search for all TODO comments in src/
|
|
48
|
+
> Run the test suite
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## CLI Options
|
|
52
|
+
|
|
53
|
+
| Flag | Short | Description |
|
|
54
|
+
|------|-------|-------------|
|
|
55
|
+
| `--api-key` | `-k` | Gateway API key |
|
|
56
|
+
| `--base-url` | `-u` | Gateway URL (default: http://localhost:8080) |
|
|
57
|
+
| `--model` | `-m` | Default model |
|
|
58
|
+
| `--tenant-id` | `-t` | Tenant identifier |
|
|
59
|
+
| `--kb` | | Knowledge base IDs (comma-separated) |
|
|
60
|
+
| `--version` | `-v` | Show version |
|
|
61
|
+
| `--help` | | Show help |
|
|
62
|
+
|
|
63
|
+
## OS Agent Tools
|
|
64
|
+
|
|
65
|
+
| Tool | Permission | Description |
|
|
66
|
+
|------|-----------|-------------|
|
|
67
|
+
| `read_file` | Auto | Read file with line numbers |
|
|
68
|
+
| `glob` | Auto | File pattern search |
|
|
69
|
+
| `grep` | Auto | Content regex search |
|
|
70
|
+
| `list_dir` | Auto | Directory listing |
|
|
71
|
+
| `tree` | Auto | Directory tree |
|
|
72
|
+
| `write_file` | Confirm | Create/overwrite file |
|
|
73
|
+
| `edit_file` | Confirm | Exact string replacement |
|
|
74
|
+
| `bash` | Dangerous | Shell command execution |
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
~/.hejaz/
|
|
80
|
+
├── config.json # API key, model, base URL
|
|
81
|
+
├── permissions.json # File access rules
|
|
82
|
+
├── mcp_servers.json # MCP server configs
|
|
83
|
+
└── sessions/ # Session cache
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|