thinkncollab-cli 0.0.87 → 0.0.89
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/index.js +48 -32
- package/commands/connect.js +3 -3
- package/commands/createTask.js +25 -6
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -29,16 +29,7 @@ const VERSION_FILE = path.join(process.cwd(), ".tncversions");
|
|
|
29
29
|
const BASE_URL = "https://thinkncollab.com/rooms";
|
|
30
30
|
const CWD = process.cwd();
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
const res = await axios.get(`http://localhost:4545/logout`);
|
|
35
|
-
console.log("✅ Command sent to ThinkNCollab Agent");
|
|
36
|
-
console.log(res.data.message);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.error("❌ ThinkNCollab Agent not running");
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
32
|
+
|
|
42
33
|
|
|
43
34
|
|
|
44
35
|
/** ------------------ LOGIN ------------------ **/
|
|
@@ -228,28 +219,53 @@ case "signout": {
|
|
|
228
219
|
|
|
229
220
|
}
|
|
230
221
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
222
|
+
default:
|
|
223
|
+
console.log("================================");
|
|
224
|
+
console.log(" THINKNCOLLAB CLI");
|
|
225
|
+
console.log("================================\n");
|
|
226
|
+
|
|
227
|
+
console.log("Authentication:");
|
|
228
|
+
console.log(" tnc-cli login Login to your account");
|
|
229
|
+
console.log(" tnc-cli logout Logout from your account");
|
|
230
|
+
console.log(" tnc-cli whoami Show current logged-in user");
|
|
231
|
+
console.log("");
|
|
232
|
+
|
|
233
|
+
console.log("Project / Room:");
|
|
234
|
+
console.log(" tnc-cli init <roomId> Initialize current folder with a room");
|
|
235
|
+
console.log(" tnc-cli connect <roomId> Connect project to a room");
|
|
236
|
+
console.log(" tnc-cli status Show project status");
|
|
237
|
+
console.log("");
|
|
238
|
+
|
|
239
|
+
console.log("Branch:");
|
|
240
|
+
console.log(" tnc-cli create --room <roomId> Create branch for a room");
|
|
241
|
+
console.log("");
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
console.log("Tasks:");
|
|
245
|
+
console.log(" tnc-cli my-tasks Show your assigned tasks");
|
|
246
|
+
console.log(" tnc-cli create-task Create a new task");
|
|
247
|
+
console.log(" tnc-cli task View task details");
|
|
248
|
+
console.log(" tnc-cli task-complete Mark task as completed");
|
|
249
|
+
console.log("");
|
|
250
|
+
|
|
251
|
+
console.log("Team:");
|
|
252
|
+
console.log(" tnc-cli myteam Show team members");
|
|
253
|
+
console.log(" tnc-cli invite <email> Invite member to room");
|
|
254
|
+
console.log("");
|
|
255
|
+
|
|
256
|
+
console.log("Communication:");
|
|
257
|
+
console.log(" tnc-cli send Send message to room");
|
|
258
|
+
console.log("");
|
|
259
|
+
|
|
260
|
+
console.log("Utility:");
|
|
261
|
+
console.log(" tnc-cli help Show help information");
|
|
262
|
+
console.log(" tnc-cli version Show CLI version");
|
|
263
|
+
console.log(" tnc-cli signout Sign out from DAPP");
|
|
264
|
+
console.log("");
|
|
265
|
+
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
|
|
253
269
|
}
|
|
254
270
|
|
|
255
271
|
main().catch(err => console.error(err));
|
package/commands/connect.js
CHANGED
|
@@ -20,7 +20,7 @@ async function connect(roomId) {
|
|
|
20
20
|
const { email, token } = JSON.parse(data);
|
|
21
21
|
|
|
22
22
|
try {
|
|
23
|
-
const response = await axios.post(`
|
|
23
|
+
const response = await axios.post(`https://thinkncollab.com/cli/connect/${roomId}`, {
|
|
24
24
|
email: email,
|
|
25
25
|
token: token,
|
|
26
26
|
machineId: await machine.machineIdSync(),
|
|
@@ -52,8 +52,8 @@ console.log(response.data);
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
console.log("✅ Connected to project:", response.data.project.name);
|
|
56
|
+
console.log("Members connected:", response.data.project.membersConnected);
|
|
57
57
|
|
|
58
58
|
} catch (err) {
|
|
59
59
|
if (err.response) {
|
package/commands/createTask.js
CHANGED
|
@@ -9,14 +9,10 @@ import open from 'open';
|
|
|
9
9
|
import http from 'http';
|
|
10
10
|
|
|
11
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
|
|
13
|
-
const getVerify = getVerifyModule.default;
|
|
14
|
-
const { token } = await getVerify();
|
|
12
|
+
|
|
15
13
|
|
|
16
14
|
const CWD = process.cwd();
|
|
17
|
-
|
|
18
|
-
const fileData = fs.existsSync(tncmetaPath) ? JSON.parse(fs.readFileSync(tncmetaPath, "utf-8")) : null;
|
|
19
|
-
const roomId = fileData?.roomId || null;
|
|
15
|
+
|
|
20
16
|
|
|
21
17
|
function createSpinner(message) {
|
|
22
18
|
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
@@ -42,6 +38,29 @@ function createSpinner(message) {
|
|
|
42
38
|
|
|
43
39
|
async function createTask() {
|
|
44
40
|
try {
|
|
41
|
+
const { default: getVerify } = await import("../lib/getVerify.js");
|
|
42
|
+
|
|
43
|
+
const { token } = await getVerify();
|
|
44
|
+
|
|
45
|
+
const CWD = process.cwd();
|
|
46
|
+
const tncmetaPath = path.join(CWD, ".tnc", ".tncmeta.json");
|
|
47
|
+
|
|
48
|
+
if (!fs.existsSync(tncmetaPath)) {
|
|
49
|
+
console.error(chalk.red("❌ Not inside a ThinkNCollab project."));
|
|
50
|
+
console.log(chalk.yellow("Run `tnc-cli init <roomId>` first."));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const fileData = JSON.parse(
|
|
55
|
+
fs.readFileSync(tncmetaPath, "utf-8")
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const roomId = fileData.roomId;
|
|
59
|
+
|
|
60
|
+
if (!roomId) {
|
|
61
|
+
console.error(chalk.red("❌ No roomId found."));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
45
64
|
console.log(chalk.blue('\n🚀 Task Creation CLI\n'));
|
|
46
65
|
|
|
47
66
|
// Validate roomId and token
|