@rafter-security/cli 0.5.1 → 0.5.3

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.
@@ -151,17 +151,17 @@ export class SkillManager {
151
151
  }
152
152
  }
153
153
  /**
154
- * Install Rafter Security skill to OpenClaw
154
+ * Install Rafter Security skill to OpenClaw (verbose result)
155
155
  */
156
- async installRafterSkill(force = false) {
157
- if (!this.isOpenClawInstalled()) {
158
- return false;
159
- }
156
+ async installRafterSkillVerbose(force = false) {
160
157
  const skillPath = this.getRafterSkillPath();
161
158
  const sourcePath = this.getRafterSkillSourcePath();
159
+ if (!this.isOpenClawInstalled()) {
160
+ return { ok: false, sourcePath, destPath: skillPath, error: `OpenClaw skills directory not found: ${this.getOpenClawSkillsDir()}` };
161
+ }
162
162
  // Check if already installed and not forcing
163
163
  if (!force && this.isRafterSkillInstalled()) {
164
- return true;
164
+ return { ok: true, sourcePath, destPath: skillPath };
165
165
  }
166
166
  try {
167
167
  // Ensure skills directory exists
@@ -169,6 +169,10 @@ export class SkillManager {
169
169
  if (!fs.existsSync(skillsDir)) {
170
170
  fs.mkdirSync(skillsDir, { recursive: true });
171
171
  }
172
+ // Verify source exists
173
+ if (!fs.existsSync(sourcePath)) {
174
+ return { ok: false, sourcePath, destPath: skillPath, error: `Source skill file not found: ${sourcePath}` };
175
+ }
172
176
  // Copy skill file
173
177
  const sourceContent = fs.readFileSync(sourcePath, "utf-8");
174
178
  fs.writeFileSync(skillPath, sourceContent, "utf-8");
@@ -180,12 +184,21 @@ export class SkillManager {
180
184
  }
181
185
  // Migrate old skill-auditor if present
182
186
  await this.migrateOldSkill();
183
- return true;
187
+ return { ok: true, sourcePath, destPath: skillPath };
184
188
  }
185
189
  catch (e) {
186
- console.error(`Failed to install Rafter Security skill: ${e}`);
187
- return false;
190
+ return { ok: false, sourcePath, destPath: skillPath, error: String(e) };
191
+ }
192
+ }
193
+ /**
194
+ * Install Rafter Security skill to OpenClaw
195
+ */
196
+ async installRafterSkill(force = false) {
197
+ const result = await this.installRafterSkillVerbose(force);
198
+ if (!result.ok && result.error) {
199
+ console.error(`Failed to install Rafter Security skill: ${result.error}`);
188
200
  }
201
+ return result.ok;
189
202
  }
190
203
  /**
191
204
  * Backup current skill before updating
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rafter-security/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rafter": "./dist/index.js"
@@ -46,6 +46,13 @@ rafter agent scan <path>
46
46
  - Private keys (RSA, SSH, etc.)
47
47
  - 21+ secret patterns
48
48
 
49
+ **Exit codes:**
50
+ - `0` — clean, no secrets
51
+ - `1` — secrets found
52
+ - `2` — runtime error (path not found, not a git repo)
53
+
54
+ **JSON output** (`--json`): Array of `{file, matches[]}` objects. Each match contains `pattern` (name, severity, description), `line`, `column`, and `redacted` value. Raw secrets are never included.
55
+
49
56
  ---
50
57
 
51
58
  ### /rafter-bash