Skip to content

Commit

Permalink
docs(quick-start): update commands and add file path in output
Browse files Browse the repository at this point in the history
- Added new commands: `/file-func`, `/structure`, `/dir`, `/database`, `/localSearch`, `/related`, `/open`, `/ripgrepSearch`.
- Updated `FileInsCommand.kt` to include file path in the output.
  • Loading branch information
phodal committed Jan 27, 2025
1 parent 811e9c3 commit e0c0c84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/devins/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ScreenShot

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

## Basic Commands
## Basic Commands (BuiltinCommand.kt)

- `/file`: read file content, format: `/file:<file-path>`, example: `/file:src/main/java/com/example/Controller.java`.
- `/write`: write file content, format: `file#L1-L12`, example: `src/main/java/com/example/Controller.java#L1-L12`
Expand All @@ -35,6 +35,14 @@ ScreenShot
- `/shell`: run shell command or shell script, like `ls`, `pwd`, etc.
- `/browse`: browse web page, like `https://ide.unitmesh.cc`
- `/refactor`: refactor code, like `rename`, `delete`, `move` etc. (since @1.8.6) (Java only)
- `/file-func`: read the name of a file, support for: regex, example: `/file-func:regex(".*\.txt")`
- `/structure`: get the structure of a file with AST/PSI, example: `/structure:cc.unitmesh.devti.language.psi`
- `/dir`: list files and directories in a tree-like structure, example: `/dir:src`
- `/database`: read the content of a database, example: `/database:query\n```sql\nSELECT * FROM table\n````
- `/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````
- `/related`: get related code by AST (abstract syntax tree) for the current file, example: `/related:cc.unitmesh.devti.language.psi`
- `/open`: open a file in the editor, example: `/open:.github/dependabot.yml`
- `/ripgrepSearch`: search text in the project with ripgrep, example: `/ripgrepSearch:.*AutoDev.*`

### File Command

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class FileInsCommand(private val myProject: Project, private val prop: String) :
content
}

// add file path
output.append("// File: $prop\n")
output.append("\n```$lang\n")
output.append(fileContent)
output.append("\n```\n")
Expand Down

0 comments on commit e0c0c84

Please sign in to comment.