linkedin-repo-storyteller-cli 0.1.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.
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/cli.js +95 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vorpalv2
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# LinkedIn Repo Storyteller CLI
|
|
2
|
+
|
|
3
|
+
A small terminal client for the LinkedIn Repo Storyteller Eve agent. It runs on your computer, collects a public GitHub repository URL, and sends it to the agent hosted on Vercel.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 24 or later
|
|
8
|
+
- Internet access
|
|
9
|
+
|
|
10
|
+
## Run without installing
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx linkedin-repo-storyteller-cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install it globally:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install --global linkedin-repo-storyteller-cli
|
|
20
|
+
linkedin-repo-storyteller-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The CLI connects to `https://linkedin-agent-ivory.vercel.app` by default. Set `LINKEDIN_AGENT_URL` to use another Eve deployment:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
LINKEDIN_AGENT_URL=https://your-agent.vercel.app npx linkedin-repo-storyteller-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The URL must point to an Eve deployment that permits this client to create sessions. The CLI currently sends no authentication credentials.
|
package/cli.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createInterface } from "node:readline/promises";
|
|
4
|
+
import { stdin, stdout } from "node:process";
|
|
5
|
+
import { Client } from "eve/client";
|
|
6
|
+
|
|
7
|
+
const defaultAgentUrl = "https://linkedin-agent-ivory.vercel.app";
|
|
8
|
+
const agentUrl = process.env.LINKEDIN_AGENT_URL ?? defaultAgentUrl;
|
|
9
|
+
|
|
10
|
+
function printWelcome() {
|
|
11
|
+
console.log(`\n\x1b[36m╭──────────────────────────────────────────────────────╮[0m`);
|
|
12
|
+
console.log(`\x1b[36m│\x1b[0m \x1b[1mLINKEDIN REPO STORYTELLER\x1b[0m \x1b[36m│\x1b[0m`);
|
|
13
|
+
console.log(`\x1b[36m│\x1b[0m Turn the engineering behind a repo into a post. \x1b[36m│\x1b[0m`);
|
|
14
|
+
console.log(`\x1b[36m╰──────────────────────────────────────────────────────╯\x1b[0m\n`);
|
|
15
|
+
console.log("I’ll explore the project and draft a LinkedIn post for you.");
|
|
16
|
+
console.log("Paste a public GitHub repository URL to get started.\n");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function normalizeGitHubUrl(value) {
|
|
20
|
+
let url;
|
|
21
|
+
try {
|
|
22
|
+
url = new URL(value.trim());
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (url.protocol !== "https:" || url.hostname !== "github.com") return null;
|
|
28
|
+
|
|
29
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
30
|
+
if (parts.length !== 2 || parts.some((part) => part === "." || part === "..")) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const [owner, repository] = parts;
|
|
35
|
+
return `https://github.com/${owner}/${repository.replace(/\.git$/i, "")}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function askForRepository() {
|
|
39
|
+
const terminal = createInterface({ input: stdin, output: stdout });
|
|
40
|
+
try {
|
|
41
|
+
while (true) {
|
|
42
|
+
const answer = await terminal.question("\x1b[36m›\x1b[0m GitHub repo URL: ");
|
|
43
|
+
const repoUrl = normalizeGitHubUrl(answer);
|
|
44
|
+
if (repoUrl) return repoUrl;
|
|
45
|
+
console.log("Please enter a repository URL like https://github.com/owner/repo.\n");
|
|
46
|
+
}
|
|
47
|
+
} finally {
|
|
48
|
+
terminal.close();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function describeError(error) {
|
|
53
|
+
if (error?.status) {
|
|
54
|
+
return `The Eve server returned HTTP ${error.status}${error.body ? `: ${error.body}` : "."}`;
|
|
55
|
+
}
|
|
56
|
+
return error instanceof Error ? error.message : String(error);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function main() {
|
|
60
|
+
printWelcome();
|
|
61
|
+
const repoUrl = await askForRepository();
|
|
62
|
+
|
|
63
|
+
console.log(`\n\x1b[2mConnecting to ${agentUrl}…\x1b[0m`);
|
|
64
|
+
console.log("\x1b[33m⠋\x1b[0m Starting repository analysis…\n");
|
|
65
|
+
|
|
66
|
+
const client = new Client({ host: agentUrl });
|
|
67
|
+
const { response } = await client.sessions.create({
|
|
68
|
+
message: `Analyze this GitHub repository and draft a LinkedIn post: ${repoUrl}`,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
let wroteAssistantText = false;
|
|
72
|
+
for await (const event of response) {
|
|
73
|
+
if (event.type === "message.appended") {
|
|
74
|
+
if (!wroteAssistantText) {
|
|
75
|
+
stdout.write("\n");
|
|
76
|
+
wroteAssistantText = true;
|
|
77
|
+
}
|
|
78
|
+
stdout.write(event.data.messageDelta);
|
|
79
|
+
} else if (event.type === "actions.requested") {
|
|
80
|
+
const actions = event.data.actions ?? [];
|
|
81
|
+
const labels = actions.map((action) => action.label ?? action.name).filter(Boolean);
|
|
82
|
+
if (labels.length) console.log(`\n\x1b[2mWorking: ${labels.join(", ")}…\x1b[0m`);
|
|
83
|
+
} else if (event.type === "session.failed") {
|
|
84
|
+
throw new Error("The agent session failed. Check the deployment logs and try again.");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (wroteAssistantText) stdout.write("\n");
|
|
89
|
+
console.log("\n\x1b[32m✓ Analysis finished.\x1b[0m");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
main().catch((error) => {
|
|
93
|
+
console.error(`\n\x1b[31mCould not complete the analysis:\x1b[0m ${describeError(error)}`);
|
|
94
|
+
process.exitCode = 1;
|
|
95
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "linkedin-repo-storyteller-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A terminal client for turning GitHub repositories into LinkedIn post drafts with a remote Eve agent.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"linkedin-repo-storyteller-cli": "./cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"cli.js",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=24"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"eve": "^0.72.1"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/Vorpalv2/Linkedin-Agent.git",
|
|
23
|
+
"directory": "cli-package"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/Vorpalv2/Linkedin-Agent#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/Vorpalv2/Linkedin-Agent/issues"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"private": false
|
|
31
|
+
}
|