@k-leumas/queque-cli 0.1.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 +178 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +1265 -0
- package/dist/cli/main.js.map +1 -0
- package/package.json +63 -0
- package/shell/zsh/qq.zsh +291 -0
package/README.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# QueQue
|
|
2
|
+
|
|
3
|
+
QueQue is a `zsh`-integrated command helper that is intended to open from a literal `??` trigger in your live shell buffer, gather the text around the cursor, and return an explainable shell command back into the buffer instead of executing it for you.
|
|
4
|
+
|
|
5
|
+
## Current Status
|
|
6
|
+
|
|
7
|
+
This repository is still in early Phase 1.
|
|
8
|
+
|
|
9
|
+
- The TypeScript CLI scaffold exists.
|
|
10
|
+
- The `qq client` and `qq daemon` command surfaces exist.
|
|
11
|
+
- The real `zsh` widget and shell sourcing script do **not** exist yet.
|
|
12
|
+
|
|
13
|
+
That means you can wire up the CLI for active development today, but you cannot yet source a finished `??` shell integration from this repo.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- `zsh`
|
|
18
|
+
- Node `24.14.1`
|
|
19
|
+
- `pnpm`
|
|
20
|
+
|
|
21
|
+
If you use `nvm`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
nvm use
|
|
25
|
+
corepack enable
|
|
26
|
+
pnpm install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Local Development
|
|
30
|
+
|
|
31
|
+
Install dependencies and start the watch build in one terminal:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm install
|
|
35
|
+
pnpm dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That keeps `dist/cli/main.js` rebuilt as you edit `src/cli/main.ts`.
|
|
39
|
+
|
|
40
|
+
If you want a simple restart wrapper that logs when it reacts to file changes, run:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm dev:restart
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
It rebuilds first, then starts the dev command, and logs when it sees a change and restarts.
|
|
47
|
+
|
|
48
|
+
In another terminal, use the current checks:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm typecheck
|
|
52
|
+
pnpm test:run
|
|
53
|
+
pnpm build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Load The CLI In Your Shell Today
|
|
57
|
+
|
|
58
|
+
Because the project already defines a `qq` bin that points at `dist/cli/main.js`, the simplest development setup is to add a shell function that executes the built file from your checkout.
|
|
59
|
+
|
|
60
|
+
Add this to `~/.zshrc`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export QQ_DEV_ROOT="$HOME/dev/queque"
|
|
64
|
+
|
|
65
|
+
qq() {
|
|
66
|
+
node "$QQ_DEV_ROOT/dist/cli/main.js" "$@"
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Then reload your shell:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
source ~/.zshrc
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
With `pnpm dev` running, every rebuild updates the code behind `qq` immediately.
|
|
77
|
+
|
|
78
|
+
## Live Debug Log
|
|
79
|
+
|
|
80
|
+
For shell/widget debugging, you can opt into a plain-text log by setting:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
export QQ_DEBUG_LOG_FILE=/tmp/qq-debug.log
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
When enabled, the repo writes to:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
/tmp/qq-debug.log
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
You can watch it live with:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
tail -f /tmp/qq-debug.log
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If you want to change the location, point `QQ_DEBUG_LOG_FILE` somewhere else before sourcing your shell config.
|
|
99
|
+
|
|
100
|
+
The interactive shell hook also prewarms the daemon once per shell session, so the first `??` does not pay the full startup cost.
|
|
101
|
+
|
|
102
|
+
## Claude Provider
|
|
103
|
+
|
|
104
|
+
The foreground client can now ask Claude for a strict JSON command suggestion.
|
|
105
|
+
|
|
106
|
+
Set these environment variables before running the client:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# read from .env.local in the repo root, or export directly
|
|
110
|
+
ANTHROPIC_API_KEY="..."
|
|
111
|
+
# optional
|
|
112
|
+
QQ_MODEL="claude-3-haiku-20240307"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If `QQ_MODEL` is omitted, the provider asks Anthropic for the available models and picks the cheapest one it can see. You can still force a specific model with `QQ_MODEL` if you need to.
|
|
116
|
+
|
|
117
|
+
The LLM mode is selected with:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
qq client --request-file /tmp/request.json --result-file /tmp/result.json --result-mode llm
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
When the current directory is inside a git repository, the prompt includes the repo root, branch, and dirty state as extra context.
|
|
124
|
+
|
|
125
|
+
## Smoke-Test The Current CLI
|
|
126
|
+
|
|
127
|
+
Right now the commands are scaffolds and intentionally fail with explicit `not implemented` errors. That is still useful for verifying your shell wiring.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
qq --help
|
|
131
|
+
qq client --request-file /tmp/request.json --result-file /tmp/result.json
|
|
132
|
+
qq daemon --socket /tmp/qq-test.sock
|
|
133
|
+
qq daemon --ensure --socket /tmp/qq-test.sock
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Expected result today: help output works, and the command handlers exit with `not implemented` messages instead of performing real work.
|
|
137
|
+
|
|
138
|
+
## Commit Workflow
|
|
139
|
+
|
|
140
|
+
This repo now uses:
|
|
141
|
+
|
|
142
|
+
- `commitlint` to enforce Conventional Commits
|
|
143
|
+
- `lefthook` to run Git hooks locally
|
|
144
|
+
- `biome` for formatting and linting
|
|
145
|
+
|
|
146
|
+
After `pnpm install`, Lefthook installs automatically through the `prepare` script.
|
|
147
|
+
|
|
148
|
+
Current hook behavior:
|
|
149
|
+
|
|
150
|
+
- `pre-commit`: runs `biome check --write --staged` and `pnpm test:run`
|
|
151
|
+
- `commit-msg`: runs `commitlint --edit`
|
|
152
|
+
|
|
153
|
+
Examples of valid commit messages:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
feat: add daemon bootstrap
|
|
157
|
+
fix: handle missing request file
|
|
158
|
+
docs: document shell wiring
|
|
159
|
+
chore: add biome and commit hooks
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Future `zsh` Integration
|
|
163
|
+
|
|
164
|
+
Once the repo adds `shell/zsh/qq.zsh`, the shell wiring will look more like this:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
export QQ_DEV_ROOT="$HOME/dev/queque"
|
|
168
|
+
|
|
169
|
+
qq() {
|
|
170
|
+
node "$QQ_DEV_ROOT/dist/cli/main.js" "$@"
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if [[ -f "$QQ_DEV_ROOT/shell/zsh/qq.zsh" ]]; then
|
|
174
|
+
source "$QQ_DEV_ROOT/shell/zsh/qq.zsh"
|
|
175
|
+
fi
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
At that point, `qq` will still resolve to your local checkout, and the sourced widget file can register the `??` trigger against the same development build.
|