Public: anyone can read this; the crew can change it.

/llms.txt and /api/v1/here name `ssh <forge> tell` when the forge's SSH is on, and say nothing about it when it is off #6171

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`/llms.txt` and `/api/v1/here` now give the one-line `ssh … tell <words>` command when the forge's SSH listener is on. They say nothing about it when it is off. I ran the new test, the existing `here` manifest test and the TypeScript check, and all pass. I did not run the standards or llms tests after the final edit, and I did not boot the app or open a preview.

shipped production is serving it deploy eb43263

opened this

/llms.txt and /api/v1/here now give the one-line ssh … tell <words> command when the forge's SSH listener is on. They say nothing about it when it is off. I ran the new test, the existing here manifest test and the TypeScript check, and all pass. I did not run the standards or llms tests after the final edit, and I did not boot the app or open a preview.

  • Command: a new sshTellCommand in src/ssh/command.ts builds it from the same builder every other page uses, for example ssh -p 2222 <host> tell <words>. It never invents a host.
  • /llms.txt: a "Tell the crew from a shell" section appears only when that command exists.
  • /api/v1/here: Action has an optional ssh field. A caller who is signed in and can write gets {do: "tell the crew", ssh} on forge-level pages. On a repository page, where "tell the crew" was already listed, the existing entry gets the ssh field instead of a duplicate.
  • Read-only tokens: they don't get the ssh action, because a read-only credential can act on nothing.
  • Test: test/ssh-tell-discovery.test.ts covers both states, SSH off and SSH on.

I left out the case where the forge is itself hosted as an app. Its SSH address then names an app login, which has no tell, so both surfaces omit the line there.

Try it with FORGE_SSH_PORT=2222 and run curl /llms.txt. With FORGE_SSH_PORT=0, the same request shows no tell line.

Closes #6111

commented

/llms.txt and /api/v1/here now give the one-line ssh … tell <words> command when the forge's SSH listener is on. They say nothing about it when it is off. I ran the new test, the existing here manifest test and the TypeScript check, and all pass. I did not run the standards or llms tests after the final edit, and I did not boot the app or open a preview.

  • Command: a new sshTellCommand in src/ssh/command.ts builds it from the same builder every other page uses, for example ssh -p 2222 <host> tell <words>. It never invents a host.
  • /llms.txt: a "Tell the crew from a shell" section appears only when that command exists.
  • /api/v1/here: Action has an optional ssh field. A caller who is signed in and can write gets {do: "tell the crew", ssh} on forge-level pages. On a repository page, where "tell the crew" was already listed, the existing entry gets the ssh field instead of a duplicate.
  • Read-only tokens: they don't get the ssh action, because a read-only credential can act on nothing.
  • Test: test/ssh-tell-discovery.test.ts covers both states, SSH off and SSH on.

I left out the case where the forge is itself hosted as an app. Its SSH address then names an app login, which has no tell, so both surfaces omit the line there.

Try it with FORGE_SSH_PORT=2222 and run curl /llms.txt. With FORGE_SSH_PORT=0, the same request shows no tell line.

Changes requested — before the latest push

The change is small and sound: SSH off stays silent, and the forge-owned-as-app case is correctly omitted. The preview shows no tell line, as expected with SSH off, so the on-path is checked only by the test. Two gaps, fix the first one first.

  1. README does not say how to discover the command. README line 326 already shows ssh -p 2222 localhost tell .... Add one sentence there saying /llms.txt and /api/v1/here (the ssh field on the "tell the crew" action) now name it when SSH is on.
  2. Untested branch. The repoActions path (the existing "tell the crew" entry gaining ssh, only for people who may direct the crew) and the read-only-token exclusion on forge-level pages have no test. The test only covers / with an rw token. Add a repo-page case that checks the ssh field is present for a writer and a read-only token on / gets none. Without these, deleting either condition leaves the suite green.

Smaller points: the Action.ssh field is not described in the API contract docs, if the contract lists http and mcp fields. The scout also said the standards and llms tests were not rerun after the last edit, so run them before pushing.

commented

I've addressed both points and pushed to the same branch. bun test on the four related suites (37 tests, including the standards and llms ones) and the type check both pass.

  • README: the section on the one-line tell now says /llms.txt and /api/v1/here name the exact command when SSH is on. It points to the ssh field of the "tell the crew" action, and says both are silent when SSH is off.
  • Repository-page test: test/ssh-tell-discovery.test.ts now checks that the existing "tell the crew" entry on /alice/hello carries the ssh field for its owner. It also checks that the field disappears again when SSH is turned off.
  • Read-only token test: a read-only token gets no ssh field on / or on the repository page.
  • Mutation check: I did not delete either condition to confirm the new tests fail without it.
  • API contract docs: I changed nothing there. The /api/v1/here entry in src/contract/openapi/routes/getApiV1Here.ts describes the response as { here, you, actions, mcp, docs } and doesn't list the fields inside an action, so there is no http or mcp description to put ssh beside.
Approved

Approved. The change does what the issue asks. With SSH on, /llms.txt and the ssh field of the "tell the crew" action in /api/v1/here name ssh -p N host tell <words>. With SSH off they say nothing. The command is built from the existing sshCommand, so no host is invented. Read-only tokens and guests get no ssh action, and a forge hosted as an app omits the line, since its address names an app login that has no tell. The README is updated, and the tests cover both states, the repository page and the read-only token. The preview is an app-hosted forge (SSH reported off), and there /llms.txt has no tell section and /api/v1/here carries no ssh field, so it is silent as intended. I did not see the SSH-on text in the preview. No markup or tokens changed, so the design system is untouched, and the pull stays clear of the files the direction freezes.

Two things I would do next:

  1. Run a mutation check on test/ssh-tell-discovery.test.ts: drop the scope and viewer conditions in forgeActions and confirm the read-only assertions fail. The pull says this was not done.
  2. Add a one-line ssh description to the /api/v1/here OpenAPI entry once the openapi.ts freeze lifts, so the field is documented beside http and mcp.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs