@promptowl/contextnest-cli 0.4.0 → 0.5.1
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.
- package/README.md +12 -12
- package/dist/index.js +25 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,9 +41,9 @@ ctx init --name "My Vault"
|
|
|
41
41
|
- `ctx list` — List documents (filter by `--type`, `--status`, `--tag`)
|
|
42
42
|
- `ctx search <query>` — Full-text search
|
|
43
43
|
|
|
44
|
-
### Context
|
|
45
|
-
- `ctx
|
|
46
|
-
- `ctx
|
|
44
|
+
### Context Queries
|
|
45
|
+
- `ctx query <selector>` — Query context from your vault
|
|
46
|
+
- `ctx query @org/pack` — Query from a cloud-hosted pack
|
|
47
47
|
- `ctx resolve <selector>` — Execute a selector query
|
|
48
48
|
|
|
49
49
|
### Versioning & Integrity
|
|
@@ -63,21 +63,21 @@ ctx init --name "My Vault"
|
|
|
63
63
|
## Selectors
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
ctx
|
|
67
|
-
ctx
|
|
68
|
-
ctx
|
|
69
|
-
ctx
|
|
70
|
-
ctx
|
|
71
|
-
ctx
|
|
72
|
-
ctx
|
|
66
|
+
ctx query "tag:#engineering" # All docs with a tag
|
|
67
|
+
ctx query "type:document" # All docs of a type
|
|
68
|
+
ctx query "path:nodes/api-*" # Glob match
|
|
69
|
+
ctx query "pack:engineering-essentials" # All docs in a pack
|
|
70
|
+
ctx query "status:published" # By status
|
|
71
|
+
ctx query "tag:#api + tag:#v2" # Union
|
|
72
|
+
ctx query "tag:#api & status:published" # Intersection
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
## Cloud Packs
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Query context from cloud-hosted packs without downloading source files:
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
ctx
|
|
80
|
+
ctx query @promptowl/executive-ai-strategy
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
## Links
|
package/dist/index.js
CHANGED
|
@@ -32187,7 +32187,7 @@ var BASE_CONTEXT = `
|
|
|
32187
32187
|
This vault is managed by Context Nest CLI (ctx). The following commands are available:
|
|
32188
32188
|
|
|
32189
32189
|
Commands: init, add, update, delete, publish, validate, list, search, history,
|
|
32190
|
-
resolve,
|
|
32190
|
+
resolve, query, index, verify, reconstruct, pack list, pack show,
|
|
32191
32191
|
checkpoint list, checkpoint rebuild
|
|
32192
32192
|
|
|
32193
32193
|
Vault structure:
|
|
@@ -32941,7 +32941,7 @@ tr:hover td { background: var(--bg-alt); }
|
|
|
32941
32941
|
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Open this project in your AI assistant</strong> — it reads your vault automatically via CONTEXT.md</div></li>
|
|
32942
32942
|
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Try searching:</strong> <code>ctx search "your topic"</code></div></li>
|
|
32943
32943
|
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Add your first document:</strong> <code>ctx add nodes/my-doc --title "My Document"</code></div></li>
|
|
32944
|
-
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Explore a cloud pack:</strong> <code>ctx
|
|
32944
|
+
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Explore a cloud pack:</strong> <code>ctx query @promptowl/starter-pack</code></div></li>
|
|
32945
32945
|
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Share your vault</strong> with a teammate — they just need the folder</div></li>
|
|
32946
32946
|
</ul>
|
|
32947
32947
|
</div>
|
|
@@ -32976,7 +32976,7 @@ tr:hover td { background: var(--bg-alt); }
|
|
|
32976
32976
|
<!-- CTA -->
|
|
32977
32977
|
<div class="cta-bar">
|
|
32978
32978
|
<h3>Ready for more?</h3>
|
|
32979
|
-
<p>Cloud packs give you curated expertise from domain experts. 50 free
|
|
32979
|
+
<p>Cloud packs give you curated expertise from domain experts. 50 free queries/month.</p>
|
|
32980
32980
|
<a class="cta-btn" href="https://promptowl.ai/marketplace" target="_blank">Browse Cloud Packs</a>
|
|
32981
32981
|
</div>
|
|
32982
32982
|
|
|
@@ -33051,9 +33051,24 @@ function buildTreeLines(paths) {
|
|
|
33051
33051
|
|
|
33052
33052
|
// src/index.ts
|
|
33053
33053
|
var program = new Command();
|
|
33054
|
-
program.name("ctx").description("Context Nest CLI \u2014 manage structured, versioned context vaults").version("0.
|
|
33054
|
+
program.name("ctx").description("Context Nest CLI \u2014 manage structured, versioned context vaults").version("0.5.1");
|
|
33055
33055
|
function getVaultRoot() {
|
|
33056
|
-
|
|
33056
|
+
if (process.env.CONTEXTNEST_VAULT_PATH) {
|
|
33057
|
+
return process.env.CONTEXTNEST_VAULT_PATH;
|
|
33058
|
+
}
|
|
33059
|
+
let dir = process.cwd();
|
|
33060
|
+
while (true) {
|
|
33061
|
+
const configPath = pathMod2.join(dir, ".context", "config.yaml");
|
|
33062
|
+
try {
|
|
33063
|
+
fs2.statSync(configPath);
|
|
33064
|
+
return dir;
|
|
33065
|
+
} catch {
|
|
33066
|
+
}
|
|
33067
|
+
const parent = pathMod2.dirname(dir);
|
|
33068
|
+
if (parent === dir) break;
|
|
33069
|
+
dir = parent;
|
|
33070
|
+
}
|
|
33071
|
+
return process.cwd();
|
|
33057
33072
|
}
|
|
33058
33073
|
function getStorage() {
|
|
33059
33074
|
return new NestStorage(getVaultRoot());
|
|
@@ -33457,7 +33472,7 @@ program.command("index").description("Regenerate context.yaml and INDEX.md files
|
|
|
33457
33472
|
console.log(chalk.green(`Generated ${folder}/INDEX.md`));
|
|
33458
33473
|
}
|
|
33459
33474
|
});
|
|
33460
|
-
async function
|
|
33475
|
+
async function queryFromCloud(selector, opts) {
|
|
33461
33476
|
const match = selector.match(/^@([^/]+)\/(.+)$/);
|
|
33462
33477
|
if (!match) {
|
|
33463
33478
|
console.log(chalk.red(`Invalid cloud pack format: ${selector}`));
|
|
@@ -33479,7 +33494,7 @@ async function injectFromCloud(selector, opts) {
|
|
|
33479
33494
|
if (res.status === 429) {
|
|
33480
33495
|
const body = await res.json();
|
|
33481
33496
|
console.log(chalk.red(`
|
|
33482
|
-
${body.message || "
|
|
33497
|
+
${body.message || "Query quota exceeded"}`));
|
|
33483
33498
|
if (body.upgrade_url) {
|
|
33484
33499
|
console.log(chalk.yellow(` Upgrade: ${body.upgrade_url}`));
|
|
33485
33500
|
}
|
|
@@ -33487,7 +33502,7 @@ async function injectFromCloud(selector, opts) {
|
|
|
33487
33502
|
}
|
|
33488
33503
|
if (!res.ok) {
|
|
33489
33504
|
const body = await res.text();
|
|
33490
|
-
console.log(chalk.red(`Cloud
|
|
33505
|
+
console.log(chalk.red(`Cloud query failed (${res.status}): ${body}`));
|
|
33491
33506
|
process.exit(1);
|
|
33492
33507
|
}
|
|
33493
33508
|
const result = await res.json();
|
|
@@ -33514,9 +33529,9 @@ async function loadCloudToken() {
|
|
|
33514
33529
|
return null;
|
|
33515
33530
|
}
|
|
33516
33531
|
}
|
|
33517
|
-
program.command("
|
|
33532
|
+
program.command("query <selector>").description("Query context from your vault or from PromptOwl cloud packs").option("--json", "Output as JSON").action(async (selector, opts) => {
|
|
33518
33533
|
if (selector.startsWith("@")) {
|
|
33519
|
-
await
|
|
33534
|
+
await queryFromCloud(selector, opts);
|
|
33520
33535
|
return;
|
|
33521
33536
|
}
|
|
33522
33537
|
const storage = getStorage();
|