portcall 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +81 -2
- package/dist/portcall.mjs +2777 -0
- package/package.json +49 -3
- package/schema.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joris Gallot
|
|
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
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# portcall
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run your local dev servers in the background, on fixed ports, with logs your coding agents can read.
|
|
4
|
+
|
|
5
|
+
When several apps run at once, dev servers pile up: ports to keep apart, terminals to keep open, and coding agents that start a second `pnpm dev`, forget the one they started, or can't see the backend error behind a failing request. portcall gives each project a `portcall.json`, runs its servers detached, and answers the questions an agent (or you) keeps asking:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
portcall status # what runs, on which port
|
|
9
|
+
portcall up # start what is not running, wait for the ports
|
|
10
|
+
portcall logs server --errors # the error behind that 500, with its stack trace
|
|
11
|
+
portcall restart web
|
|
12
|
+
portcall ports # every project's ports, and conflicts between them
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm i -g portcall
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Node 20.19+, macOS or Linux.
|
|
22
|
+
|
|
23
|
+
## Configure
|
|
24
|
+
|
|
25
|
+
`portcall.json` at the project root:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"$schema": "https://unpkg.com/portcall/schema.json",
|
|
30
|
+
"name": "myapp",
|
|
31
|
+
"services": {
|
|
32
|
+
"server": { "command": "pnpm dev:server", "port": 3000 },
|
|
33
|
+
"web": {
|
|
34
|
+
"command": "pnpm dev:web",
|
|
35
|
+
"port": 5173,
|
|
36
|
+
"env": { "VITE_API_URL": "http://localhost:{ports.server}" }
|
|
37
|
+
},
|
|
38
|
+
"db": { "port": 5432 }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- Each command runs with `PORT` set to its service's port. `env` takes `{port}` and `{ports.<service>}`.
|
|
44
|
+
- A service without `command` is external (a database in Docker, a tunnel...): portcall only checks that its port answers.
|
|
45
|
+
- `cwd` runs a command in a subfolder; `readyTimeout` (seconds, default 60) bounds how long `up` waits for the port.
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
| Command | |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `portcall up [service...]` | Start services and wait for their port. A no-op for services already running; prints the log tail when one crashes. |
|
|
52
|
+
| `portcall down [service...]` | Stop services (the whole process group, so `pnpm dev` takes its children with it). |
|
|
53
|
+
| `portcall restart [service...]` | Stop, then start. |
|
|
54
|
+
| `portcall status [--all]` | State, port, pid and uptime of each service; `--all` for every known project. |
|
|
55
|
+
| `portcall logs [service...]` | `-n 200`, `--since 5m`, `--grep <regex>`, `--errors`, `-f`. |
|
|
56
|
+
| `portcall ports` | Every known project's ports, with conflicts. Exits 1 on a conflict. |
|
|
57
|
+
| `portcall agents` | Prints a section to paste into `AGENTS.md` / `CLAUDE.md`. |
|
|
58
|
+
|
|
59
|
+
Every command takes `--json`, `-p <project>` (act on a known project from anywhere) and `-C <dir>`.
|
|
60
|
+
|
|
61
|
+
### Service states
|
|
62
|
+
|
|
63
|
+
| State | Meaning |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `running` / `starting` | portcall runs it; its port answers / doesn't yet |
|
|
66
|
+
| `crashed` | portcall ran it and it exited on its own (`status` shows the exit code, `logs` why) |
|
|
67
|
+
| `stopped` | nothing on its port |
|
|
68
|
+
| `unmanaged` | its port is held by a process started inside the project, outside portcall (say, in a terminal). `up` leaves it be; `down --force` stops it |
|
|
69
|
+
| `taken` | its port is held by something outside the project. portcall never touches it |
|
|
70
|
+
| `elsewhere` | portcall runs it from another checkout of the project (a git worktree) |
|
|
71
|
+
|
|
72
|
+
## With coding agents
|
|
73
|
+
|
|
74
|
+
Run `portcall agents` and paste the result into the project's agent instructions. Agents then check `portcall status` instead of guessing, start servers with `portcall up` (which never starts a second copy), and read `portcall logs --errors` after a failing request instead of asking you to copy the terminal.
|
|
75
|
+
|
|
76
|
+
## How it works
|
|
77
|
+
|
|
78
|
+
`portcall up` starts one small detached supervisor per service. It runs the command in its own process group, writes its output, timestamped and without escape codes, to `~/.portcall/logs/<project>/<service>.log` (the previous run is kept as `.log.1`), and records how the service ended. State lives in `~/.portcall` (`PORTCALL_HOME` to move it). Servers keep running when the terminal or agent session that started them ends.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|