Add file and git operations accessible from Clojure code
This commit is contained in:
+20
@@ -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`):
|
||||
|
||||
Reference in New Issue
Block a user