@contextium/cli
Advanced tools
+1
-1
| { | ||
| "name": "@contextium/cli", | ||
| "version": "1.0.16", | ||
| "version": "1.0.17", | ||
| "description": "Command-line tool for managing Contextium documentation, agents, skills, and workflows — pipe context to AI coding assistants", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -10,2 +10,24 @@ --- | ||
| ## Session Auto-Restore | ||
| At the start of any new session where no `--- WORKFLOW SESSION CONTEXT ---` block exists in the conversation yet, automatically restore the last used workspace and workflow: | ||
| 1. Silently check `.contextiumrc`: | ||
| ```bash | ||
| cat .contextiumrc 2>/dev/null | ||
| ``` | ||
| 2. If `last_workflow` and `last_workspace` are present, load the workflow immediately without asking: | ||
| **CLI:** `contextium workflow "<last_workflow>" -w <last_workspace> --sync 2>/dev/null` | ||
| **MCP:** call mcp__contextium__load_workflow with the workflow name | ||
| 3. Output the session context block as normal. Do not announce that you're auto-restoring — just do it transparently and continue with whatever the user asked. | ||
| 4. If `last_workflow` is not set, or loading fails silently, proceed as normal without mentioning it. | ||
| This runs once per session — never repeat it once the session context block has been output. | ||
| --- | ||
| ## Scope Rules | ||
@@ -12,0 +34,0 @@ |
@@ -32,5 +32,21 @@ --- | ||
| 4. 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: | ||
| 4. Persist the loaded workspace and workflow to `.contextiumrc` so it can be auto-restored after `/clear`: | ||
| ```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) {} | ||
| " 2>/dev/null | ||
| ``` | ||
| Do this silently — never mention it to the user. | ||
| 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: | ||
| ``` | ||
| --- WORKFLOW SESSION CONTEXT --- | ||
@@ -37,0 +53,0 @@ Workflow: <name> |
+11
-10
@@ -16,12 +16,13 @@ --- | ||
| <step name="show_current"> | ||
| Show the current workspace and list available workspaces: | ||
| Silently fetch the current workspace and available workspaces: | ||
| ```bash | ||
| # Show current workspace from .contextiumrc | ||
| cat .contextiumrc 2>/dev/null | grep -E "workspace" | head -5 || echo "No .contextiumrc found" | ||
| # List all available workspaces | ||
| contextium workspaces | ||
| cat .contextiumrc 2>/dev/null | ||
| ``` | ||
| **CLI:** `contextium workspaces 2>/dev/null` | ||
| **MCP:** call mcp__contextium__list_workspaces | ||
| Parse the results internally — extract names and slugs only. Never show IDs, UUIDs, or raw command output to the user. | ||
| Display clearly: | ||
@@ -32,8 +33,8 @@ ``` | ||
| Available workspaces: | ||
| 1. workspace-a | ||
| 2. workspace-b | ||
| 3. workspace-c | ||
| 1. Workspace A | ||
| 2. Workspace B | ||
| 3. Workspace C | ||
| ``` | ||
| Ask the user which workspace to switch to using AskUserQuestion with the workspace names as options. If the user already specified one in their message, skip this and use it directly. | ||
| Ask the user which workspace to switch to using AskUserQuestion with workspace **names only** as options — no IDs, no slugs. If the user already specified one in their message, skip this and use it directly. | ||
| </step> | ||
@@ -40,0 +41,0 @@ |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
542923
0.27%