codeslop 0.1.1 → 0.1.2
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.
- package/bin/wasted.js +25 -8
- package/package.json +1 -1
package/bin/wasted.js
CHANGED
|
@@ -65,24 +65,41 @@ async function init() {
|
|
|
65
65
|
console.log(` stream: ${config.stream} country: ${config.country || 'not set'}\n`);
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
console.log(`\n ${R}${B}codeslop${X} ${D}— tracking every dollar your AI agent lights on fire${X}\n`);
|
|
70
|
+
|
|
71
|
+
let nickname = args[1];
|
|
72
|
+
if (!nickname) {
|
|
73
|
+
const rl = await import('readline');
|
|
74
|
+
const iface = rl.createInterface({ input: process.stdin, output: process.stdout });
|
|
75
|
+
const ask = q => new Promise(r => iface.question(q, a => { r(a.trim()); }));
|
|
76
|
+
nickname = await ask(` ${B}What should we call you?${X} `) || process.env.USER || 'anon';
|
|
77
|
+
iface.close();
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
const user_id = randomUUID().slice(0, 12);
|
|
69
|
-
const nickname = args[1] || process.env.USER || 'anon';
|
|
70
81
|
config.user_id = user_id;
|
|
71
82
|
config.nickname = nickname;
|
|
72
83
|
saveConfig(config);
|
|
84
|
+
|
|
85
|
+
console.log(`\n ${G}${B}✓ Welcome, ${nickname}!${X} ${D}(${user_id})${X}\n`);
|
|
86
|
+
|
|
73
87
|
try {
|
|
74
88
|
await fetch(config.api_url+'/api/users',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({user_id,nickname})});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
${
|
|
89
|
+
console.log(` ${G}✓${X} registered with codeslop.org`);
|
|
90
|
+
} catch {
|
|
91
|
+
console.log(` ${D}(offline — will sync later)${X}`);
|
|
92
|
+
}
|
|
78
93
|
|
|
79
|
-
|
|
94
|
+
console.log(`
|
|
95
|
+
${D}stream mode:${X} ${Y}daily${X} ${D}(only aggregated summaries leave your machine)${X}
|
|
80
96
|
${D}local db:${X} ~/.wasted/wasted.db
|
|
81
97
|
${D}config:${X} ~/.wasted/config.json
|
|
82
98
|
|
|
83
|
-
${
|
|
84
|
-
${G}codeslop
|
|
85
|
-
${G}codeslop
|
|
99
|
+
${B}next steps:${X}
|
|
100
|
+
${G}codeslop scan${X} → detect your AI clients
|
|
101
|
+
${G}codeslop log${X} → record waste manually
|
|
102
|
+
${D}or type ${G}/slop${D} in Claude Code to auto-detect waste${X}
|
|
86
103
|
`);
|
|
87
104
|
}
|
|
88
105
|
|
package/package.json
CHANGED