thinkncollab-cli 0.0.38 → 0.0.40
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/commands/help.js +8 -8
- package/commands/version.js +14 -0
- package/package.json +1 -1
package/commands/help.js
CHANGED
|
@@ -2,14 +2,14 @@ import chalk from "chalk";
|
|
|
2
2
|
|
|
3
3
|
async function help() {
|
|
4
4
|
console.log(chalk.red(" Command | Description "));
|
|
5
|
-
console.log(chalk.green(" `tnc-cli login`
|
|
6
|
-
console.log(chalk.green("`tnc-cli logout`
|
|
7
|
-
console.log(chalk.green("`tnc-cli whoami`
|
|
8
|
-
console.log(chalk.green("`tnc-cli push --room <id> <path>`
|
|
9
|
-
console.log(chalk.green("`tnc-cli rooms list`
|
|
10
|
-
console.log(chalk.green("`tnc-cli rooms info <id>`
|
|
11
|
-
console.log(chalk.green("`tnc-cli --help`
|
|
12
|
-
console.log(chalk.green(" `tnc-cli --version`
|
|
5
|
+
console.log(chalk.green(" `tnc-cli login` | Authenticate with ThinkNCollab"));
|
|
6
|
+
console.log(chalk.green("`tnc-cli logout` | Clear credentials "))
|
|
7
|
+
console.log(chalk.green("`tnc-cli whoami` | Show current user info"))
|
|
8
|
+
console.log(chalk.green("`tnc-cli push --room <id> <path>` | Push files/folders to a room"))
|
|
9
|
+
console.log(chalk.green("`tnc-cli rooms list` | List all accessible rooms"))
|
|
10
|
+
console.log(chalk.green("`tnc-cli rooms info <id>` | Show room details"))
|
|
11
|
+
console.log(chalk.green("`tnc-cli --help` | Show help information "))
|
|
12
|
+
console.log(chalk.green(" `tnc-cli --version` | Show CLI version"))
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
}
|
package/commands/version.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import inquirer from "inquirer";
|
|
5
|
+
import axios from "axios";
|
|
6
|
+
|
|
7
|
+
const homeDir = os.homedir();
|
|
8
|
+
const pkg = path.join(homeDir, "AppData\Roaming\npm\thinkncollab-cli\package.json");
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
if(fs.existsSync(pkg)) {
|
|
12
|
+
const version = JSON.parse(fs.readFileSync(pkg, "utf-8")).version;
|
|
13
|
+
console.log(`ThinkNCollab CLI Version: ${version}`);
|
|
14
|
+
}
|