Files & Search
Reading and writing files in the resolved project, listing a directory, reading the working-tree status, and the three search endpoints behind text, filename and symbol lookup.
Send these requests to your own running server. Values stay in this browser.
How this works
Start a server with nikcli serve --hostname 127.0.0.1 --port 4096. Requests go
straight from this page to that address — the browser allows it because loopback counts as a
secure origin, and the server allows it because nikcli-ai.dev is in its CORS
allowlist.
To try things without touching your real sessions or config, start the server with
NIKCLI_TEST_HOME pointed at a throwaway directory — see
the guided tour.
Operations
7 endpoints, generated from the
server's own OpenAPI document. Every path also accepts the
directory and workspace query parameters that select which instance
handles the request.
| get | /find | find.text |
| get | /find/file | find.files |
| get | /find/symbol | find.symbols |
| get | /file | file.list |
| get | /file/content | file.read |
| put | /file/content | file.write |
| get | /file/status | file.status |
find.text | Name | In | Type | Required |
|---|---|---|---|
| pattern | query | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
({ path: { text: string } lines: { text: string } line_number: | number | "Infinity" | "-Infinity" | "NaN" absolute_offset: | number | "Infinity" | "-Infinity" | "NaN" submatches: ({ match: { text: string } start: | number | "Infinity" | "-Infinity" | "NaN" end: | number | "Infinity" | "-Infinity" | "NaN" })[] })[]
Example response captured
[
{
"path": {
"text": "greet.ts"
},
"lines": {
"text": " // TODO: localise this"
},
"line_number": 2,
"absolute_offset": 38,
"submatches": [
{
"match": {
"text": "TODO"
},
"start": 5,
"end": 9
}
]
}
] SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.find.text({
...
}) Try it
find.files | Name | In | Type | Required |
|---|---|---|---|
| query | query | string | required |
| dirs | query | "true" | "false" | null | optional |
| type | query | "file" | "directory" | null | optional |
| limit | query | string | null | optional |
| directory | query | string | optional |
| workspace | query | string | optional |
string[]
Example response captured
[
"greet.ts",
"README.md"
] SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.find.files({
...
}) Try it
find.symbols | Name | In | Type | Required |
|---|---|---|---|
| query | query | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
({ name: string kind: | number | "Infinity" | "-Infinity" | "NaN" location: { uri: string range: { start: { line: | number | "Infinity" | "-Infinity" | "NaN" character: | number | "Infinity" | "-Infinity" | "NaN" } end: { line: | number | "Infinity" | "-Infinity" | "NaN" character: | number | "Infinity" | "-Infinity" | "NaN" } } } })[]
Example response from schema
[
{
"name": "",
"kind": 0,
"location": {
"uri": "",
"range": {
"start": null,
"end": null
}
}
}
] Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.find.symbols({
...
}) Try it
file.list | Name | In | Type | Required |
|---|---|---|---|
| path | query | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
({ name: string path: string absolute: string type: "file" | "directory" ignored: boolean })[]
Example response captured
[
{
"name": "greet.ts",
"path": "greet.ts",
"absolute": "/Users/me/demo/greet.ts",
"type": "file",
"ignored": false
},
{
"name": "README.md",
"path": "README.md",
"absolute": "/Users/me/demo/README.md",
"type": "file",
"ignored": false
}
] SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.file.list({
...
}) Try it
file.read | Name | In | Type | Required |
|---|---|---|---|
| path | query | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
{ type: "text" content: string diff?: string | null patch?: | { oldFileName: string newFileName: string oldHeader?: string | null newHeader?: string | null hunks: ({ oldStart: | number | "Infinity" | "-Infinity" | "NaN" oldLines: | number | "Infinity" | "-Infinity" | "NaN" newStart: | number | "Infinity" | "-Infinity" | "NaN" newLines: | number | "Infinity" | "-Infinity" | "NaN" lines: string[] })[] index?: string | null } | null encoding?: "base64" | null mimeType?: string | null }
Example response captured
{
"type": "text",
"content": "export function greet(name: string) {\n // TODO: localise this\n return `Hello, ${name}!`\n}"
} SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.file.read({
...
}) Try it
file.write | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ path: string content: string }
{ success: boolean }
Example response from schema
{
"success": false
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.file.write({
...
}) Try it
file.status | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
({ path: string added: | number | "Infinity" | "-Infinity" | "NaN" removed: | number | "Infinity" | "-Infinity" | "NaN" status: "added" | "deleted" | "modified" })[]
Example response captured
[] SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.file.status({
...
}) Try it
Schemas
The 7 schemas reachable from these endpoints. Each is shown one level
deep; nested types link to their own entry below.
Names ending in _2, _3 and so on are the OpenAPI emitter
disambiguating same-named schemas declared by different HttpApi groups — they are distinct
shapes, not duplicates.
{ path: string added: | number | "Infinity" | "-Infinity" | "NaN" removed: | number | "Infinity" | "-Infinity" | "NaN" status: "added" | "deleted" | "modified" }
{ type: "text" content: string diff?: string | null patch?: | { oldFileName: string newFileName: string oldHeader?: string | null newHeader?: string | null hunks: ({ oldStart: | number | "Infinity" | "-Infinity" | "NaN" oldLines: | number | "Infinity" | "-Infinity" | "NaN" newStart: | number | "Infinity" | "-Infinity" | "NaN" newLines: | number | "Infinity" | "-Infinity" | "NaN" lines: string[] })[] index?: string | null } | null encoding?: "base64" | null mimeType?: string | null }
{ name: string path: string absolute: string type: "file" | "directory" ignored: boolean }
{ path: string content: string }
{ success: boolean }
{ path: { text: string } lines: { text: string } line_number: | number | "Infinity" | "-Infinity" | "NaN" absolute_offset: | number | "Infinity" | "-Infinity" | "NaN" submatches: ({ match: { text: string } start: | number | "Infinity" | "-Infinity" | "NaN" end: | number | "Infinity" | "-Infinity" | "NaN" })[] }
{ name: string kind: | number | "Infinity" | "-Infinity" | "NaN" location: { uri: string range: { start: { line: | number | "Infinity" | "-Infinity" | "NaN" character: | number | "Infinity" | "-Infinity" | "NaN" } end: { line: | number | "Infinity" | "-Infinity" | "NaN" character: | number | "Infinity" | "-Infinity" | "NaN" } } } }