create-snipara 1.2.0 → 1.3.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.
Files changed (3) hide show
  1. package/README.md +134 -148
  2. package/dist/index.js +814 -317
  3. package/package.json +6 -4
package/README.md CHANGED
@@ -1,213 +1,199 @@
1
1
  # create-snipara
2
2
 
3
- One-command setup for **Snipara MCP + RLM-Runtime** - context optimization, semantic memory, and safe code execution for AI agents.
3
+ One-command setup and maintenance CLI for **Snipara MCP + snipara-companion + optional RLM-Runtime**.
4
4
 
5
5
  ```bash
6
6
  npx create-snipara
7
7
  ```
8
8
 
9
+ `create-snipara` is the entry point. It bootstraps and maintains a complete local Snipara setup for one project. It does not replace the runtime packages. Instead, it installs and wires them together:
10
+
11
+ - `snipara-mcp` for hosted MCP access
12
+ - `snipara-companion` for local `rlm-hook` workflows
13
+ - `rlm-runtime` for optional local code execution
14
+ - local config, env files, hook scripts, and a project companion pack
15
+
16
+ ## Install Profiles
17
+
18
+ The CLI now works around explicit install profiles:
19
+
20
+ | Profile | What it installs | Best for |
21
+ | ------------------ | ----------------------------------------- | ----------------------------------------- |
22
+ | `hosted-only` | MCP config only | SaaS-first setups without local workflows |
23
+ | `hosted-companion` | MCP + `snipara-companion` | Recommended default |
24
+ | `full-stack` | MCP + `snipara-companion` + `rlm-runtime` | Hosted context plus local execution |
25
+ | `runtime-only` | `rlm-runtime` only | Local execution without hosted API |
26
+
27
+ Default profile: `hosted-companion`
28
+
9
29
  ## What It Does
10
30
 
11
- - **Installs snipara-mcp** - MCP server for context-optimized documentation queries
12
- - **Installs rlm-runtime** - Safe code execution with Docker isolation
13
- - **Configures .mcp.json** - Ready for Claude Code, Cursor, Claude Desktop
14
- - **Sets up hooks** - Session memory automation (Claude Code)
15
- - **Updates environment files** - Adds API key configuration
31
+ - detects local environment and project state
32
+ - installs `snipara-companion` by default for local workflows
33
+ - installs `snipara-mcp` and optional `rlm-runtime`
34
+ - configures `.mcp.json`
35
+ - updates `.env`, `.env.local`, and `.env.example`
36
+ - generates `.snipara/companion/README.md`
37
+ - generates `.snipara/companion/commands.json`
38
+ - generates `.snipara/companion/doctor.json`
39
+ - optionally installs Claude Code hooks
40
+ - supports `doctor`, `repair`, `upgrade`, and `print-config`
16
41
 
17
- ## Interactive Setup
42
+ ## Quick Start
18
43
 
19
44
  ```bash
20
45
  npx create-snipara
21
46
  ```
22
47
 
23
- You'll be prompted for:
24
-
25
- | Prompt | Description |
26
- |--------|-------------|
27
- | **Project slug** | Auto-detected from git remote or directory name |
28
- | **Project ID** | Optional, for advanced use cases |
29
- | **API key type** | Project key, Team key, Sign up, or Skip |
30
- | **API key** | Your Snipara API key |
31
- | **AI client** | Claude Code, Cursor, Claude Desktop, or other |
32
- | **Packages** | Choose what to install |
33
- | **LLM provider** | OpenAI, Anthropic, or None (for `rlm run`/`rlm agent` CLI) |
34
- | **Run rlm init** | Optional - configure execution environment (sandbox/docker/local) |
48
+ The interactive flow now asks for:
35
49
 
36
- ## API Key Requirements
50
+ - install profile
51
+ - project slug
52
+ - optional project id
53
+ - API key type and key when needed
54
+ - AI client
55
+ - whether hooks should be generated
56
+ - optional runtime provider config when `rlm-runtime` is installed
37
57
 
38
- | Tool | Snipara API Key | LLM API Key (OpenAI/Anthropic) |
39
- |------|-----------------|-------------------------------|
40
- | `execute_python` MCP | Not needed | Not needed (your AI client is the LLM) |
41
- | `rlm_context_query` MCP | **Required** | Not needed |
42
- | `rlm_remember`/`rlm_recall` | **Required** | Not needed |
43
- | `rlm run` / `rlm agent` CLI | Optional (for context) | **Required** |
58
+ ## Main Commands
44
59
 
45
- ### Key Types
60
+ ### Install or initialize
46
61
 
47
- | Type | Description |
48
- |------|-------------|
49
- | **Project API key** | Access to a single project |
50
- | **Team API key** | Access to all projects in your team |
62
+ ```bash
63
+ npx create-snipara
64
+ npx create-snipara init
65
+ ```
51
66
 
