@drisp/cli 0.3.39

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nadeem Mohammed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,284 @@
1
+ # Drisp CLI
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@drisp/cli)](https://www.npmjs.com/package/@drisp/cli)
4
+ [![license](https://img.shields.io/npm/l/@drisp/cli)](https://github.com/drisplabs/cli/blob/main/LICENSE)
5
+ [![CI](https://github.com/drisplabs/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/drisplabs/cli/actions/workflows/ci.yml)
6
+ [![node](https://img.shields.io/node/v/@drisp/cli)](https://nodejs.org)
7
+
8
+ **Deterministic orchestration for non-deterministic agents.**
9
+
10
+ AI coding agents are getting better at reasoning -- but long-horizon tasks still break. Prompts drift, results vary between runs, and there's no good way to package what worked into something your whole team can reuse. The agent isn't the bottleneck anymore. The harness is.
11
+
12
+ Athenaflow is a **workflow runtime** for [Claude Code](https://claude.com/product/claude-code) and [OpenAI Codex](https://chatgpt.com/codex). It adds structured workflows, real-time observability, session persistence, and a plugin system -- so agent-driven tasks produce consistent results across runs, teams, and models.
13
+
14
+ ```
15
+ npm install -g @drisp/cli && drisp
16
+ ```
17
+
18
+ <p align="center">
19
+ <img src="assets/demo.gif" alt="Drisp terminal UI" width="960" />
20
+ </p>
21
+
22
+ > **[Read the docs](https://athenaflow.in/docs)** -- guides, workflow authoring, plugin API, and more.
23
+
24
+ <br>
25
+
26
+ ## Why Athenaflow?
27
+
28
+ Coding agents work well for one-off tasks. The moment you need **repeatable, multi-step execution** -- e2e test generation, migration plans, release workflows -- things fall apart:
29
+
30
+ | Pain point | What goes wrong |
31
+ | --------------------------- | ----------------------------------------------------------------- |
32
+ | **No reproducibility** | Same prompt, same model, different output every time |
33
+ | **Long-horizon drift** | Without checkpoints, agents compound small mistakes into big ones |
34
+ | **Prompts aren't portable** | What one developer got working doesn't transfer to the team |
35
+ | **Black-box execution** | You see the final output, not the 40 tool calls that got there |
36
+ | **CI as an afterthought** | Most harnesses are built for interactive use, not pipelines |
37
+
38
+ Athenaflow introduces a **workflow layer** between you and the underlying harness.
39
+ Workflows are declarative, versioned, and shareable -- they define prompt templates,
40
+ multi-session loops with completion tracking, plugin bundles, isolation policies,
41
+ and model preferences. The runtime handles the rest.
42
+
43
+ **Workflows encode what works** -- not just a prompt, but the loop logic, progress tracking, and tool config that make it reliable. Define once, run anywhere.
44
+
45
+ **A marketplace for agent workflows** -- browse, install, and update community-built workflows like packages.
46
+
47
+ **Real-time observability** -- a live terminal feed of every tool call, permission decision, and result as it happens.
48
+
49
+ **Sessions persist and resume** -- every run is saved to SQLite. Pick up where you left off with full state.
50
+
51
+ **Harness-agnostic** -- same workflows, same UI, same session model across Claude Code and Codex.
52
+
53
+ **CI-native** -- `drisp exec` runs headlessly with safe defaults, JSONL output, and structured exit codes.
54
+
55
+ <br>
56
+
57
+ ## Get Started
58
+
59
+ **1. Install** -- requires Node.js 20+ and at least one harness (`claude` or `codex`) on your PATH.
60
+
61
+ ```bash
62
+ npm install -g @drisp/cli
63
+ ```
64
+
65
+ **2. Run** -- the setup wizard handles theme, harness verification, and your first workflow.
66
+
67
+ ```bash
68
+ drisp
69
+ ```
70
+
71
+ **3. Explore**
72
+
73
+ ```bash
74
+ drisp resume # Pick up where you left off
75
+ drisp sessions # Browse past sessions
76
+ drisp workflow install e2e-test-builder # Install a workflow from the marketplace
77
+ ```
78
+
79
+ > **[Full walkthrough](https://athenaflow.in/docs)**
80
+
81
+ <br>
82
+
83
+ ## Harnesses
84
+
85
+ | Harness | Status | Integration |
86
+ | ----------------------------------------- | --------- | ---------------------------------------------- |
87
+ | Claude Code | Supported | Hook events forwarded over a local Unix socket |
88
+ | [OpenAI Codex](https://chatgpt.com/codex) | Supported | Integrated via `codex app-server` protocol |
89
+ | opencode | Planned | Adapter placeholder; not yet enabled |
90
+
91
+ <br>
92
+
93
+ ## Workflows
94
+
95
+ Workflows package prompt templates, loop strategies, plugin dependencies, isolation policies, and model config into a single portable unit. Anyone can author and share them.
96
+
97
+ ```bash
98
+ drisp workflow list # See what's installed
99
+ drisp workflow search # Browse available workflows
100
+ drisp workflow install e2e-test-builder # Install from the marketplace
101
+ drisp workflow use e2e-test-builder # Set as the active workflow
102
+ drisp workflow upgrade # Re-sync all from source
103
+ ```
104
+
105
+ Manage marketplace sources:
106
+
107
+ ```bash
108
+ drisp marketplace add owner/repo # Add a marketplace source
109
+ drisp marketplace add ./local/path # Add a local marketplace
110
+ drisp marketplace list # List configured sources
111
+ drisp marketplace remove owner/repo # Remove a source
112
+ ```
113
+
114
+ Install from a local file or a specific marketplace ref:
115
+
116
+ ```bash
117
+ drisp workflow install ./path/to/workflow.json
118
+ drisp workflow install e2e-test-builder@lespaceman/athena-workflow-marketplace
119
+ ```
120
+
121
+ > **[Author your own workflows](https://athenaflow.in/docs)**
122
+
123
+ <br>
124
+
125
+ ## CI / Automation
126
+
127
+ `drisp exec` is built for pipelines. Safe by default -- permission and question hooks fail unless you opt in.
128
+
129
+ ```bash
130
+ drisp exec "summarize risk in this PR" # plain text
131
+ drisp exec "run checks" --json --on-permission=deny --on-question=empty # JSONL
132
+ drisp exec "write release notes" --output-last-message release-notes.md # artifact
133
+ ```
134
+
135
+ <details>
136
+ <summary>GitHub Actions</summary>
137
+
138
+ ```yaml
139
+ name: drisp-exec
140
+ on: [pull_request]
141
+ jobs:
142
+ drisp:
143
+ runs-on: ubuntu-latest
144
+ steps:
145
+ - uses: actions/checkout@v4
146
+ - uses: actions/setup-node@v4
147
+ with:
148
+ node-version: 20
149
+ - run: npm ci
150
+ - run: npx @drisp/cli exec "summarize risk in this PR" \
151
+ --json --on-permission=deny --on-question=empty \
152
+ --output-last-message drisp-summary.md
153
+ - uses: actions/upload-artifact@v4
154
+ with:
155
+ name: drisp-summary
156
+ path: drisp-summary.md
157
+ ```
158
+
159
+ </details>
160
+
161
+ <details>
162
+ <summary>GitLab CI</summary>
163
+
164
+ ```yaml
165
+ drisp_exec:
166
+ image: node:20
167
+ script:
168
+ - npm ci
169
+ - npx @drisp/cli exec "summarize pipeline status" \
170
+ --json --on-permission=deny --on-question=empty \
171
+ --output-last-message drisp-summary.md
172
+ artifacts:
173
+ paths:
174
+ - drisp-summary.md
175
+ ```
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary>Exit codes</summary>
181
+
182
+ | Code | Meaning |
183
+ | ---- | --------------------------------- |
184
+ | `0` | Success |
185
+ | `2` | Usage / validation error |
186
+ | `3` | Bootstrap / configuration failure |
187
+ | `4` | Runtime / process failure |
188
+ | `5` | Non-interactive policy failure |
189
+ | `6` | Timeout exceeded |
190
+ | `7` | Output write failure |
191
+
192
+ </details>
193
+
194
+ <br>
195
+
196
+ ## Configuration
197
+
198
+ Config merges in order: **global &rarr; project &rarr; CLI flags**.
199
+
200
+ ```
201
+ ~/.config/athena/config.json # Global defaults
202
+ {projectDir}/.athena/config.json # Project overrides
203
+ ```
204
+
205
+ ```json
206
+ {
207
+ "harness": "claude-code",
208
+ "model": "sonnet",
209
+ "plugins": ["/path/to/plugin"],
210
+ "activeWorkflow": "e2e-test-builder"
211
+ }
212
+ ```
213
+
214
+ <details>
215
+ <summary>CLI flags</summary>
216
+
217
+ | Flag | Description |
218
+ | --------------- | --------------------------------------------- |
219
+ | `--project-dir` | Project directory (default: cwd) |
220
+ | `--plugin` | Path to a plugin directory (repeatable) |
221
+ | `--isolation` | `strict` (default) · `minimal` · `permissive` |
222
+ | `--theme` | `dark` (default) · `light` · `high-contrast` |
223
+ | `--ascii` | ASCII-only UI glyphs |
224
+ | `--verbose` | Extra rendering detail |
225
+
226
+ **exec-only:**
227
+
228
+ | Flag | Description |
229
+ | ----------------------- | ------------------------------------------------------ |
230
+ | `--continue` | Resume most recent exec session (or `--continue=<id>`) |
231
+ | `--json` | JSONL lifecycle events on stdout |
232
+ | `--output-last-message` | Write final assistant message to a file |
233
+ | `--ephemeral` | Disable session persistence for this run |
234
+ | `--on-permission` | `allow` · `deny` · `fail` (default) |
235
+ | `--on-question` | `empty` · `fail` (default) |
236
+ | `--timeout-ms` | Hard timeout for the run |
237
+
238
+ </details>
239
+
240
+ <details>
241
+ <summary>Commands</summary>
242
+
243
+ | Command | Description |
244
+ | ------------------- | ------------------------------------------------------------ |
245
+ | _(default)_ | Start interactive session in cwd |
246
+ | `setup` | Re-run setup wizard |
247
+ | `sessions` | Interactive session picker |
248
+ | `resume [id]` | Resume most recent or specific session |
249
+ | `exec "<prompt>"` | Headless run for CI / scripting |
250
+ | `workflow <sub>` | `install` · `list` · `search` · `remove` · `upgrade` · `use` |
251
+ | `marketplace <sub>` | `add` · `remove` · `list` |
252
+
253
+ </details>
254
+
255
+ <br>
256
+
257
+ ## Development
258
+
259
+ ```bash
260
+ npm install && npm run build # Build
261
+ npm test # Test
262
+ npm run typecheck # Type-check
263
+ npm run lint # Lint
264
+ npm run dev # Watch mode
265
+ ```
266
+
267
+ <details>
268
+ <summary>Codex protocol bindings</summary>
269
+
270
+ Files in `src/harnesses/codex/protocol/generated` are auto-generated from the `codex app-server` schema -- do not edit by hand. Refresh with:
271
+
272
+ ```bash
273
+ scripts/update-codex-protocol-snapshot.mjs
274
+ ```
275
+
276
+ Commit the output so others can build without the generator.
277
+
278
+ </details>
279
+
280
+ <br>
281
+
282
+ ## License
283
+
284
+ [MIT](LICENSE)
@@ -0,0 +1,93 @@
1
+ import {
2
+ McpOptionsStep,
3
+ StepStatus,
4
+ collectMcpServersWithOptions,
5
+ installWorkflowFromSource,
6
+ installWorkflowPlugins,
7
+ resolveWorkflow,
8
+ writeGlobalConfig
9
+ } from "./chunk-LPG5WBPV.js";
10
+
11
+ // src/setup/steps/WorkflowInstallWizard.tsx
12
+ import { useState, useEffect, useCallback, useRef } from "react";
13
+ import { Box } from "ink";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ function WorkflowInstallWizard({ source, onDone }) {
16
+ const [phase, setPhase] = useState("installing");
17
+ const [message, setMessage] = useState("");
18
+ const [workflowName, setWorkflowName] = useState("");
19
+ const [mcpServers, setMcpServers] = useState([]);
20
+ const doneCalledRef = useRef(false);
21
+ useEffect(() => {
22
+ if (phase !== "installing") return;
23
+ try {
24
+ const name = installWorkflowFromSource(source);
25
+ const resolved = resolveWorkflow(name);
26
+ const pluginDirs = installWorkflowPlugins(resolved);
27
+ const servers = collectMcpServersWithOptions(pluginDirs);
28
+ setWorkflowName(name);
29
+ setMessage(`Installed workflow: ${name}`);
30
+ if (servers.length > 0) {
31
+ if (process.stdin.isTTY) {
32
+ setMcpServers(servers);
33
+ setPhase("mcp-options");
34
+ } else {
35
+ const defaults = {};
36
+ for (const server of servers) {
37
+ defaults[server.serverName] = server.options[0].env;
38
+ }
39
+ console.log(
40
+ `Non-interactive mode: auto-selected defaults for MCP servers: ${servers.map((s) => s.serverName).join(", ")}`
41
+ );
42
+ writeGlobalConfig({
43
+ workflowSelections: {
44
+ [name]: { mcpServerOptions: defaults }
45
+ }
46
+ });
47
+ setPhase("done");
48
+ }
49
+ } else {
50
+ setPhase("done");
51
+ }
52
+ } catch (err) {
53
+ setMessage(`Error: ${err.message}`);
54
+ setPhase("error");
55
+ }
56
+ }, [phase, source]);
57
+ useEffect(() => {
58
+ if (doneCalledRef.current) return;
59
+ if (phase === "done") {
60
+ doneCalledRef.current = true;
61
+ onDone(0);
62
+ } else if (phase === "error") {
63
+ doneCalledRef.current = true;
64
+ onDone(1);
65
+ }
66
+ }, [phase, onDone]);
67
+ const handleMcpComplete = useCallback(
68
+ (choices) => {
69
+ if (Object.keys(choices).length > 0) {
70
+ writeGlobalConfig({
71
+ workflowSelections: {
72
+ [workflowName]: {
73
+ mcpServerOptions: choices
74
+ }
75
+ }
76
+ });
77
+ }
78
+ setMessage(`Installed workflow: ${workflowName}`);
79
+ setPhase("done");
80
+ },
81
+ [workflowName]
82
+ );
83
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
84
+ phase === "installing" && /* @__PURE__ */ jsx(StepStatus, { status: "verifying", message: "Installing workflow..." }),
85
+ phase === "mcp-options" && /* @__PURE__ */ jsx(McpOptionsStep, { servers: mcpServers, onComplete: handleMcpComplete }),
86
+ phase === "done" && /* @__PURE__ */ jsx(StepStatus, { status: "success", message }),
87
+ phase === "error" && /* @__PURE__ */ jsx(StepStatus, { status: "error", message })
88
+ ] });
89
+ }
90
+ export {
91
+ WorkflowInstallWizard as default
92
+ };
93
+ //# sourceMappingURL=WorkflowInstallWizard-5JWVHIVJ.js.map