Skip to content

Commit e0c0c84

Browse files
committed
docs(quick-start): update commands and add file path in output
- Added new commands: `/file-func`, `/structure`, `/dir`, `/database`, `/localSearch`, `/related`, `/open`, `/ripgrepSearch`. - Updated `FileInsCommand.kt` to include file path in the output.
1 parent 811e9c3 commit e0c0c84

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/devins/quick-start.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ScreenShot
2222

2323
![AutoDev DevIns](https://unitmesh.cc/auto-dev/autodev-devins.png)
2424

25-
## Basic Commands
25+
## Basic Commands (BuiltinCommand.kt)
2626

2727
- `/file`: read file content, format: `/file:<file-path>`, example: `/file:src/main/java/com/example/Controller.java`.
2828
- `/write`: write file content, format: `file#L1-L12`, example: `src/main/java/com/example/Controller.java#L1-L12`
@@ -35,6 +35,14 @@ ScreenShot
3535
- `/shell`: run shell command or shell script, like `ls`, `pwd`, etc.
3636
- `/browse`: browse web page, like `https://ide.unitmesh.cc`
3737
- `/refactor`: refactor code, like `rename`, `delete`, `move` etc. (since @1.8.6) (Java only)
38+
- `/file-func`: read the name of a file, support for: regex, example: `/file-func:regex(".*\.txt")`
39+
- `/structure`: get the structure of a file with AST/PSI, example: `/structure:cc.unitmesh.devti.language.psi`
40+
- `/dir`: list files and directories in a tree-like structure, example: `/dir:src`
41+
- `/database`: read the content of a database, example: `/database:query\n```sql\nSELECT * FROM table\n````
42+
- `/localSearch`: search text in the scope (current only support project) will return 5 line before and after, example: `/localSearch:project\n```\nselect * from blog\n````
43+
- `/related`: get related code by AST (abstract syntax tree) for the current file, example: `/related:cc.unitmesh.devti.language.psi`
44+
- `/open`: open a file in the editor, example: `/open:.github/dependabot.yml`
45+
- `/ripgrepSearch`: search text in the project with ripgrep, example: `/ripgrepSearch:.*AutoDev.*`
3846

3947
### File Command
4048

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/FileInsCommand.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class FileInsCommand(private val myProject: Project, private val prop: String) :
6464
content
6565
}
6666

67+
// add file path
68+
output.append("// File: $prop\n")
6769
output.append("\n```$lang\n")
6870
output.append(fileContent)
6971
output.append("\n```\n")

0 commit comments

Comments
 (0)