noninteractive 0.1.0 → 0.1.1
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 +65 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# noninteractive
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run interactive CLI login flows non-interactively. Built for AI agents (like Claude Code) that need to complete setup wizards, OAuth flows, and interactive installers without a human at the keyboard.
|
|
4
|
+
|
|
5
|
+
Spawns commands in a real PTY session, so programs that check `isTTY`, render select menus, or use raw terminal mode all work correctly.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
4
8
|
|
|
5
9
|
```bash
|
|
6
|
-
|
|
10
|
+
npx noninteractive
|
|
7
11
|
```
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## Usage
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
|
|
16
|
+
# Start a session (runs `npx workos` in a background PTY)
|
|
17
|
+
npx noninteractive start workos
|
|
18
|
+
|
|
19
|
+
# Read what's on screen
|
|
20
|
+
npx noninteractive read workos
|
|
21
|
+
|
|
22
|
+
# Send keystrokes (Enter to confirm a prompt)
|
|
23
|
+
npx noninteractive send workos ""
|
|
24
|
+
|
|
25
|
+
# Send text input
|
|
26
|
+
npx noninteractive send workos "my-api-key"
|
|
27
|
+
|
|
28
|
+
# Stop a session
|
|
29
|
+
npx noninteractive stop workos
|
|
30
|
+
|
|
31
|
+
# List active sessions
|
|
32
|
+
npx noninteractive list
|
|
13
33
|
```
|
|
14
34
|
|
|
15
|
-
|
|
35
|
+
## Example: WorkOS AuthKit setup
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Start the installer
|
|
39
|
+
npx noninteractive start workos
|
|
40
|
+
|
|
41
|
+
# Wait for it to load, then read the prompt
|
|
42
|
+
npx noninteractive read workos
|
|
43
|
+
# ◆ Run the AuthKit installer?
|
|
44
|
+
# │ ● Yes / ○ No
|
|
45
|
+
# └
|
|
46
|
+
|
|
47
|
+
# Press Enter to confirm "Yes"
|
|
48
|
+
npx noninteractive send workos ""
|
|
49
|
+
|
|
50
|
+
# Read the next prompt
|
|
51
|
+
npx noninteractive read workos
|
|
52
|
+
# ◆ You are on main. Create a feature branch?
|
|
53
|
+
# │ ● Create feat/add-workos-authkit
|
|
54
|
+
# │ ○ Continue on current branch
|
|
55
|
+
# │ ○ Cancel
|
|
56
|
+
# └
|
|
57
|
+
|
|
58
|
+
# Press Enter to confirm
|
|
59
|
+
npx noninteractive send workos ""
|
|
60
|
+
|
|
61
|
+
# Done? Stop the session
|
|
62
|
+
npx noninteractive stop workos
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## How it works
|
|
66
|
+
|
|
67
|
+
1. `start` spawns a detached daemon process that runs the target command inside a real pseudo-terminal (PTY)
|
|
68
|
+
2. The daemon listens on a unix socket at `~/.noninteractive/sessions/<name>.sock`
|
|
69
|
+
3. `read`, `send`, and `stop` connect to that socket to interact with the running process
|
|
70
|
+
4. The PTY ensures the child process sees a real terminal — `isTTY` is true, ANSI colors work, interactive menus render correctly
|
|
71
|
+
|
|
72
|
+
## Why
|
|
73
|
+
|
|
74
|
+
AI coding agents can run shell commands, but they can't interact with prompts that wait for user input. This tool bridges that gap — the agent starts the command, reads the output, decides what to send, and completes the flow autonomously.
|