kdeps-commands-search
v2.0.0kdeps command: search
set commands / shelf agent
PurposeSearch the indexed directory and feed the results to the model
LLM context: none - kdeps uses it without sending it to the model
Where it runs
Part of the commands set, used in workflow and agent mode. Slash commands: the help and completion of the built-in ones, and declared commands that run other commands and prompts.
- you type /name in kdeps
- the command runs: built in, or its declared stepscommands/search
- prompts go to the model; the output is shown
Loaded by: kdeps (agent loop), /update, kdeps run
In the code: kdeps (agent loop)agent.(*REPL).Runagent.declaredCommand
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Also installs what it requires, when missing or older: tools/search_local, tools/session_ops.
Pin a version with kdeps install commands/search@<version>.
Contents
- order
- 320
/search <term>Search the indexed directory and feed the results to the model/search indexBuild or update the search index of every folder the project searches/search foldersList the folders the project searches (its own and the ones added)/search add <folder>Search a folder outside the project with it (docs, a shared library); indexes it now/search remove <folder>Stop searching a folder with the project/search index- 1
Calls a kdeps API tool
session_opsoperation: search_indexprints
{{.output}}
/search folders- 1
Calls a kdeps API tool
session_opsoperation: search_foldersprints
Project {{.project}} searches: {{range .places}} - {{.path}} (project){{if not .indexed}} - not indexed yet: `/search index`{{end}}{{end}}{{range .folders}} - {{.path}}{{if not .indexed}} - not indexed yet: `/search index`{{end}}{{end}}{{if not .folders}} - (no other folders: `/search add <folder>`, or `kdeps --index <folder>`){{end}}
/search add- 1
Calls a kdeps API tool
session_opsoperation: search_folder action: add folder: $@prints
{{.output}}
/search remove- 1
Calls a kdeps API tool
session_opsoperation: search_folder action: remove folder: $@prints
{{.output}}
/search *- 1
Calls a kdeps API tool
search_localquery: $@ index: true limit: 20prints
{{if not .results}}search: no results for this query{{else}}**Search results ({{.count}} files):** {{range .results}} - {{.path}} [match={{.matchCount}} score={{printf "%.2f" .score}}]{{if .snippet}} `{{trunc 160 .snippet}}`{{end}}{{end}}{{end}}
requires:
tools/session_ops: ""
tools/search_local: ""
version: 2.0.0
# kdeps update installs these with this command: what its run steps use
requires:
tools/session_ops: ""
tools/search_local: ""
name: search
order: 320
usage:
- args: "<term>"
help: Search the indexed directory and feed the results to the model
- args: index
help: Build or update the search index of every folder the project searches
- args: folders
help: List the folders the project searches (its own and the ones added)
- args: "add <folder>"
help: Search a folder outside the project with it (docs, a shared library); indexes it now
- args: "remove <folder>"
help: Stop searching a folder with the project
subcommands:
index:
run:
- tool: session_ops
args: {operation: search_index}
print: "{{.output}}"
folders:
run:
- tool: session_ops
args: {operation: search_folders}
print: |-
Project {{.project}} searches:
{{range .places}}
- {{.path}} (project){{if not .indexed}} - not indexed yet: `/search index`{{end}}{{end}}{{range .folders}}
- {{.path}}{{if not .indexed}} - not indexed yet: `/search index`{{end}}{{end}}{{if not .folders}}
- (no other folders: `/search add <folder>`, or `kdeps --index <folder>`){{end}}
add:
run:
- tool: session_ops
args: {operation: search_folder, action: add, folder: "$@"}
print: "{{.output}}"
remove:
run:
- tool: session_ops
args: {operation: search_folder, action: remove, folder: "$@"}
print: "{{.output}}"
"*": # /search <term>: the search_local tool over every folder the project searches
run:
- tool: search_local
args: {query: "$@", index: true, limit: 20}
print: |-
{{if not .results}}search: no results for this query{{else}}**Search results ({{.count}} files):**
{{range .results}}
- {{.path}} [match={{.matchCount}} score={{printf "%.2f" .score}}]{{if .snippet}}
`{{trunc 160 .snippet}}`{{end}}{{end}}{{end}}
Versions
| Version | Published | Status |
|---|---|---|
| 2.0.0 | 10/24/2026 | active |
| 1.1.1 | 10/21/2026 | active |
| 1.1.0 | 10/16/2026 | active |
| 1.0.0 | 10/12/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 2.0.0
- Published
- 10/12/2026