52
- ## Command Line Options
67
+ ### Inspect local setup
53
68
 
54
69
  ```bash
55
- # Basic usage
56
- npx create-snipara
70
+ npx create-snipara doctor
71
+ ```
57
72
 
58
- # With project API key
59
- npx create-snipara --api-key rlm_your_project_key
73
+ Writes `.snipara/companion/doctor.json` and validates:
60
74
 
61
- # With team API key (access all team projects)
62
- npx create-snipara --team-key rlm_your_team_key
75
+ - local config files
76
+ - companion CLI presence
77
+ - runtime CLI presence
78
+ - environment files
79
+ - hosted MCP reachability when a live API key is available
63
80
 
64
- # Specify project slug
65
- npx create-snipara --slug my-project
81
+ ### Repair local setup
66
82
 
67
- # Runtime only - no Snipara API key needed
68
- # (for execute_python MCP tool only)
69
- npx create-snipara --runtime-only
83
+ ```bash
84
+ npx create-snipara repair
85
+ ```
70
86
 
71
- # Skip specific installations
72
- npx create-snipara --skip-mcp # Skip snipara-mcp
73
- npx create-snipara --skip-runtime # Skip rlm-runtime
74
- npx create-snipara --skip-hooks # Skip Claude Code hooks
75
- npx create-snipara --skip-test # Skip connection test
87
+ Rebuilds local project wiring:
76
88
 
77
- # Accept all defaults (non-interactive)
78
- npx create-snipara -y --api-key rlm_xxx --slug my-project
89
+ - `.mcp.json`
90
+ - env files
91
+ - companion pack
92
+ - hooks when relevant
79
93
 
80
- # Full example with team key
81
- npx create-snipara --team-key rlm_team_xxx --slug my-project --skip-hooks
82
- ```
94
+ ### Upgrade local pieces
83
95
 
84
- ## What Gets Created
85
-
86
- ### .mcp.json
87
-
88
- ```json
89
- {
90
- "mcpServers": {
91
- "snipara": {
92
- "type": "http",
93
- "url": "https://api.snipara.com/mcp/your-project",
94
- "headers": {
95
- "X-API-Key": "rlm_your_key"
96
- }
97
- },
98
- "rlm-runtime": {
99
- "type": "http",
100
- "url": "http://localhost:8765/mcp",
101
- "headers": {}
102
- }
103
- }
104
- }
96
+ ```bash
97
+ npx create-snipara upgrade
105
98
  ```
106
99
 
107
- ### Claude Code Hooks (if selected)
100
+ Upgrades installed local components and refreshes the companion pack.
108
101
 
109
- - `snipara-startup.sh` - Restores session context
110
- - `snipara-session.sh` - Auto-remembers commits
111
- - `snipara-compact.sh` - Saves context before compaction
102
+ ### Print inferred config
112
103
 
113
- ### Environment Files
104
+ ```bash
105
+ npx create-snipara print-config
106
+ npx create-snipara print-config --json
107
+ ```
114
108
 
115
- Updates `.env.example` and `.env.local` with:
109
+ ## Common Flags
116
110
 
117
111
  ```bash
118
- # Snipara Configuration
119
- SNIPARA_API_KEY=your_api_key
120
- SNIPARA_PROJECT_SLUG=your-project
121
-
122
- # RLM-Runtime LLM Provider (if configured)
123
- OPENAI_API_KEY=sk-...
124
- # or
125
- ANTHROPIC_API_KEY=sk-ant-...
112
+ # Use an explicit install profile
113
+ npx create-snipara --profile hosted-companion
114
+ npx create-snipara --profile full-stack
115
+
116
+ # Runtime-only local execution
117
+ npx create-snipara --runtime-only
118
+
119
+ # Non-interactive setup
120
+ npx create-snipara -y --api-key rlm_xxx --slug my-project
121
+
122
+ # Skip selected layers
123
+ npx create-snipara --skip-companion
124
+ npx create-snipara --skip-mcp
125
+ npx create-snipara --skip-runtime
126
+ npx create-snipara --skip-hooks
127
+
128
+ # Force extra layers during maintenance
129
+ npx create-snipara repair --with-hooks
130
+ npx create-snipara upgrade --with-runtime
126
131
  ```
127
132
 
128
- ## After Installation
133
+ ## Packaging Model
129
134
 
130
- ### For Claude Code / Cursor
135
+ The intended split is:
131
136
 
132
- 1. Restart your AI client
133
- 2. MCP tools are automatically available
137
+ - `create-snipara`: install, inspect, repair, and upgrade the local project setup
138
+ - `snipara-companion`: ongoing local runtime workflows through `rlm-hook`
139
+ - `snipara-mcp`: hosted MCP bridge
140
+ - `rlm-runtime`: optional local execution engine
134
141
 
135
- ### For Claude Desktop
142
+ This keeps setup and runtime separated while still giving the user one obvious command to start from.
136
143
 
