rafaygen-cli 1.0.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/bin/rgcli.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from "commander";
4
+ import chalk from "chalk";
5
+ import { setToken, setApiUrl } from "../src/auth.js";
6
+ import { askAgent } from "../src/agent.js";
7
+ import { printSuccess } from "../src/ui.js";
8
+ import fs from "fs";
9
+
10
+ // Read version from package.json
11
+ const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
12
+
13
+ const program = new Command();
14
+
15
+ program
16
+ .name("rgcli")
17
+ .description("RafayGen - The Ultimate Agentic Coding CLI")
18
+ .version(pkg.version);
19
+
20
+ program
21
+ .command("login")
22
+ .description("Authenticate with your RafayGen live app")
23
+ .argument("<token>", "Your Personal Access Token")
24
+ .option("--url <url>", "Set custom API URL (e.g. http://localhost:3000/api/cli)")
25
+ .action((token, options) => {
26
+ setToken(token);
27
+ if (options.url) {
28
+ setApiUrl(options.url);
29
+ }
30
+ printSuccess("Successfully logged in to RafayGen!");
31
+ });
32
+
33
+ program
34
+ .command("ask")
35
+ .description("Ask RafayGen to write code, modify files, or run commands")
36
+ .argument("<prompt...>", "What do you want to build?")
37
+ .action((promptWords) => {
38
+ const prompt = promptWords.join(" ");
39
+ askAgent(prompt);
40
+ });
41
+
42
+ // Handle default command if no args provided
43
+ if (process.argv.length === 2) {
44
+ console.log(chalk.cyan.bold(`
45
+ ____ __ _____
46
+ | _ \\ / _| / ____|
47
+ | |_) | __ _| |_ __ _ _ _| | __ ___ _ __
48
+ | _ < / _\` | _/ _\` | | | | |_ / _ \\ '_ \\
49
+ | |_) | (_| | || (_| | |_| |__| | __/ | | |
50
+ |____/ \\__,_|_| \\__,_|\\__, \\_____\\___|_| |_|
51
+ __/ |
52
+ |___/
53
+ `));
54
+ program.help();
55
+ }
56
+
57
+ program.parse(process.argv);
@@ -0,0 +1,7 @@
1
+ Package: rgcli
2
+ Version: 1.0.0
3
+ Architecture: amd64
4
+ Maintainer: RafayGen <rafaygen@example.com>
5
+ Description: RafayGen - The Ultimate Agentic Coding CLI
6
+ Brings the power of agentic coding to your terminal.
7
+ Reads, writes, edits, and executes code right on your local machine.
Binary file
@@ -0,0 +1,25 @@
1
+ const token = "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";
2
+
3
+ async function main() {
4
+ const res = await fetch("https://api.github.com/repos/rafay0342/rgcli/actions/runs/26226725358", {
5
+ headers: { "Authorization": `Bearer ${token}` }
6
+ });
7
+ const data = await res.json();
8
+ console.log("Run name:", data.name);
9
+ console.log("Run status:", data.status);
10
+ console.log("Run conclusion:", data.conclusion);
11
+
12
+ const jobsRes = await fetch("https://api.github.com/repos/rafay0342/rgcli/actions/runs/26226725358/jobs", {
13
+ headers: { "Authorization": `Bearer ${token}` }
14
+ });
15
+ const jobsData = await jobsRes.json();
16
+ const job = jobsData.jobs[0];
17
+ console.log("Job status:", job.status);
18
+ console.log("Job conclusion:", job.conclusion);
19
+
20
+ console.log("All Steps:");
21
+ job.steps.forEach(s => {
22
+ console.log(`- ${s.name}: ${s.status} / ${s.conclusion}`);
23
+ });
24
+ }
25
+ main();