thinkncollab-cli 0.0.36 → 0.0.38

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/Readme.md CHANGED
@@ -8,7 +8,7 @@ A powerful command-line interface for seamless collaboration with **ThinkNCollab
8
8
 
9
9
  ```bash
10
10
  # Install the CLI globally
11
- npm install -g @thinkncollab/tnc-cli
11
+ npm install -g thinkncollab-cli
12
12
 
13
13
  # Login to your ThinkNCollab account
14
14
  tnc-cli login
package/bin/index.js CHANGED
@@ -9,6 +9,8 @@ import FormData from "form-data";
9
9
  import projectInit from "../commands/init.js";
10
10
  import Status from "../commands/status.js";
11
11
  import pull from "../commands/pull.js";
12
+ import whoami from "../commands/whoami.js";
13
+ import help from "../commands/help.js";
12
14
 
13
15
  const RC_FILE = path.join(os.homedir(), ".tncrc");
14
16
  const VERSION_FILE = path.join(process.cwd(), ".tncversions");
@@ -464,6 +466,14 @@ async function main() {
464
466
  await pull(roomId, version);
465
467
  break;
466
468
  }
469
+
470
+ case "whoami":
471
+ await whoami();
472
+ break;
473
+
474
+ case "help":
475
+ await help();
476
+ break;
467
477
 
468
478
  default:
469
479
  console.log("✅ TNC CLI ready!");
@@ -0,0 +1,16 @@
1
+ import chalk from "chalk";
2
+
3
+ async function help() {
4
+ console.log(chalk.red(" Command | Description "));
5
+ console.log(chalk.green(" `tnc-cli login` ")| chalk.yellow("Authenticate with ThinkNCollab"));
6
+ console.log(chalk.green("`tnc-cli logout` ")| chalk.yellow("Clear credentials "))
7
+ console.log(chalk.green("`tnc-cli whoami` ")| chalk.yellow("Show current user info"))
8
+ console.log(chalk.green("`tnc-cli push --room <id> <path>` ")| chalk.yellow("Push files/folders to a room"))
9
+ console.log(chalk.green("`tnc-cli rooms list`") | chalk.yellow("List all accessible rooms"))
10
+ console.log(chalk.green("`tnc-cli rooms info <id>` ")| chalk.yellow("Show room details"))
11
+ console.log(chalk.green("`tnc-cli --help` ")| chalk.yellow("Show help information "))
12
+ console.log(chalk.green(" `tnc-cli --version` ")| chalk.yellow("Show CLI version"))
13
+
14
+
15
+ }
16
+ export default help;
File without changes
@@ -0,0 +1,19 @@
1
+ import fs from "fs";
2
+ import os from "os";
3
+ import path from "path";
4
+
5
+ const RC_FILE = path.join(os.homedir(), ".tncrc");
6
+
7
+ async function whoami() {
8
+ try{
9
+ if(fs.existsSync(RC_FILE)) {
10
+ const rcData = fs.readFileSync(RC_FILE, "utf-8");
11
+ const {email} = JSON.parse(rcData);
12
+ console.log('You are logged in by the email:', email);
13
+ }
14
+ } catch (error) {
15
+ console.error('Error reading .tncrc file:', error);
16
+ }
17
+ }
18
+
19
+ export default whoami;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thinkncollab-cli",
3
3
  "author": "Raman Singh",
4
- "version": "0.0.36",
4
+ "version": "0.0.38",
5
5
  "description": "CLI tool for ThinkNCollab",
6
6
  "main": "index.js",
7
7
  "bin": {