chirpie 0.1.0 → 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/dist/index.js +2 -7
- package/package.json +20 -6
package/dist/index.js
CHANGED
|
@@ -71,12 +71,6 @@ function openBrowser(url) {
|
|
|
71
71
|
exec(`${cmd} "${url}"`);
|
|
72
72
|
}
|
|
73
73
|
var loginCommand = new Command2("login").description("Authenticate with your Chirpie account (opens browser)").option("--base-url <url>", "Base URL", "https://chirpie.ai").action(async (opts) => {
|
|
74
|
-
const existing = getConfig();
|
|
75
|
-
if (existing) {
|
|
76
|
-
info(`Already authenticated (${existing.api_key.slice(0, 20)}...)`);
|
|
77
|
-
info("Run chirpie logout to sign out first, or chirpie auth --key to change keys.");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
74
|
const state = randomBytes(16).toString("hex");
|
|
81
75
|
const baseUrl = opts.baseUrl;
|
|
82
76
|
const server = createServer((req, res) => {
|
|
@@ -154,7 +148,7 @@ function getClient() {
|
|
|
154
148
|
}
|
|
155
149
|
|
|
156
150
|
// src/commands/post.ts
|
|
157
|
-
var postCommand = new Command3("post").description("Create a post on X").argument("<text>", "Post text (max 280 chars)").option("-a, --account <id>", "Account ID").option("-s, --schedule <datetime>", "Schedule for later (ISO 8601)").option("--json", "Output raw JSON").action(async (text, opts) => {
|
|
151
|
+
var postCommand = new Command3("post").description("Create a post on X").argument("<text>", "Post text (max 280 chars)").option("-a, --account <id>", "Account ID").option("-m, --media <urls...>", "Media URLs (up to 4 images or 1 video)").option("-s, --schedule <datetime>", "Schedule for later (ISO 8601)").option("--json", "Output raw JSON").action(async (text, opts) => {
|
|
158
152
|
const client = getClient();
|
|
159
153
|
let accountId = opts.account;
|
|
160
154
|
if (!accountId) {
|
|
@@ -175,6 +169,7 @@ var postCommand = new Command3("post").description("Create a post on X").argumen
|
|
|
175
169
|
const post = await client.createPost({
|
|
176
170
|
account_id: accountId,
|
|
177
171
|
text,
|
|
172
|
+
media_urls: opts.media,
|
|
178
173
|
schedule_at: opts.schedule
|
|
179
174
|
});
|
|
180
175
|
if (opts.json) {
|
package/package.json
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chirpie",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Chirpie CLI — post to social media from the command line",
|
|
5
|
-
"repository": {
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Firefloco/chirpie",
|
|
8
|
+
"directory": "packages/cli"
|
|
9
|
+
},
|
|
6
10
|
"homepage": "https://chirpie.ai/docs/cli",
|
|
7
|
-
"publishConfig": {
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
8
14
|
"type": "module",
|
|
9
15
|
"bin": {
|
|
10
16
|
"chirpie": "./dist/index.js"
|
|
11
17
|
},
|
|
12
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
13
21
|
"scripts": {
|
|
14
22
|
"build": "tsup",
|
|
15
23
|
"dev": "tsup --watch"
|
|
16
24
|
},
|
|
17
|
-
"keywords": [
|
|
25
|
+
"keywords": [
|
|
26
|
+
"chirpie",
|
|
27
|
+
"cli",
|
|
28
|
+
"social-media",
|
|
29
|
+
"twitter",
|
|
30
|
+
"x"
|
|
31
|
+
],
|
|
18
32
|
"license": "MIT",
|
|
19
33
|
"dependencies": {
|
|
20
|
-
"@chirpie/sdk": "^
|
|
34
|
+
"@chirpie/sdk": "^1.0.0",
|
|
21
35
|
"commander": "^13"
|
|
22
36
|
},
|
|
23
37
|
"devDependencies": {
|