@k-leumas/queque-cli 0.6.1 → 0.7.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 CHANGED
@@ -27,7 +27,7 @@ Welcome to the **future** –
27
27
  - zsh
28
28
  - Node.js 24 or newer
29
29
  - [jq](https://jqlang.github.io/jq/)
30
- - Claude Code signed in, or an Anthropic API key (see [Authentication](#authentication))
30
+ - Claude Code signed in, an Anthropic API key, an OpenAI API key, or Ollama (see [Choose a provider](#choose-a-provider))
31
31
 
32
32
 
33
33
  ```shell
@@ -37,7 +37,11 @@ qq init zsh && source ~/.zshrc
37
37
 
38
38
  </details>
39
39
 
40
- ## Authentication
40
+ ## Choose a provider
41
+
42
+ Claude is the default. If you already use Claude Code or have an Anthropic API key, there is nothing to set up. To use OpenAI or a local Ollama model instead (both in beta), run `qq init provider` once.
43
+
44
+ ### Claude (default)
41
45
 
42
46
  QueQue talks to Claude in one of two ways. You only need one.
43
47
 
@@ -47,26 +51,53 @@ QueQue talks to Claude in one of two ways. You only need one.
47
51
  claude /login
48
52
  ```
49
53
 
50
- On this route QueQue uses whatever account and default model Claude Code is set to; it passes no model flag. `claude -p` runs with its tools disabled and session persistence off, so it only answers the query. If `claude` is not on your `PATH` or is not signed in, `??` shows a message like this one:
54
+ On this route QueQue uses whatever account and default model Claude Code is set to; it passes no model flag. `claude -p` runs with its tools disabled and session persistence off, so it only answers the query. If `claude` is not signed in, `??` shows this message and puts back what you typed:
51
55
 
52
56
  ```text
53
- QueQue: Claude is not authenticated. Run `claude /login`, or set ANTHROPIC_API_KEY in the environment or .env.local.
57
+ QueQue: Claude is not authenticated. Run `claude /login`, or set ANTHROPIC_API_KEY in the environment or ~/.env.local. To use OpenAI or Ollama instead, run `qq init provider`.
54
58
  ```
55
59
 
60
+ If `claude` is not on your `PATH` at all, the message starts with `QueQue: No AI provider is ready.` and lists the same three options. Any other `claude -p` failure, such as an overloaded API or a usage limit, shows `QueQue: Claude Code could not answer (claude -p failed).`; run `claude -p "hi"` to see the underlying error.
61
+
56
62
  **Anthropic API key.** QueQue looks for `ANTHROPIC_API_KEY` in this order:
57
63
 
58
64
  1. **Environment variable**: `export ANTHROPIC_API_KEY="sk-ant-..."` in `~/.zshrc`, above the QueQue source line.
59
- 2. **`.env.local` file**: a line `ANTHROPIC_API_KEY=sk-ant-...`. The background daemon searches upward from the directory it was started in, usually the directory your first terminal opened in, and reads the file once. A `~/.env.local` is found from any start directory inside your home directory.
65
+ 2. **`.env.local` file**: a line `ANTHROPIC_API_KEY=sk-ant-...` in `~/.env.local`. QueQue reads only `~/.env.local` itself: never the directory you run `??` from and never a directory above your home directory, so a `.env.local` inside a project (or in `/tmp`) is not used. The background daemon reads the file once, when it starts.
60
66
 
61
67
  An empty or whitespace-only value counts as unset.
62
68
 
63
- **Which route wins.** A non-empty `ANTHROPIC_API_KEY` always wins: QueQue calls Claude through the Anthropic SDK and never runs `claude -p`. There is no automatic fallback in either direction. If the API-key request fails, QueQue shows that error instead of trying your Claude Code login, and a failed `claude -p` run never falls back to a key. To switch to your Claude Code login, remove the key from your environment and `.env.local`, then restart the daemon.
69
+ **Which route wins.** A non-empty `ANTHROPIC_API_KEY` always wins: QueQue calls Claude through the Anthropic SDK and never runs `claude -p`. There is no automatic fallback in either direction. If the API-key request fails, QueQue shows that error instead of trying your Claude Code login, and a failed `claude -p` run never falls back to a key. To switch to your Claude Code login, remove the key from your environment and `~/.env.local`, then restart the daemon.
64
70
 
65
71
  `QQ_MODEL` picks the model on the API-key route only. The default is `claude-sonnet-5`.
66
72
 
73
+ ### OpenAI or Ollama (beta)
74
+
75
+ Run the picker in a terminal:
76
+
77
+ ```shell
78
+ qq init provider
79
+ ```
80
+
81
+ It asks one question (Claude, OpenAI or Ollama), saves your answer to `~/.config/qq/provider.json`, and restarts the background daemon. Nothing is probed until you answer, and `??` never asks you to choose.
82
+
83
+ - **OpenAI (beta)** needs `OPENAI_API_KEY` in your environment (`export OPENAI_API_KEY="sk-..."` in `~/.zshrc`, above the QueQue source line) or in `~/.env.local`. Set the key first, open a new terminal, then run `qq init provider`. QueQue never asks for the key and never stores it: `provider.json` only records that you chose OpenAI. The default model is `gpt-5.5`.
84
+ - **Ollama (beta)** lists the models you have already pulled and pins the one you pick. If Ollama is not running, the picker prints the download link and `ollama serve`. If it has no models, the picker tells you to run `ollama pull`. When `provider.json` has a `baseUrl` (a remote server), the picker lists and keeps that server; to go back to Ollama on this machine, remove `baseUrl` from `provider.json`.
85
+
86
+ Your choice sticks. If the chosen provider fails, `??` shows that provider's error; QueQue never switches to a different provider on its own. Run `qq init provider` again to switch, including back to Claude.
87
+
88
+ `provider.json` is plain JSON you can edit by hand, and QueQue reads it again on every `??`:
89
+
90
+ ```json
91
+ {"version":1,"provider":"ollama","model":"gemma4"}
92
+ ```
93
+
94
+ Add `"model"` to an OpenAI pin to change the model, or `"baseUrl"` to an Ollama pin to use a server other than `http://localhost:11434`. Keys are not allowed in this file: an extra field such as `"apiKey"` makes it invalid, and `??` then tells you to fix the file or run `qq init provider`. Set `QQ_PROVIDER_FILE` to an absolute path to keep the file somewhere else; a relative path makes the pin invalid.
95
+
67
96
  ### After changing your key or settings
68
97
 
69
- A background daemon answers `??` for every terminal. It starts with your first interactive shell (and again on the next `??` if it is not running) and inherits that shell's environment. It reads `ANTHROPIC_API_KEY`, `QQ_MODEL`, `.env.local` and `~/.config/qq/config.json` once, when it starts.
98
+ A background daemon answers `??` for every terminal. It starts with your first interactive shell (and again on the next `??` if it is not running) and inherits that shell's environment. It reads `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `QQ_MODEL`, `~/.env.local` and `~/.config/qq/config.json` once, when it starts. `provider.json` is the exception: it is read on every `??`.
99
+
100
+ - `qq init provider` restarts the daemon for you, so running it after exporting a new key is enough.
70
101
 
71
102
  - Put your `export` lines in `~/.zshrc` above the `# queque shell integration` block that `qq init zsh` appended, so the daemon started during shell startup sees them.
72
103
  - After changing any of them, restart the daemon from a shell that has the new values:
@@ -86,9 +117,9 @@ find docker containers using port 3000??
86
117
  git undo last commit but keep changes??
87
118
  ```
88
119
 
89
- A selection UI opens in-terminal. Rows stream in as Claude answers, and you can pick one before the rest have arrived. What you typed stays in the dim `queque ›` header, and the FILTER box opens empty: type to narrow the list, even while `thinking…` is still showing. Move with the arrow keys and press `Enter`. The command lands in your buffer exactly as shown, ready to run or edit. QueQue never runs it for you.
120
+ A selection UI opens in-terminal. Rows appear as the provider answers. Only Claude streams them today, so with Claude you can pick one before the rest have arrived; OpenAI and Ollama show the whole list at once. What you typed stays in the dim `queque ›` header, and the FILTER box opens empty: type to narrow the list, even while `thinking…` is still showing. Move with the arrow keys and press `Enter`. The command lands in your buffer exactly as shown, ready to run or edit. QueQue never runs it for you.
90
121
 
91
- Press `Esc` to cancel. It stops the request to Claude and restores what you were typing, so you can tweak your intent and hit `??` again.
122
+ Press `Esc` to cancel. It stops the request to the provider and restores what you were typing, so you can tweak your intent and hit `??` again.
92
123
 
93
124
  A command that matches a destructive pattern (`rm`, `sudo` and similar) is marked `⚠ review carefully — this command may be destructive`. The mark is a warning only; the row stays selectable.
94
125
 
@@ -110,7 +141,7 @@ Without Zellij, QueQue falls back to an inline TUI in your current terminal sess
110
141
 
111
142
  QueQue is **insertion-only**: it writes commands into your shell buffer — you press Enter to run them. QueQue never auto-executes suggestions.
112
143
 
113
- **What leaves your machine.** Both routes (`claude -p` and the API key) send the same prompt to Claude:
144
+ **What leaves your machine (Claude and OpenAI, hosted).** The provider you chose receives the same context, whichever it is: Claude (through `claude -p` or the API key) or OpenAI (through `OPENAI_API_KEY`). Only that one provider receives it:
114
145
 
115
146
  - Your query text and current working directory
116
147
  - Your OS platform name (for example `darwin` or `linux`) and shell name (`zsh`)
@@ -118,6 +149,8 @@ QueQue is **insertion-only**: it writes commands into your shell buffer — you
118
149
  - Parsed filename hints from your query (no disk reads)
119
150
  - The names of installed tools that appear in QueQue's public tool catalog. Your full `PATH` inventory, functions and aliases stay on your machine. `QQ_TOOL_AWARENESS=0` stops even the catalog names.
120
151
 
152
+ **With Ollama**, the same context goes only to your Ollama server (`http://localhost:11434` by default, or the `baseUrl` in `provider.json`). With the default setting, nothing leaves your machine. A `baseUrl` that starts with `http://` and names another machine sends that context across the network unencrypted; for a remote server, use an `https://` URL (for example behind a reverse proxy).
153
+
121
154
  **What QueQue never sends:**
122
155
 
123
156
  - File contents (unless you explicitly opt in later with `QQ_ALLOW_FILE_READ=1`)