rudel 0.1.2 → 0.1.4

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 +66 -0
  2. package/dist/cli.js +16 -5
  3. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # rudel
2
+
3
+ CLI for uploading [Claude Code](https://docs.anthropic.com/en/docs/claude-code) session transcripts to [Rudel](https://app.rudel.ai) for analytics.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g rudel
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # 1. Log in via your browser
15
+ rudel login
16
+
17
+ # 2. Enable automatic session uploads
18
+ rudel enable
19
+
20
+ # That's it! Your Claude Code sessions will now be uploaded automatically.
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ### `rudel login`
26
+
27
+ Authenticate with Rudel. Opens your browser to [app.rudel.ai](https://app.rudel.ai) where you sign in, then the CLI receives a token automatically.
28
+
29
+ ### `rudel enable`
30
+
31
+ Registers a [Claude Code hook](https://docs.anthropic.com/en/docs/claude-code/hooks) that automatically uploads your session transcript when a Claude Code session ends. This is the recommended way to use Rudel -- set it and forget it.
32
+
33
+ ### `rudel disable`
34
+
35
+ Removes the auto-upload hook.
36
+
37
+ ### `rudel upload <session>`
38
+
39
+ Manually upload a session transcript. Accepts a session ID or path to a `.jsonl` file.
40
+
41
+ ```bash
42
+ # Upload by session ID
43
+ rudel upload abc123
44
+
45
+ # Upload a specific file
46
+ rudel upload ./path/to/session.jsonl
47
+
48
+ # Preview without uploading
49
+ rudel upload abc123 --dry-run
50
+
51
+ # Auto-classify the session
52
+ rudel upload abc123 --classify
53
+ ```
54
+
55
+ ### `rudel whoami`
56
+
57
+ Show the currently authenticated user.
58
+
59
+ ### `rudel logout`
60
+
61
+ Clear stored credentials.
62
+
63
+ ## Links
64
+
65
+ - **Web App**: [app.rudel.ai](https://app.rudel.ai)
66
+ - **Issues**: [GitHub Issues](https://github.com/KeKs0r/kinshasa/issues)
package/dist/cli.js CHANGED
@@ -1820,11 +1820,18 @@ async function run(app, inputs, context) {
1820
1820
  }
1821
1821
 
1822
1822
  // src/lib/claude-settings.ts
1823
- import { existsSync, readFileSync, writeFileSync } from "fs";
1823
+ import { execSync } from "child_process";
1824
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
1824
1825
  import { join } from "path";
1825
1826
  var HOOK_COMMAND = "rudel hooks claude session-end";
1827
+ function findGitRoot() {
1828
+ return execSync("git rev-parse --show-toplevel", {
1829
+ encoding: "utf-8"
1830
+ }).trim();
1831
+ }
1826
1832
  function getClaudeSettingsPath() {
1827
- return join(process.env.HOME ?? "~", ".claude", "settings.json");
1833
+ const root = findGitRoot();
1834
+ return join(root, ".claude", "settings.json");
1828
1835
  }
1829
1836
  function readClaudeSettings() {
1830
1837
  const path = getClaudeSettingsPath();
@@ -1835,6 +1842,10 @@ function readClaudeSettings() {
1835
1842
  }
1836
1843
  function writeClaudeSettings(settings) {
1837
1844
  const path = getClaudeSettingsPath();
1845
+ const dir = join(path, "..");
1846
+ if (!existsSync(dir)) {
1847
+ mkdirSync(dir, { recursive: true });
1848
+ }
1838
1849
  writeFileSync(path, `${JSON.stringify(settings, null, 2)}
1839
1850
  `);
1840
1851
  }
@@ -1900,7 +1911,7 @@ var disableCommand = buildCommand({
1900
1911
  // src/lib/credentials.ts
1901
1912
  import {
1902
1913
  existsSync as existsSync2,
1903
- mkdirSync,
1914
+ mkdirSync as mkdirSync2,
1904
1915
  readFileSync as readFileSync2,
1905
1916
  rmSync,
1906
1917
  writeFileSync as writeFileSync2
@@ -1915,7 +1926,7 @@ function getCredentialsPath() {
1915
1926
  function saveCredentials(token, apiBaseUrl) {
1916
1927
  const dir = getConfigDir();
1917
1928
  if (!existsSync2(dir)) {
1918
- mkdirSync(dir, { recursive: true, mode: 448 });
1929
+ mkdirSync2(dir, { recursive: true, mode: 448 });
1919
1930
  }
1920
1931
  const data = { token, apiBaseUrl };
1921
1932
  writeFileSync2(getCredentialsPath(), JSON.stringify(data, null, 2), {
@@ -4112,7 +4123,7 @@ var routes = buildRouteMap({
4112
4123
  var app = buildApplication(routes, {
4113
4124
  name: "rudel",
4114
4125
  versionInfo: {
4115
- currentVersion: "0.1.2"
4126
+ currentVersion: "0.1.4"
4116
4127
  },
4117
4128
  scanner: {
4118
4129
  caseStyle: "allow-kebab-for-camel"
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "rudel",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rudel": "./dist/cli.js"
7
7
  },
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "README.md"
10
11
  ],
11
12
  "scripts": {
12
13
  "dev": "bun run src/bin/cli.ts",