@hongymagic/q 2026.324.0 → 2026.328.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 +29 -1
- package/dist/q.js +1546 -352
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -65,18 +65,29 @@ echo "how do I restart docker" | q
|
|
|
65
65
|
|--------|-------------|
|
|
66
66
|
| `-p, --provider <name>` | Override the default provider |
|
|
67
67
|
| `-m, --model <id>` | Override the default model |
|
|
68
|
+
| `--mode <mode>` | Output mode: `command` (default) or `explain` |
|
|
68
69
|
| `--copy` | Copy answer to clipboard |
|
|
69
70
|
| `--no-copy` | Disable copy (overrides config) |
|
|
70
71
|
| `--debug` | Enable debug logging to stderr |
|
|
71
72
|
| `-h, --help` | Show help message |
|
|
72
73
|
| `-v, --version` | Show version |
|
|
73
74
|
|
|
75
|
+
### Output Modes
|
|
76
|
+
|
|
77
|
+
By default, `q` returns terse, copy/paste-ready commands. Use `--mode explain` for detailed explanations:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
q how do I restart docker # Returns the command(s)
|
|
81
|
+
q --mode explain how do I restart docker # Returns a detailed explanation
|
|
82
|
+
```
|
|
83
|
+
|
|
74
84
|
### Commands
|
|
75
85
|
|
|
76
86
|
```bash
|
|
77
87
|
q config path # Print config file path
|
|
78
88
|
q config init # Create example config
|
|
79
|
-
q
|
|
89
|
+
q config doctor # Diagnose config and provider issues
|
|
90
|
+
q providers # List configured providers + model and credential status
|
|
80
91
|
```
|
|
81
92
|
|
|
82
93
|
## Configuration
|
|
@@ -87,6 +98,19 @@ Config is loaded from (later overrides earlier):
|
|
|
87
98
|
2. `./config.toml` (project-specific)
|
|
88
99
|
3. Environment: `Q_PROVIDER`, `Q_MODEL`, `Q_COPY`
|
|
89
100
|
|
|
101
|
+
Each provider can specify its own default `model`, which takes precedence over `default.model` but is overridden by `Q_MODEL` or `--model`:
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[default]
|
|
105
|
+
provider = "anthropic"
|
|
106
|
+
model = "claude-sonnet-4-20250514" # Global default
|
|
107
|
+
|
|
108
|
+
[providers.anthropic]
|
|
109
|
+
type = "anthropic"
|
|
110
|
+
api_key_env = "ANTHROPIC_API_KEY"
|
|
111
|
+
model = "claude-sonnet-4-20250514" # Per-provider default
|
|
112
|
+
```
|
|
113
|
+
|
|
90
114
|
See [config.example.toml](config.example.toml) for all options.
|
|
91
115
|
|
|
92
116
|
### Provider Types
|
|
@@ -170,6 +194,10 @@ export ANTHROPIC_API_KEY="your-key-here"
|
|
|
170
194
|
|
|
171
195
|
Run `q config init` to create a default configuration file.
|
|
172
196
|
|
|
197
|
+
**Diagnose config issues:**
|
|
198
|
+
|
|
199
|
+
Run `q config doctor` to check config files, environment overrides, and provider health at a glance.
|
|
200
|
+
|
|
173
201
|
**Failure logs:**
|
|
174
202
|
|
|
175
203
|
Most non-usage failures print a short error plus `Full log: <path>` on stderr. Logs are written to your platform log directory, for example `~/.local/state/q/errors` on Linux.
|