askq-cli 0.1.4
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 +39 -0
- package/bin/askq +38 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# askq
|
|
2
|
+
|
|
3
|
+
Native GUI for AskUserQuestion-style multiple-choice prompts, for AI coding
|
|
4
|
+
agents. A blocking CLI: feed it the questions JSON, the user answers in a real
|
|
5
|
+
window, it prints the answers JSON to stdout and exits. Also runs as an MCP
|
|
6
|
+
server.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g askq-cli
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This installs the `askq` command. (The package is `askq-cli` because the bare
|
|
13
|
+
name `askq` is blocked by npm's similarity filter; the CLI itself is `askq`.) The
|
|
14
|
+
right prebuilt binary for your platform is pulled in automatically as an optional
|
|
15
|
+
dependency (`askq-darwin-arm64`, `askq-linux-x64`, `askq-linux-arm64`).
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# CLI: pipe questions in, read answers out
|
|
21
|
+
echo '{"questions":[{"question":"Pick one","header":"Demo","multiSelect":false,
|
|
22
|
+
"options":[{"label":"A","description":"first"},{"label":"B"}]}]}' | askq
|
|
23
|
+
# => {"questions":[...],"answers":{"Pick one":"A"}}
|
|
24
|
+
|
|
25
|
+
askq --help # full input/output schema
|
|
26
|
+
askq mcp # run as an MCP server (stdio) exposing ask_user_question
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## MCP
|
|
30
|
+
|
|
31
|
+
Register it with any MCP client (Claude Code `.mcp.json`, Cursor
|
|
32
|
+
`.cursor/mcp.json`, …):
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{ "mcpServers": { "askq": { "command": "askq", "args": ["mcp"] } } }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Source, the Claude Code plugin (PreToolUse hook + skill), and full docs:
|
|
39
|
+
https://github.com/AngusFu/askq
|
package/bin/askq
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the `askq` CLI. The actual native binary ships in a
|
|
3
|
+
// per-platform optional dependency (askq-<platform>-<arch>); npm installs only
|
|
4
|
+
// the one matching the host. We resolve it and exec, passing stdin/stdout/
|
|
5
|
+
// stderr straight through (askq is a blocking stdio tool — questions in on
|
|
6
|
+
// stdin, answers out on stdout) and proxying the exit code.
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
const { spawnSync } = require("child_process");
|
|
10
|
+
|
|
11
|
+
// node platform/arch -> our subpackage suffix (they already line up:
|
|
12
|
+
// darwin/linux + arm64/x64).
|
|
13
|
+
const pkg = `askq-${process.platform}-${process.arch}`;
|
|
14
|
+
|
|
15
|
+
let binary;
|
|
16
|
+
try {
|
|
17
|
+
binary = require.resolve(`${pkg}/bin/askq`);
|
|
18
|
+
} catch (_) {
|
|
19
|
+
console.error(
|
|
20
|
+
`askq: no prebuilt binary for ${process.platform}-${process.arch}.\n` +
|
|
21
|
+
`The optional dependency "${pkg}" is not installed.\n` +
|
|
22
|
+
`Supported platforms: darwin-arm64, linux-x64, linux-arm64.\n` +
|
|
23
|
+
`If you installed with --no-optional or --omit=optional, reinstall without it.`
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
29
|
+
if (result.error) {
|
|
30
|
+
console.error(`askq: failed to run ${binary}: ${result.error.message}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
// Forward the child's signal/exit code.
|
|
34
|
+
if (result.signal) {
|
|
35
|
+
process.kill(process.pid, result.signal);
|
|
36
|
+
} else {
|
|
37
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "askq-cli",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Native GUI for AskUserQuestion-style multiple-choice prompts (CLI + MCP server) for AI coding agents. Pops a window, prints the chosen answers as JSON.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"askq": "bin/askq"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/askq"
|
|
10
|
+
],
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"askq-darwin-arm64": "0.1.4",
|
|
13
|
+
"askq-linux-x64": "0.1.4",
|
|
14
|
+
"askq-linux-arm64": "0.1.4"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=16"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/AngusFu/askq.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/AngusFu/askq#readme",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/AngusFu/askq/issues"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": "AngusFu",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"askuserquestion",
|
|
31
|
+
"mcp",
|
|
32
|
+
"cli",
|
|
33
|
+
"gui",
|
|
34
|
+
"tauri",
|
|
35
|
+
"claude",
|
|
36
|
+
"prompt"
|
|
37
|
+
]
|
|
38
|
+
}
|