feat(cli): add reload command

This commit is contained in:
Dax Raad
2026-09-17 09:21:41 -04:00
parent b52f241294
commit 0018f08832
7 changed files with 425 additions and 3 deletions
+129 -1
View File
@@ -163,7 +163,7 @@
}
},
"description": "Shut down and rebuild every loaded location. Pending permissions and forms are cancelled; running sessions continue with fresh services at the next step boundary. Emits location.shutdown for client recovery and responds once all replacement builds settle.",
"summary": "Reload locations"
"summary": "Reload configuration"
}
},
"/api/agent": {
@@ -8440,6 +8440,109 @@
"summary": "Find files"
}
},
"/api/experimental/fs/write": {
"post": {
"tags": ["filesystem"],
"operationId": "experimental.fs.write",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"anyOf": [
{
"type": "object",
"properties": {
"directory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string",
"description": "An absolute path or a path relative to the requested location. Missing parent directories are created."
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/Location.PublicRef"
},
"data": {
"$ref": "#/components/schemas/FileSystem.Write"
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestErrorEncoded"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedErrorEncoded"
}
}
}
}
},
"description": "Write the raw request body to an absolute path or a path relative to the requested location, creating parent directories, and return the resolved absolute path. Unlike read, the target is not confined to the location. Experimental: may change without compatibility guarantees.",
"summary": "Write file",
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
},
"required": true
}
}
},
"/api/command": {
"get": {
"tags": ["command"],
@@ -13537,6 +13640,16 @@
"required": ["path", "type"],
"additionalProperties": false
},
"FileSystem.Write": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
},
"required": ["path"],
"additionalProperties": false
},
"ForbiddenErrorEncoded": {
"type": "object",
"properties": {
@@ -13572,6 +13685,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13761,6 +13877,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13826,6 +13945,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13878,6 +14000,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -14006,6 +14131,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
+129 -1
View File
@@ -163,7 +163,7 @@
}
},
"description": "Shut down and rebuild every loaded location. Pending permissions and forms are cancelled; running sessions continue with fresh services at the next step boundary. Emits location.shutdown for client recovery and responds once all replacement builds settle.",
"summary": "Reload locations"
"summary": "Reload configuration"
}
},
"/api/agent": {
@@ -8440,6 +8440,109 @@
"summary": "Find files"
}
},
"/api/experimental/fs/write": {
"post": {
"tags": ["filesystem"],
"operationId": "experimental.fs.write",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"anyOf": [
{
"type": "object",
"properties": {
"directory": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string",
"description": "An absolute path or a path relative to the requested location. Missing parent directories are created."
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/Location.PublicRef"
},
"data": {
"$ref": "#/components/schemas/FileSystem.Write"
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestErrorEncoded"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedErrorEncoded"
}
}
}
}
},
"description": "Write the raw request body to an absolute path or a path relative to the requested location, creating parent directories, and return the resolved absolute path. Unlike read, the target is not confined to the location. Experimental: may change without compatibility guarantees.",
"summary": "Write file",
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
},
"required": true
}
}
},
"/api/command": {
"get": {
"tags": ["command"],
@@ -13537,6 +13640,16 @@
"required": ["path", "type"],
"additionalProperties": false
},
"FileSystem.Write": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
},
"required": ["path"],
"additionalProperties": false
},
"ForbiddenErrorEncoded": {
"type": "object",
"properties": {
@@ -13572,6 +13685,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13761,6 +13877,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13826,6 +13945,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -13878,6 +14000,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -14006,6 +14131,9 @@
"required": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"when": {
"type": "array",
"items": {
@@ -442,6 +442,14 @@ View all subcommands and flags.
$ opencode service --help
```
## reload
`opencode reload` reloads configuration without restarting the server. Running sessions continue with fresh services at the next step boundary.
```bash
$ opencode reload
```
## api
`opencode api` makes a request to the running server.