@tomagranate/corsa 1.1.1 → 1.2.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 CHANGED
@@ -76,6 +76,12 @@ cwd = "./backend"
76
76
  corsa
77
77
  ```
78
78
 
79
+ 4. Optional: install the `corsa` AI skill from this repository:
80
+
81
+ ```bash
82
+ npx skills add tomagranate/corsa
83
+ ```
84
+
79
85
  ## CLI Reference
80
86
 
81
87
  ### Commands
@@ -85,6 +91,7 @@ corsa
85
91
  | `corsa` | Start the TUI dashboard |
86
92
  | `corsa init` | Create a sample config file in the current directory |
87
93
  | `corsa mcp` | Start the MCP server for AI agent integration |
94
+ | `corsa ctl <subcommand>` | Control running processes through the MCP API |
88
95
 
89
96
  ### Options
90
97
 
@@ -92,6 +99,19 @@ corsa
92
99
  |--------|-------------|
93
100
  | `-c, --config <path>` | Path to config file (default: `corsa.config.toml`) |
94
101
  | `-h, --help` | Show help message |
102
+ | `-v, --version` | Show version information |
103
+
104
+ ### `ctl` Subcommands
105
+
106
+ | Subcommand | Description |
107
+ |------------|-------------|
108
+ | `corsa ctl list` | List all processes with status and recent logs (`ps`/`ls` aliases) |
109
+ | `corsa ctl logs <name>` | Get recent logs for a process |
110
+ | `corsa ctl stop <name>` | Stop a running process (`rm` alias) |
111
+ | `corsa ctl restart <name>` | Restart a process |
112
+ | `corsa ctl clear <name>` | Clear process logs |
113
+ | `corsa ctl send-keys <name> --key <value>` | Send keypresses/text to an interactive process |
114
+ | `corsa ctl reload` | Reload config and restart processes |
95
115
 
96
116
  ### Examples
97
117
 
@@ -108,6 +128,22 @@ corsa init
108
128
 
109
129
  # Start MCP server for AI integration
110
130
  corsa mcp
131
+
132
+ # List processes via CLI control API
133
+ corsa ctl list
134
+ corsa ctl ls
135
+
136
+ # Read logs with filtering
137
+ corsa ctl logs backend --lines 200 --search ERROR --search-type substring
138
+
139
+ # Stop a process (alias)
140
+ corsa ctl rm backend
141
+
142
+ # Send interactive input
143
+ corsa ctl send-keys repl --key "help" --key return
144
+
145
+ # Machine-readable output for agents/scripts
146
+ corsa ctl list --json
111
147
  ```
112
148
 
113
149
  ## Configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomagranate/corsa",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "A Terminal User Interface (TUI) for running multiple local development servers and tools simultaneously",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,12 +8,15 @@
8
8
  },
9
9
  "files": [
10
10
  "bin",
11
- "scripts"
11
+ "scripts",
12
+ "schemas"
12
13
  ],
