Skip to content

Commit c248cec

Browse files
authored
feat(cli): add agent-safe exec and log filters
Adds Northflank-style parser-safe sandbox exec flags and top-level log filters for agent/operator workflows.
1 parent d3aceec commit c248cec

8 files changed

Lines changed: 492 additions & 23 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ Discover the full agent contract with:
147147
miosa capabilities --json
148148
```
149149

150+
### Agent-safe exec and logs
151+
152+
Use explicit command flags when a command contains shell flags, pipes, redirects,
153+
or `bash -c` style arguments:
154+
155+
```bash
156+
miosa sandbox exec <sandbox-id> \
157+
--cwd /workspace \
158+
--cmd "npm install && npm run build" \
159+
--shell-cmd "bash -lc" \
160+
--json
161+
```
162+
163+
Top-level logs can target a resource explicitly and filter recent output:
164+
165+
```bash
166+
miosa logs --deployment <app-id> --lines 200 --contains error --json
167+
miosa logs --sandbox <sandbox-id> --regex "500|panic|failed" --json
168+
```
169+
150170
### Deploy sub-commands
151171

152172
```bash

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@miosa/cli",
3-
"version": "1.0.46",
3+
"version": "1.0.47",
44
"description": "MIOSA platform CLI — projects, sandboxes, deploys, databases, more",
55
"type": "module",
66
"bin": {

src/commands/capabilities.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,51 @@ const manifest: CapabilitiesManifest = {
555555
"AUTH error",
556556
],
557557
},
558+
{
559+
id: "operational_debugging",
560+
title: "Inspect Logs And Exec Safely",
561+
goal: "Give agents parser-safe command execution and filtered logs for app/debug loops.",
562+
status: "stable",
563+
steps: [
564+
{
565+
command:
566+
'miosa sandbox exec <sandbox-id> --cwd /workspace --cmd "npm run build" --json',
567+
purpose:
568+
"Run a command string without requiring -- separator or argv reconstruction.",
569+
json: true,
570+
},
571+
{
572+
command:
573+
'miosa sandbox exec <sandbox-id> --cwd /workspace --cmd "npm install && npm run build" --shell-cmd "bash -lc" --json',
574+
purpose:
575+
"Run shell expressions, pipes, redirects, and chained commands explicitly.",
576+
json: true,
577+
},
578+
{
579+
command:
580+
'miosa logs --deployment <app-id> --lines 200 --contains error --json',
581+
purpose:
582+
"Fetch recent deployment logs filtered for a specific text signal.",
583+
json: true,
584+
},
585+
{
586+
command:
587+
'miosa logs --sandbox <sandbox-id> --regex "500|panic|failed" --json',
588+
purpose: "Filter sandbox logs by regex for automated diagnostics.",
589+
json: true,
590+
},
591+
],
592+
success_signals: [
593+
"exec exit_code 0",
594+
"logs JSON parses",
595+
"logs.count reflects filtered line count",
596+
],
597+
failure_signals: [
598+
"unknown option from command flags",
599+
"empty logs during known failure",
600+
"regex syntax error",
601+
],
602+
},
558603
{
559604
id: "safe_workspace_cleanup",
560605
title: "Safe Workspace Cleanup",

0 commit comments

Comments
 (0)