@promptowl/contextnest-cli 0.3.1 → 0.5.0
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 -25
- 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
|
@@ -32180,14 +32180,14 @@ var ContextInjector = class {
|
|
|
32180
32180
|
}
|
|
32181
32181
|
};
|
|
32182
32182
|
|
|
32183
|
-
// src/starters/
|
|
32183
|
+
// src/starters/agent-config-base.ts
|
|
32184
32184
|
var BASE_CONTEXT = `
|
|
32185
32185
|
[CONTEXT NEST VAULT INITIALIZED]
|
|
32186
32186
|
|
|
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:
|
|
@@ -32203,26 +32203,26 @@ Frontmatter fields: title, type (document|snippet|glossary|persona|prompt|source
|
|
|
32203
32203
|
Selectors: tag:#name, type:document, path:nodes/api-*, pack:pack-name, status:published
|
|
32204
32204
|
Combine with + (union) or & (intersection)
|
|
32205
32205
|
`.trim();
|
|
32206
|
-
var
|
|
32207
|
-
[ACTION REQUIRED \u2014 GENERATE
|
|
32206
|
+
var CONTEXT_MD_GENERATION_INSTRUCTIONS = `
|
|
32207
|
+
[ACTION REQUIRED \u2014 GENERATE CONTEXT.md]
|
|
32208
32208
|
|
|
32209
|
-
Generate a
|
|
32209
|
+
Generate a CONTEXT.md file in this vault's root directory:
|
|
32210
32210
|
1. Ask the user about their specific use case, team, and what they want to capture
|
|
32211
|
-
2. Generate a
|
|
32211
|
+
2. Generate a CONTEXT.md that includes:
|
|
32212
32212
|
- The vault structure and ctx commands reference
|
|
32213
32213
|
- Role-specific guidance tailored to their answers
|
|
32214
32214
|
- A "Getting Started" section with their first 3-5 actions
|
|
32215
|
-
- Guidelines for how
|
|
32215
|
+
- Guidelines for how an AI assistant should interact with this vault
|
|
32216
32216
|
3. Write the file using the Write tool
|
|
32217
32217
|
`.trim();
|
|
32218
32218
|
function getPostInitPrompt(starterId, starterDescription) {
|
|
32219
32219
|
const roleHint = `[STARTER: ${starterId}] \u2014 ${starterDescription}
|
|
32220
|
-
Use this role context to guide your questions and the
|
|
32220
|
+
Use this role context to guide your questions and the CONTEXT.md you generate.`;
|
|
32221
32221
|
return {
|
|
32222
32222
|
context: BASE_CONTEXT,
|
|
32223
32223
|
instructions: `${roleHint}
|
|
32224
32224
|
|
|
32225
|
-
${
|
|
32225
|
+
${CONTEXT_MD_GENERATION_INSTRUCTIONS}`
|
|
32226
32226
|
};
|
|
32227
32227
|
}
|
|
32228
32228
|
|
|
@@ -32938,10 +32938,10 @@ tr:hover td { background: var(--bg-alt); }
|
|
|
32938
32938
|
<div class="card">
|
|
32939
32939
|
<h2><span class="icon">🎯</span> What To Do Next</h2>
|
|
32940
32940
|
<ul class="checklist">
|
|
32941
|
-
<li><div class="check-box" onclick="this.classList.toggle('checked')"></div><div><strong>Open this project in
|
|
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>
|
|
@@ -32950,15 +32950,15 @@ tr:hover td { background: var(--bg-alt); }
|
|
|
32950
32950
|
<div class="card">
|
|
32951
32951
|
<h2><span class="icon">🦉</span> Explore PromptOwl</h2>
|
|
32952
32952
|
<div class="surfaces">
|
|
32953
|
-
<a class="surface-card" href="https://promptowl.ai/
|
|
32953
|
+
<a class="surface-card" href="https://promptowl.ai/integrations" target="_blank">
|
|
32954
32954
|
<div class="surface-icon">⌨</div>
|
|
32955
|
-
<h3>
|
|
32956
|
-
<p>
|
|
32955
|
+
<h3>AI Integrations</h3>
|
|
32956
|
+
<p>Works with Claude, Cursor, Copilot, GPT & more</p>
|
|
32957
32957
|
</a>
|
|
32958
|
-
<a class="surface-card" href="https://promptowl.ai/
|
|
32958
|
+
<a class="surface-card" href="https://promptowl.ai/mcp" target="_blank">
|
|
32959
32959
|
<div class="surface-icon">🖥</div>
|
|
32960
|
-
<h3>
|
|
32961
|
-
<p>
|
|
32960
|
+
<h3>MCP Server</h3>
|
|
32961
|
+
<p>15 vault tools for any MCP-compatible AI</p>
|
|
32962
32962
|
</a>
|
|
32963
32963
|
<a class="surface-card" href="https://promptowl.ai/chat" target="_blank">
|
|
32964
32964
|
<div class="surface-icon">💬</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,7 +33051,7 @@ 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.0");
|
|
33055
33055
|
function getVaultRoot() {
|
|
33056
33056
|
return process.env.CONTEXTNEST_VAULT_PATH || process.cwd();
|
|
33057
33057
|
}
|
|
@@ -33180,7 +33180,7 @@ This vault was initialized without a starter recipe. To help the user get starte
|
|
|
33180
33180
|
- team \u2014 General team knowledge base
|
|
33181
33181
|
3. Run: ctx init --starter <recipe> (in the vault directory)
|
|
33182
33182
|
Note: re-running init with --starter will add the starter content to the existing vault.
|
|
33183
|
-
4. After the starter is applied, generate a
|
|
33183
|
+
4. After the starter is applied, generate a CONTEXT.md tailored to the user's needs.`);
|
|
33184
33184
|
console.log(chalk.dim("\u2500".repeat(60)));
|
|
33185
33185
|
console.log(`
|
|
33186
33186
|
${chalk.dim("Context Nest by PromptOwl \u2014 https://promptowl.ai")}
|
|
@@ -33457,7 +33457,7 @@ program.command("index").description("Regenerate context.yaml and INDEX.md files
|
|
|
33457
33457
|
console.log(chalk.green(`Generated ${folder}/INDEX.md`));
|
|
33458
33458
|
}
|
|
33459
33459
|
});
|
|
33460
|
-
async function
|
|
33460
|
+
async function queryFromCloud(selector, opts) {
|
|
33461
33461
|
const match = selector.match(/^@([^/]+)\/(.+)$/);
|
|
33462
33462
|
if (!match) {
|
|
33463
33463
|
console.log(chalk.red(`Invalid cloud pack format: ${selector}`));
|
|
@@ -33479,7 +33479,7 @@ async function injectFromCloud(selector, opts) {
|
|
|
33479
33479
|
if (res.status === 429) {
|
|
33480
33480
|
const body = await res.json();
|
|
33481
33481
|
console.log(chalk.red(`
|
|
33482
|
-
${body.message || "
|
|
33482
|
+
${body.message || "Query quota exceeded"}`));
|
|
33483
33483
|
if (body.upgrade_url) {
|
|
33484
33484
|
console.log(chalk.yellow(` Upgrade: ${body.upgrade_url}`));
|
|
33485
33485
|
}
|
|
@@ -33487,7 +33487,7 @@ async function injectFromCloud(selector, opts) {
|
|
|
33487
33487
|
}
|
|
33488
33488
|
if (!res.ok) {
|
|
33489
33489
|
const body = await res.text();
|
|
33490
|
-
console.log(chalk.red(`Cloud
|
|
33490
|
+
console.log(chalk.red(`Cloud query failed (${res.status}): ${body}`));
|
|
33491
33491
|
process.exit(1);
|
|
33492
33492
|
}
|
|
33493
33493
|
const result = await res.json();
|
|
@@ -33514,9 +33514,9 @@ async function loadCloudToken() {
|
|
|
33514
33514
|
return null;
|
|
33515
33515
|
}
|
|
33516
33516
|
}
|
|
33517
|
-
program.command("
|
|
33517
|
+
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
33518
|
if (selector.startsWith("@")) {
|
|
33519
|
-
await
|
|
33519
|
+
await queryFromCloud(selector, opts);
|
|
33520
33520
|
return;
|
|
33521
33521
|
}
|
|
33522
33522
|
const storage = getStorage();
|