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 @@ On error:
- `message` — Human-readable message
- `meta` — Same as success
## File Operations (from Clojure code)
| Function | Example | Returns |
|---|---|---|
| `file/read` | `(file/read "path")` | String content or error map |
| `file/write` | `(file/write "path" "content")` | `true` or error map |
| `file/append` | `(file/append "path" "more")` | `true` or error map |
| `file/ls` | `(file/ls "dir")` | Vector of filenames |
| `file/exists?` | `(file/exists? "path")` | `true` / `false` |
## Git Operations (from Clojure code)
| Function | Example | Returns |
|---|---|---|
| `git/status` | `(git/status)` | Map with `:branch`, `:modified`, `:untracked`, `:staged`, `:clean` |
| `git/commit` | `(git/commit "msg")` | Map with `:sha`, `:success` |
| `git/push` | `(git/push)` | Map with `:success`, `:output` |
| `git/diff` | `(git/diff)` | Diff string |
| `git/log` | `(git/log)` or `(git/log 10)` | Vector of commit strings |
## Human REPL Commands
In human mode (`cljnim repl`):