13
14
  "scripts": {
14
15
  "dev": "bun run src/index.tsx",
15
16
  "build": "bun build src/index.tsx --compile --minify --outfile dist/corsa",
16
17
  "build:all": "bun run scripts/build-all.ts",
18
+ "config-schema:generate": "bun run scripts/generate-config-schema.ts",
19
+ "config-schema:check": "bun run config-schema:generate && git diff --exit-code -- schemas/corsa.schema.json",
17
20
  "postinstall": "node scripts/postinstall.cjs",
18
21
  "check": "biome check --fix",
19
22
  "check:nofix": "biome check",
@@ -51,6 +54,7 @@
51
54
  "@modelcontextprotocol/sdk": "^1.25.3",
52
55
  "@opentui/core": "^0.1.72",
53
56
  "@opentui/react": "^0.1.72",
57
+ "@xterm/headless": "^6.0.0",
54
58
  "fuzzysort": "^3.1.0",
55
59
  "react": "^19.2.3",
56
60
  "zod": "^4.3.6",
@@ -0,0 +1,180 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "tools": {
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "properties": {
10
+ "name": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "command": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "args": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "cwd": {
25
+ "type": "string"
26
+ },
27
+ "env": {
28
+ "type": "object",
29
+ "propertyNames": {
30
+ "type": "string"
31
+ },
32
+ "additionalProperties": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "cleanup": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ }
41
+ },
42
+ "description": {
43
+ "type": "string"
44
+ },
45
+ "healthCheck": {
46
+ "type": "object",
47
+ "properties": {
48
+ "url": {
49
+ "type": "string"
50
+ },
51
+ "interval": {
52
+ "type": "integer",
53
+ "exclusiveMinimum": 0,
54
+ "maximum": 9007199254740991
55
+ },
56
+ "retries": {
57
+ "type": "integer",
58
+ "exclusiveMinimum": 0,
59
+ "maximum": 9007199254740991
60
+ }
61
+ },
62
+ "required": ["url"],
63
+ "additionalProperties": false
64
+ },
65
+ "ui": {
66
+ "type": "object",
67
+ "properties": {
68
+ "label": {
69
+ "type": "string"
70
+ },
71
+ "url": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "required": ["label", "url"],
76
+ "additionalProperties": false
77
+ },
78
+ "dependsOn": {
79
+ "type": "array",
80
+ "items": {
81
+ "type": "string"
82
+ }
83
+ },
84
+ "interactive": {
85
+ "type": "boolean"
86
+ }
87
+ },
88
+ "required": ["name", "command"],
89
+ "additionalProperties": false
90
+ }
91
+ },
92
+ "home": {
93
+ "type": "object",
94
+ "properties": {
95
+ "enabled": {
96
+ "type": "boolean"
97
+ },
98
+ "title": {
99
+ "type": "string"
100
+ },
101
+ "titleFont": {
102
+ "type": "string",
103
+ "enum": ["tiny", "block", "shade", "slick", "huge", "grid", "pallet"]
104
+ },
105
+ "titleAlign": {
106
+ "type": "string",
107
+ "enum": ["left", "center"]
108
+ }
109
+ },
110
+ "additionalProperties": false
111
+ },
112
+ "mcp": {
113
+ "type": "object",
114
+ "properties": {
115
+ "enabled": {
116
+ "type": "boolean"
117
+ },
118
+ "port": {
119
+ "type": "integer",
120
+ "minimum": 1,
121
+ "maximum": 65535
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ },
126
+ "processes": {
127
+ "type": "object",
128
+ "properties": {
129
+ "cleanupOrphans": {
130
+ "type": "boolean"
131
+ }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "ui": {
136
+ "type": "object",
137
+ "properties": {
138
+ "sidebarPosition": {
139
+ "type": "string",
140
+ "enum": ["left", "right"]
141
+ },
142
+ "horizontalTabPosition": {
143
+ "type": "string",
144
+ "enum": ["top", "bottom"]
145
+ },
146
+ "widthThreshold": {
147
+ "type": "number",
148
+ "exclusiveMinimum": 0
149
+ },
150
+ "theme": {
151
+ "type": "string"
152
+ },
153
+ "maxLogLines": {
154
+ "type": "integer",
155
+ "exclusiveMinimum": 0,
156
+ "maximum": 9007199254740991
157
+ },
158
+ "showTabNumbers": {
159
+ "type": "boolean"
160
+ },
161
+ "showLineNumbers": {
162
+ "anyOf": [
163
+ {
164
+ "type": "boolean"
165
+ },
166
+ {
167
+ "type": "string",
168
+ "const": "auto"
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ "additionalProperties": false
174
+ }
175
+ },
176
+ "required": ["tools"],
177
+ "additionalProperties": false,
178
+ "title": "corsa config",
179
+ "description": "Configuration schema for corsa.config.toml"
180
+ }
@@ -0,0 +1,13 @@
1
+ import { mkdir, writeFile } from "node:fs/promises";
2
+ import { dirname, join } from "node:path";
3
+ import { $ } from "bun";
4
+ import { createCorsaConfigJsonSchema } from "../src/lib/config/schema";
5
+
6
+ const schemaPath = join(import.meta.dir, "..", "schemas", "corsa.schema.json");
7
+ const schema = createCorsaConfigJsonSchema();
8
+
9
+ await mkdir(dirname(schemaPath), { recursive: true });
10
+ await writeFile(schemaPath, `${JSON.stringify(schema, null, 2)}\n`, "utf-8");
11
+ await $`bunx @biomejs/biome format --write ${schemaPath}`;
12
+
13
+ console.log(`Generated ${schemaPath}`);