137
- 1. Restart Claude Desktop
138
- 2. Config is at `~/Library/Application Support/Claude/claude_desktop_config.json`
144
+ ## Generated Local Pack
139
145
 
140
- ### RLM-Runtime Usage
146
+ After setup, the project gets a local pack at `.snipara/companion/`:
141
147
 
142
- **MCP Tools (no LLM API key needed):**
148
+ - `README.md`: local usage guidance
149
+ - `commands.json`: starter commands for the current project
150
+ - `doctor.json`: most recent validation report
143
151
 
144
- Your AI client (Claude, GPT, etc.) provides the LLM - no additional API key required.
152
+ This pack is meant to be the local source of truth for machine-level setup.
145
153
 
146
- ```
147
- • execute_python - Run Python in sandbox
148
- • get_repl_context - Get session variables
149
- • set_repl_context - Set session variables
150
- • clear_repl_context - Clear session
151
- ```
154
+ ## API Key Requirements
152
155
 
153
- **Execution Environments:**
156
+ | Tooling | Snipara API key | LLM API key |
157
+ | ------------------------------------ | -------------------- | ----------- |
158
+ | Hosted MCP queries | Required | Not needed |
159
+ | Memory / planning tools | Required | Not needed |
160
+ | `snipara-companion` hosted workflows | Required | Not needed |
161
+ | `rlm-runtime` `execute_python` MCP | Not needed | Not needed |
162
+ | `rlm run` / `rlm agent` CLI | Optional for context | Required |
154
163
 
155
- | Environment | Description | Use Case |
156
- |-------------|-------------|----------|
157
- | **sandbox** | RestrictedPython, safe stdlib only | Default, most secure |
158
- | **docker** | Full Python in isolated container | Recommended for full features |
159
- | **local** | Full access, no isolation | Development only |
164
+ ## Example Flows
160
165
 
161
- During setup, you can run `rlm init` to configure the default environment.
162
- Or configure later:
166
+ ### Default recommended setup
163
167
 
164
168
  ```bash
165
- rlm init # Interactive configuration
169
+ npx create-snipara --profile hosted-companion
166
170
  ```
167
171
 
168
- **CLI Commands (requires LLM API key):**
169
-
170
- For `rlm run` and `rlm agent`, you need an LLM provider API key:
172
+ ### Full local stack
171
173
 
172
174
  ```bash
173
- # Set your LLM provider
174
- export OPENAI_API_KEY=sk-...
175
- # or
176
- export ANTHROPIC_API_KEY=sk-ant-...
177
-
178
- # Run commands
179
- rlm init # Initialize configuration
180
- rlm run --env docker # Run with Docker isolation
181
- rlm agent "task" # Autonomous agent mode
182
- rlm visualize # Launch trajectory dashboard
175
+ npx create-snipara --profile full-stack
183
176
  ```
184
177
 
185
- ## Available MCP Tools
186
-
187
- After setup, you have access to 43+ MCP tools:
178
+ ### Repair after a broken workstation or new shell
188
179
 
189
- | Category | Tools |
190
- |----------|-------|
191
- | **Context** | `rlm_context_query`, `rlm_ask`, `rlm_search`, `rlm_sections` |
192
- | **Planning** | `rlm_plan`, `rlm_decompose`, `rlm_multi_query` |
193
- | **Memory** | `rlm_remember`, `rlm_recall`, `rlm_memories`, `rlm_forget` |
194
- | **Execution** | `execute_python`, `get_repl_context` (via RLM-Runtime) |
195
- | **Swarms** | `rlm_swarm_create`, `rlm_claim`, `rlm_task_create` |
180
+ ```bash
181
+ npx create-snipara repair
182
+ npx create-snipara doctor
183
+ ```
196
184
 
197
- ## Requirements
185
+ ### Check what the CLI inferred from this project
198
186
 
199
- - Node.js 18+
200
- - Python 3.10+ (for snipara-mcp and rlm-runtime)
201
- - Docker (optional, for RLM-Runtime isolation)
187
+ ```bash
188
+ npx create-snipara print-config --json
189
+ ```
202
190
 
203
- ## Links
191
+ ## Local Tarball Testing
204
192
 
205
- - **Website**: https://snipara.com
206
- - **Documentation**: https://snipara.com/docs
207
- - **Dashboard**: https://snipara.com/dashboard
208
- - **npm**: https://www.npmjs.com/package/create-snipara
209
- - **Support**: hello@starbox-group.com
193
+ When testing a locally packed tarball, use `npm exec --package` instead of `npx`, for example:
210
194
 
211
- ## License
195
+ ```bash
196
+ npm exec --package ./create-snipara-1.3.0.tgz create-snipara -- --help
197
+ ```
212
198
 
213
- MIT
199
+ This avoids `npx` resolution issues with unpublished tarballs.