social-light 0.0.1

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/src/index.mjs ADDED
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node --no-deprecation
2
+
3
+ // Load environment variables from .env file
4
+ import { config } from "dotenv";
5
+ config();
6
+
7
+ import yargs from "yargs";
8
+ import { hideBin } from "yargs/helpers";
9
+ import chalk from "chalk";
10
+
11
+ import { initialize } from "./commands/init.mjs";
12
+ import { createPost } from "./commands/create.mjs";
13
+ import { listUnpublished } from "./commands/unpublished.mjs";
14
+ import { listPublished } from "./commands/published.mjs";
15
+ import { editPost } from "./commands/edit.mjs";
16
+ import { publishPosts } from "./commands/publish.mjs";
17
+ import { startServer } from "./server/index.mjs";
18
+
19
+ // Application title banner
20
+ const displayBanner = () => {
21
+ console.log(
22
+ chalk.cyan(`
23
+ _____ ____ _____ _____ _ _ _____ _____ _ _ _______
24
+ / ____|/ __ \ / ____|_ _| /\ | | | | |_ _/ ____| | | |__ __|
25
+ | (___ | | | | | | | / \ | | | | | || | __| |__| | | |
26
+ \___ \| | | | | | | / /\ \ | | | | | || | |_ | __ | | |
27
+ ____) | |__| | |____ _| |_ / ____ \| |____ | |____ _| || |__| | | | | | |
28
+ |_____/ \____/ \_____|_____/_/ \_\______| |______|_____\_____|_| |_| |_|
29
+
30
+
31
+ `)
32
+ );
33
+ console.log(chalk.gray("AI-powered social media scheduler\n"));
34
+ };
35
+
36
+ const main = async () => {
37
+ displayBanner();
38
+
39
+ yargs(hideBin(process.argv))
40
+ .command("init", "Initialize Social Light configuration", {}, initialize)
41
+ .command(
42
+ "create",
43
+ "Create a new social media post",
44
+ {
45
+ file: {
46
+ alias: "f",
47
+ describe: "Create post from file",
48
+ type: "string",
49
+ },
50
+ },
51
+ createPost
52
+ )
53
+ .command("unpublished", "List all unpublished posts", {}, listUnpublished)
54
+ .command("published", "List all published posts", {}, listPublished)
55
+ .command(
56
+ "edit [index]",
57
+ "Edit a draft post by index",
58
+ {
59
+ index: {
60
+ describe: "Index of the post to edit",
61
+ type: "number",
62
+ },
63
+ },
64
+ editPost
65
+ )
66
+ .command(
67
+ "publish",
68
+ "Publish eligible posts",
69
+ {
70
+ continuous: {
71
+ alias: "c",
72
+ describe: "Run in continuous mode, polling for publishable posts",
73
+ type: "boolean",
74
+ default: false,
75
+ },
76
+ },
77
+ publishPosts
78
+ )
79
+ .command(
80
+ "server",
81
+ "Start the web interface",
82
+ {
83
+ port: {
84
+ alias: "p",
85
+ describe: "Port to run the server on",
86
+ type: "number",
87
+ default: 3000,
88
+ },
89
+ "no-open": {
90
+ describe: "Disable automatically opening the browser",
91
+ type: "boolean",
92
+ default: false,
93
+ },
94
+ },
95
+ startServer
96
+ )
97
+ .demandCommand(1, "Please specify a command")
98
+ .help().argv;
99
+ };
100
+
101
+ // Handle top-level await
102
+ try {
103
+ await main();
104
+ } catch (error) {
105
+ console.error(chalk.red("Error:"), error.message);
106
+ process.exit(1);
107
+ }
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Social Light - Social Media Scheduler</title>
7
+ <link rel="stylesheet" href="styles.css" />
8
+ <!-- Add system font stack as specified in user preferences -->
9
+ <style>
10
+ :root {
11
+ --color-bg-dark: #1a1a1c;
12
+ --color-bg-card: #27272a;
13
+ --color-bg-code: #232334;
14
+ --color-text-primary: #e9e9ea;
15
+ --color-text-secondary: #a1a1a8;
16
+ --color-accent-primary: #8c7ae6;
17
+ --color-accent-primary-hover: #a192ea;
18
+ --color-accent-action: #e67e22;
19
+ --color-accent-action-hover: #f39c12;
20
+ --color-accent-danger: #e25f73;
21
+ --color-border: #393941;
22
+ --border-radius: 8px;
23
+ --padding-card: 20px;
24
+ --padding-section: 16px;
25
+ }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <div id="app">
30
+ <!-- App will be mounted here -->
31
+ <img src="logo.png" alt="Social Light Logo" class="logo" />
32
+ <div class="loading">
33
+ <div class="spinner"></div>
34
+ <p>Loading Social Light...</p>
35
+ </div>
36
+ </div>
37
+
38
+ <!-- Script will be injected by server in production -->
39
+ <script type="module" src="main.mjs"></script>
40
+ </body>
41
+ </html>
Binary file