Add file and git operations accessible from Clojure code

This commit is contained in:
2026-05-08 17:13:12 +03:00
parent b239dd959b
commit dbf05f4e96
5 changed files with 83 additions and 6 deletions
+20
View File
@@ -142,6 +142,26 @@ REPL чете по един JSON обект на ред и отговаря с
- `message` — Четимо съобщение
- `meta` — Както при успех
## Файлови Операции (от Clojure код)
| Функция | Пример | Връща |
|---|---|---|
| `file/read` | `(file/read "path")` | Низ със съдържание или map с грешка |
| `file/write` | `(file/write "path" "content")` | `true` или map с грешка |
| `file/append` | `(file/append "path" "more")` | `true` или map с грешка |
| `file/ls` | `(file/ls "dir")` | Вектор с имена на файлове |
| `file/exists?` | `(file/exists? "path")` | `true` / `false` |
## Git Операции (от Clojure код)
| Функция | Пример | Връща |
|---|---|---|
| `git/status` | `(git/status)` | Map с `:branch`, `:modified`, `:untracked`, `:staged`, `:clean` |
| `git/commit` | `(git/commit "msg")` | Map с `:sha`, `:success` |
| `git/push` | `(git/push)` | Map с `:success`, `:output` |
| `git/diff` | `(git/diff)` | Низ с diff |
| `git/log` | `(git/log)` или `(git/log 10)` | Вектор с commit низове |
## Команди в Човешки REPL
В човешки режим (`cljnim repl`):