dirsql 0.4.71 → 0.4.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,7 +22,7 @@ const NATIVE_CONFIG_SUFFIXES = [".py", ".js", ".mjs", ".cjs"];
|
|
|
22
22
|
* launcher as a clean error).
|
|
23
23
|
*/
|
|
24
24
|
export async function withResolvedExtensions(argv) {
|
|
25
|
-
if (argv[0] === "init") {
|
|
25
|
+
if (argv[0] === "init" || argv[0] === "context") {
|
|
26
26
|
return argv;
|
|
27
27
|
}
|
|
28
28
|
const configPaths = getCore()
|
package/docs/reference/cli.md
CHANGED
|
@@ -11,6 +11,7 @@ The `dirsql` binary has these modes:
|
|
|
11
11
|
| `dirsql query "<sql>"` | Explicit synonym for the default one-shot query. |
|
|
12
12
|
| `dirsql server` | Start a long-lived HTTP server exposing a SQL view of a directory. See [HTTP API](./http-api.md). |
|
|
13
13
|
| `dirsql init` | Generate a `.dirsql.toml`. |
|
|
14
|
+
| `dirsql context` | Print the usage guide for this version, for an agent to read. |
|
|
14
15
|
| `dirsql` (bare) | Open a [REPL](#the-repl) over the current directory, reading statements until EOF. |
|
|
15
16
|
|
|
16
17
|
Bare `dirsql` does **not** start the server — that is `dirsql server`.
|
|
@@ -441,6 +442,17 @@ All failures exit `1` with a message on stderr:
|
|
|
441
442
|
|
|
442
443
|
On success, `init` exits `0`.
|
|
443
444
|
|
|
445
|
+
## `dirsql context`
|
|
446
|
+
|
|
447
|
+
```sh
|
|
448
|
+
uvx dirsql context
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
Prints a markdown guide for an agent that is about to query files: the
|
|
452
|
+
first line is `dirsql <version>`, then sections on usage, recipes and
|
|
453
|
+
troubleshooting. The guide is compiled into the binary, so it describes the
|
|
454
|
+
version that prints it. It takes no flags and exits `0`.
|
|
455
|
+
|
|
444
456
|
## Plugins
|
|
445
457
|
|
|
446
458
|
A **plugin** is an ordinary Python package that ships a `dirsql.toml` config
|
|
@@ -37,14 +37,16 @@ indexing, not your shell's working directory.
|
|
|
37
37
|
|
|
38
38
|
**A directory name is one level, like `ls`.** Naming a directory lists the
|
|
39
39
|
files directly inside it and no deeper; `*` matches one level and `**` any
|
|
40
|
-
depth, as in the shell.
|
|
40
|
+
depth, as in the shell. A trailing `/` is `*` appended, so `'./*/'` is
|
|
41
|
+
`'./*/*'`: the files directly inside each top-level directory, like `ls */`.
|
|
41
42
|
|
|
42
43
|
| You write | dirsql scans |
|
|
43
44
|
| --- | --- |
|
|
44
45
|
| `'./'` | files directly inside the index root, and no deeper |
|
|
45
46
|
| `'./docs'`, `'./docs/'` | files directly inside `docs/` |
|
|
46
47
|
| `'./*'` | the same as `'./'` |
|
|
47
|
-
| `'./**'` | every file under the index root, recursively |
|
|
48
|
+
| `'./**'`, `'./**/'` | every file under the index root, recursively |
|
|
49
|
+
| `'./*/'` | the same as `'./*/*'`: files directly inside each top-level directory |
|
|
48
50
|
| `'./docs/*.md'` | markdown files directly inside `docs/` |
|
|
49
51
|
| `'./docs/**/*.md'` | markdown files at any depth under `docs/` |
|
|
50
52
|
| `'./notes/today.md'` | exactly that one file — one file is one row |
|
|
@@ -108,7 +110,8 @@ Three other prefixes resolve, with their usual shell meanings:
|
|
|
108
110
|
| `'../notes'` | relative to the index root's parent |
|
|
109
111
|
| `'~/notes/*.md'` | relative to your home directory |
|
|
110
112
|
|
|
111
|
-
A directory named this way is one level too; `'../notes/**'` descends.
|
|
113
|
+
A directory named this way is one level too; `'../notes/**'` descends. The
|
|
114
|
+
trailing-`/` rule holds here as well: `'~/*/'` is `'~/*/*'`.
|
|
112
115
|
`..` is folded out textually, not followed through symlinks, so the directory
|
|
113
116
|
scanned is a function of the string you wrote.
|
|
114
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirsql",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.73",
|
|
4
4
|
"description": "Ephemeral SQL index over a local directory",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/thekevinscott/dirsql",
|
|
@@ -221,10 +221,10 @@
|
|
|
221
221
|
]
|
|
222
222
|
},
|
|
223
223
|
"optionalDependencies": {
|
|
224
|
-
"@dirsql/lib-linux-x64-gnu": "0.4.
|
|
225
|
-
"@dirsql/lib-linux-arm64-gnu": "0.4.
|
|
226
|
-
"@dirsql/lib-darwin-x64": "0.4.
|
|
227
|
-
"@dirsql/lib-darwin-arm64": "0.4.
|
|
228
|
-
"@dirsql/lib-win32-x64-msvc": "0.4.
|
|
224
|
+
"@dirsql/lib-linux-x64-gnu": "0.4.73",
|
|
225
|
+
"@dirsql/lib-linux-arm64-gnu": "0.4.73",
|
|
226
|
+
"@dirsql/lib-darwin-x64": "0.4.73",
|
|
227
|
+
"@dirsql/lib-darwin-arm64": "0.4.73",
|
|
228
|
+
"@dirsql/lib-win32-x64-msvc": "0.4.73"
|
|
229
229
|
}
|
|
230
230
|
}
|