@notiamo/runner 0.2.1 → 0.2.2

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.
Files changed (3) hide show
  1. package/README.md +38 -0
  2. package/dist/cli.js +395 -254
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -27,6 +27,7 @@ From a checkout of the Notiamo repository: `pnpm --filter @notiamo/runner build`
27
27
  | `notiamo-runner logs` | The last 50 lines of the log. |
28
28
  | `notiamo-runner stop` | Stop the service until the next login or boot. |
29
29
  | `notiamo-runner uninstall` | Remove the service (the runner's folder stays). |
30
+ | `notiamo-runner env <projectId>` | Make or show the env file this machine gives the runs of one project (see "Your own projects" below). |
30
31
  | `notiamo-runner start` | Run in the foreground. This is what the service runs; you rarely need it. |
31
32
 
32
33
  The service is a launchd agent `com.notiamo.runner` on macOS, a Scheduled Task "Notiamo runner" (at logon) on
@@ -114,6 +115,43 @@ that arrives while the first still runs here).
114
115
  Each run at the same time has its own slot folder, `projects/0`, `projects/1` or `projects/2`, made when the runner
115
116
  starts: a run's sandbox cannot read the other slots at all, even a project cloned there after the run began.
116
117
 
118
+ ## Your own projects: an environment for the runs
119
+
120
+ A run on a GitHub project gets a clean clone and nothing else. For a client's WordPress site that is all it needs.
121
+ For a SaaS project of your own, the agent also needs to run the tests, and those need a database, a file store, a
122
+ mail catcher and a `.env`. The runner machine gives them to the runs of one project with a plain file:
123
+
124
+ ```sh
125
+ npx @notiamo/runner env <projectId> # add --profile <name> for a named runner
126
+ ```
127
+
128
+ `<projectId>` is the last part of the project page's address in Notiamo. The command makes
129
+ `~/.notiamo-runner/env/<projectId>.env` (or the profile's `env/` folder), readable by you only, and prints the path.
130
+ Put one `KEY=VALUE` per line (`#` comments, quotes and an `export ` prefix are fine; nothing is expanded). The next
131
+ run of that project gets the variables in its shell, and the agent is told their names (never the values). Remove
132
+ the file to take them away. The file never leaves the machine: Notiamo does not know it exists.
133
+
134
+ With the file present, the run's shell may also reach services on `127.0.0.1` on macOS: your Postgres, MinIO,
135
+ Mailpit, a dev server. You keep them running (Docker Desktop at login, say); the agent cannot start them, Docker
136
+ stays out of its reach. Point the variables at them, for example `DATABASE_URL=postgres://app:app@127.0.0.1:5450/app_test`.
137
+ On Linux the sandbox gives the shell its own network namespace, so `127.0.0.1` there is not the machine's: bind the
138
+ services to the machine's LAN address and add that host on the Runners card under "Extra hosts". Windows has no
139
+ shell sandbox, so there nothing stands between the shell and `127.0.0.1`.
140
+
141
+ Rules:
142
+
143
+ - **Dev and test values only.** The agent runs shell commands and can read every variable. Never a production key,
144
+ never a password you use elsewhere. Use the project's fake switches (`AI_FAKE=1`, `STRIPE_FAKE=1`…) instead of
145
+ real services where you can.
146
+ - `PATH`, `HOME`, the proxy and certificate variables (`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, `NODE_EXTRA_CA_CERTS`,
147
+ `SSL_CERT_*`), `NODE_OPTIONS`, `NODE_TLS_REJECT_UNAUTHORIZED`, `NOTIAMO_*`, `GIT_*`, `CLAUDE_*` and `ANTHROPIC_*` are
148
+ ignored (the log says so), and the runner's own variables always win over the file: the file can change what the
149
+ agent's commands see, never how Claude Code itself talks to Anthropic and Notiamo.
150
+ - Values of 6 characters or more are masked as `[secret]` in the transcript Notiamo receives, like the run's tokens.
151
+ Short values (`1`, `true`) are not.
152
+ - Keep **Runs at once** at 1 on a runner whose projects share a database through their env file: two runs of one
153
+ project at the same time would run their tests on the same database.
154
+
117
155
  ## A runner for one client
118
156
 
119
157
  When you make a runner in Notiamo, you can limit it to one client (workspace). It then takes only that client's runs.