Repository navigation
Conversation
There was a problem hiding this comment.
Looks good. I compared each subcommand and example with the service spec in packages/cli/src/commands/commands.ts and with packages/cli/src/services/service-config.ts. The keys and argument forms (hostname, cors, set env <name> <value>) are correct, and the descriptions match the CLI wording. This is a docs-only change, so there was nothing to run.
Public API: unchanged (documentation only).
One fix worth making: the cors example's caption says it adds an origin, but set cors replaces the whole list (see the inline comment).
| opencode service set hostname 0.0.0.0 | ||
| ``` | ||
|
|
||
| Allow an extra CORS origin. |
There was a problem hiding this comment.
opencode service set cors doesn't add an origin. It replaces the saved list with the comma-separated value (service-config.ts writes value.split(",") as-is). Someone who already has origins configured and follows this example would lose them. Could you reword it, e.g. "Set the allowed CORS origins (comma-separated; replaces the current list)." The same wording is in services/www/src/docs/content/cli/commands.mdx, if you want to fix it there too.
The page had no section for the background server the CLI starts for your account, even though service is one of the commands the v2 CLI defines. Each subcommand is documented with the CLI's own wording.
set cors replaces the whole list rather than adding an origin, and the value is a comma-separated list of HTTP(S) origins.
ca480df to
169c8f8
Compare
|
Good catch — fixed in 169c8f8.
The docs site builds rc=0 with the change, and the corrected text is in the built output. |
Issue for this PR
No issue.
Type of change
What does this PR do?
The CLI reference has no
opencode servicesection, even thoughserviceis one of the commands the v2 CLI defines and the background server it manages is what every local client connects to.This adds the section:
start,restart,status,stop,get,setandunset, with the wording the CLI itself uses. It is the same content the v2 reference carries, brought over so this page matches the CLI it documents.How did you verify your code works?
Checked the subcommands and their descriptions against
packages/cli/src/commands/commands.tson this branch and againstopencode service --help, and built the docs site.Screenshots / recordings
Not a UI change.
Checklist