@kaynooo/cli-proc 0.7.4 → 0.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # proc
2
2
 
3
- Three process and port helpers for Linux (also reachable as `proc pid|ports|procs`), reading `/proc` directly instead of shelling out to `ps`, `ss` or `lsof`: `pid` inspects one process, `ports` tells who listens on what, `procs` finds leftover or heavy dev processes.
3
+ Three process and port helpers for Linux, reading `/proc` directly instead of shelling out to `ps`, `ss` or `lsof`: `proc pid` inspects one process, `proc ports` tells who listens on what, `proc procs` finds leftover or heavy dev processes.
4
4
 
5
5
  ```sh
6
6
  bun install -g @kaynooo/cli-proc
@@ -10,23 +10,23 @@ bun install -g @kaynooo/cli-proc
10
10
 
11
11
  | Command | What it does |
12
12
  | --- | --- |
13
- | `pid <pid>` | executable, working directory, command line, parent chain up to init, user, start time and age, memory, open files and limits, the TCP and UDP ports it listens on, cgroup; `--env` adds the environment with secrets masked, `--json` everything |
14
- | `ports [port]` | the listening sockets (TCP and UDP, IPv4 and IPv6) with port, protocol, bound address, pid, command and working directory; a port Docker publishes shows its compose project and service |
15
- | `ports <port> --kill` | stops the owner: SIGTERM, and with `--force` SIGKILL after `--grace` (5s); asks on a terminal unless `--yes` |
16
- | `procs` | leftover or heavy dev processes grouped by origin, with count, total RSS and oldest age |
17
- | `procs --kill` | a dry run naming what would be stopped; `--yes` sends SIGTERM, then SIGKILL after `--grace` |
13
+ | `proc pid <pid>` | executable, working directory, command line, parent chain up to init, user, start time and age, memory, open files and limits, the TCP and UDP ports it listens on, cgroup; `--env` adds the environment with secrets masked, `--json` everything |
14
+ | `proc ports [port]` | the listening sockets (TCP and UDP, IPv4 and IPv6) with port, protocol, bound address, pid, command and working directory; a port Docker publishes shows its compose project and service |
15
+ | `proc ports <port> --kill` | stops the owner: SIGTERM, and with `--force` SIGKILL after `--grace` (5s); asks on a terminal unless `--yes` |
16
+ | `proc procs` | leftover or heavy dev processes grouped by origin, with count, total RSS and oldest age |
17
+ | `proc procs --kill` | a dry run naming what would be stopped; `--yes` sends SIGTERM, then SIGKILL after `--grace` |
18
18
 
19
- ## pid
19
+ ## proc pid
20
20
 
21
21
  A missing pid exits 1. What the calling user cannot read of another user's process (executable, working directory, open files, limits, environment) is left out and named at the end. The environment is off unless `--env` is given: a name that looks like a secret (kit's rule, shared with `ev` and `redact`) has its whole value masked, and a URL password, a well known token format, a private key or a long opaque token is masked inside any value; the command line is masked the same way.
22
22
 
23
- ## ports
23
+ ## proc ports
24
24
 
25
25
  Sockets come from `/proc/net/{tcp,tcp6,udp,udp6}` and are mapped to their owner through the inode in `/proc/<pid>/fd`, so only the calling user's processes show an owner; the others show `-`. A socket without a readable owner, or held by `docker-proxy`, takes the container publishing its port when `docker ps` answers (skipped quietly when docker is missing or its daemon unreachable).
26
26
 
27
- `ports <port>` exits 1 when nothing listens there. `--kill` refuses a process of another user, pid 1, this command and its ancestors, and a container's port, for which it prints the `docker stop <container>` to run instead.
27
+ A socket of another user shows `-` as its owner. `proc ports <port>` exits 1 when nothing listens there. `--kill` refuses a process of another user, pid 1, this command and its ancestors, and a container's port, for which it prints the `docker stop <container>` to run instead.
28
28
 
29
- ## procs
29
+ ## proc procs
30
30
 
31
31
  A process is listed when it is a dev tool (bun, node, vite, nuxt, next, chromium and chrome, playwright and WebKit browsers and their helpers, language servers, test runners) of the calling user and either:
32
32
 
@@ -35,6 +35,6 @@ A process is listed when it is a dev tool (bun, node, vite, nuxt, next, chromium
35
35
 
36
36
  The dev processes below a listed one, and those sharing its `--user-data-dir`, are listed with it, so a chromium whose main process was killed groups with its leftover helpers. Groups are named after the git root (else the nearest package manifest) of the working directory under the home folder, the browser profile, or else the command.
37
37
 
38
- `--min-mem <size>` (`500M`, `1.5G`, a bare number counting megabytes) sets the heavy bar and the least a left over process must use; `--older <duration>` (`30m`, `2h`, `1d`) keeps the processes at least that old. `--kill` never touches pid 1, shells, terminals, this command and its ancestors, or other users' processes, and counts the ones it left out.
38
+ `--min-mem <size>` (`500M`, `1.5G`, a bare number counting megabytes) sets the heavy bar and the least a left over process must use; `--older <duration>` (`30m`, `2h`, `1d`) keeps the processes at least that old. `--kill` sends SIGTERM, then SIGKILL after `--grace` to what is still there, and never touches pid 1, shells, terminals, this command and its ancestors, or other users' processes, and counts the ones it left out.
39
39
 
40
40
  Linux only. Start times assume the usual 100 clock ticks per second.