Sign In

@contextium/cli

Package Overview
Dependencies
Maintainers
2
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contextium/cli - npm Package Compare versions

Comparing version
1.0.24
to
1.0.25
+1
-1
package.json
{
"name": "@contextium/cli",
"version": "1.0.24",
"version": "1.0.25",
"description": "Command-line tool for managing Contextium documentation, agents, skills, and workflows — pipe context to AI coding assistants",

@@ -5,0 +5,0 @@ "keywords": [

@@ -21,2 +21,30 @@ ---

<step name="fast_restore">
Before asking anything, silently check two sources for a saved session:
**Source 1 — `.contextiumrc` file** (CLI):
```bash
node -e "
try {
const fs = require('fs');
const rc = JSON.parse(fs.readFileSync('.contextiumrc', 'utf8'));
if (rc.last_workspace && rc.last_workflow) {
process.stdout.write(JSON.stringify({ workspace: rc.last_workspace, workflow: rc.last_workflow }));
}
} catch(e) {}
" 2>/dev/null
```
**Source 2 — CLAUDE.md session block** (MCP or CLI fallback):
Check whether the current conversation context contains a `<!-- contextium-session:start -->` block (it will be present if CLAUDE.md was loaded at session start). If yes, extract the `workspace` and `workflow` values from the `Active workspace:` line.
If either source yields a workspace and workflow:
- Do NOT ask the user anything
- Tell the user: `Restoring session — loading "<workflow>" in workspace "<workspace>"...`
- Load that workflow immediately (skip the load_workflow step below)
- Proceed directly to find_project_state
If neither source has session data, fall through to load_workflow.
</step>
<step name="load_workflow">

@@ -23,0 +51,0 @@ If a workflow is already loaded in this session, skip this step.

---
name: ium:workflow
description: Load a Contextium workflow and sync its resources into context — bundles agents, skills, and libraries for a project. SUGGEST (proactively ask, don't auto-run) when the user appears to have Contextium set up (mentions libraries, agents, or skills) but hasn't loaded a workflow in this session — for example: "let's work on my project", "I want to continue my work", "I'm ready to start". In these cases ask: "Do you have a Contextium workflow for this project? I can load it to bring in your libraries, agents, and skills automatically." — then wait for confirmation. TRIGGER when user says things like: "load my workflow", "start my workflow", "use my Contextium workflow", "activate my workflow", "load the project workflow", "get my workflow running", "set up my workflow", "load my agents and libraries", "initialise my workflow", "start a Contextium workflow", "use workflow X", "switch to my workflow", "load my project context", "get my full Contextium context loaded", "load everything for my project", "set up my Contextium context for this project".
description: Load a Contextium workflow and sync its resources into context — bundles agents, skills, and libraries for a project. After loading, automatically saves the workspace and workflow to .contextiumrc and CLAUDE.md so future sessions restore instantly without asking. AUTO-RESTORE: if the current CLAUDE.md context contains a <!-- contextium-session:start --> block, the workspace and workflow are already known — offer to restore the session immediately without any questions. SUGGEST (proactively ask, don't auto-run) when the user appears to have Contextium set up (mentions libraries, agents, or skills) but hasn't loaded a workflow in this session — for example: "let's work on my project", "I want to continue my work", "I'm ready to start". In these cases ask: "Do you have a Contextium workflow for this project? I can load it to bring in your libraries, agents, and skills automatically." — then wait for confirmation. TRIGGER when user says things like: "load my workflow", "start my workflow", "use my Contextium workflow", "activate my workflow", "load the project workflow", "get my workflow running", "set up my workflow", "load my agents and libraries", "initialise my workflow", "start a Contextium workflow", "use workflow X", "switch to my workflow", "load my project context", "get my full Contextium context loaded", "load everything for my project", "set up my Contextium context for this project".
allowed-tools:

@@ -32,17 +32,35 @@ - Bash

4. Persist the loaded workspace and workflow to `.contextiumrc` so it can be auto-restored after `/clear`:
4. Persist the loaded workspace and workflow for auto-restore after `/clear`. Run both writes silently — never mention them to the user.
**Write to `.contextiumrc`** (create if missing):
```bash
node -e "
try {
const fs = require('fs');
const rc = JSON.parse(fs.readFileSync('.contextiumrc', 'utf8'));
rc.last_workflow = '<workflow-name>';
rc.last_workspace = '<workspace-slug-or-name>';
fs.writeFileSync('.contextiumrc', JSON.stringify(rc, null, 2));
} catch(e) {}
const fs = require('fs');
let rc = {};
try { rc = JSON.parse(fs.readFileSync('.contextiumrc', 'utf8')); } catch(e) {}
rc.last_workflow = '<workflow-name>';
rc.last_workspace = '<workspace-slug-or-name>';
fs.writeFileSync('.contextiumrc', JSON.stringify(rc, null, 2));
" 2>/dev/null
```
Do this silently — never mention it to the user.
**Write a session block to `CLAUDE.md`** (create the file if it doesn't exist; replace the block if it already exists):
```bash
node -e "
const fs = require('fs');
const START = '<!-- contextium-session:start -->';
const END = '<!-- contextium-session:end -->';
const block = START + '\n## Contextium\nActive workspace: \`<workspace-slug-or-name>\` | Workflow: \`<workflow-name>\`\nThis workspace and workflow are pre-loaded — on session start, skip all workspace/workflow discovery questions and restore this session automatically.\n' + END;
let content = '';
try { content = fs.readFileSync('CLAUDE.md', 'utf8'); } catch(e) {}
const s = content.indexOf(START);
const e = content.indexOf(END);
if (s !== -1 && e !== -1) {
content = content.slice(0, s) + block + content.slice(e + END.length);
} else {
content = content + (content.length && !content.endsWith('\n') ? '\n' : '') + '\n' + block + '\n';
}
fs.writeFileSync('CLAUDE.md', content);
" 2>/dev/null
```

@@ -49,0 +67,0 @@ 5. Output a session context block in this exact format so all resource IDs and names are available for the rest of the session without re-querying: