codewithdhruba-01 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.
Files changed (3) hide show
  1. package/README.md +59 -0
  2. package/bin/index.js +62 -0
  3. package/package.json +25 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # CLI Portfolio - Step by Step Guide
2
+
3
+ This guide will help you publish your CLI portfolio so you (and others) can run it using `npx codewithdhruba-01`.
4
+
5
+ ## 1. Prerequisites (You've already done this!)
6
+
7
+ You need to be logged in to npm. You already ran `npm login`, so you are good to go!
8
+
9
+ ## 2. Publish Your Package
10
+
11
+ To make your CLI available globally, you need to publish it to the npm registry.
12
+
13
+ 1. Make sure you are in the `cli` directory:
14
+ ```bash
15
+ cd cli
16
+ ```
17
+
18
+ 2. Run the publish command:
19
+ ```bash
20
+ npm publish --access public
21
+ ```
22
+
23
+ ### ⚠️ Possible Error: Name Already Taken?
24
+ If you see an error saying roughly **"You do not have permission to publish 'codewithdhruba-01'"**, it means someone else has already used this name.
25
+
26
+ **Fix:**
27
+ 1. Open `package.json` in the `cli` folder.
28
+ 2. Change the `"name"` field to something unique (e.g., `codewithdhruba-portfolio`, `dhrubaraj-cli`, etc.).
29
+ 3. Try `npm publish --access public` again.
30
+
31
+ ## 3. Run Your CLI
32
+
33
+ **Once successfully published**, you can run your portfolio from ANY terminal, anywhere!
34
+
35
+ ```bash
36
+ npx codewithdhruba-01
37
+ ```
38
+
39
+ (Note: If you changed the package name in step 2, replace `codewithdhruba-01` with your new name).
40
+
41
+ ## 4. How to Update
42
+
43
+ If you want to change the text or colors later:
44
+
45
+ 1. Edit the code in `bin/index.js`.
46
+ 2. Open `package.json` and **increase the version number** (e.g., change `1.0.0` to `1.0.1`).
47
+ 3. Run `npm publish` again.
48
+ 4. Users will see the new version when they run `npx codewithdhruba-01`.
49
+
50
+ ## 5. Local Testing (Without Publishing)
51
+
52
+ If you just want to test it on your own machine without publishing:
53
+
54
+ 1. Go to the `cli` folder.
55
+ 2. Run:
56
+ ```bash
57
+ npx .
58
+ ```
59
+ (The dot `.` means "run the package in the current directory").
package/bin/index.js ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+
3
+ import chalk from 'chalk';
4
+ import figlet from 'figlet';
5
+ import boxen from 'boxen';
6
+ import gradient from 'gradient-string';
7
+
8
+ const log = console.log;
9
+
10
+ // ASCII Art
11
+ const asciiText = figlet.textSync('CODEWITHDHRUBA', {
12
+ font: 'Standard',
13
+ horizontalLayout: 'default',
14
+ verticalLayout: 'default',
15
+ width: 80,
16
+ whitespaceBreak: true
17
+ });
18
+
19
+ const gradientText = gradient.pastel.multiline(asciiText);
20
+
21
+ // Box Content
22
+ const data = {
23
+ name: chalk.bold.green(" Dhrubaraj Pati"),
24
+ handle: chalk.bold.cyan("dhrubaraj-pati"),
25
+ work: chalk.white("Co-Founder @codewithdhruba.app"),
26
+ twitter: chalk.gray("https://twitter.com/") + chalk.cyan("codewithdhruba"),
27
+ github: chalk.gray("https://github.com/") + chalk.cyan("dhrubaraj-pati"),
28
+ linkedin: chalk.gray("https://linkedin.com/in/") + chalk.cyan("dhrubaraj-pati"),
29
+ web: chalk.cyan("https://codewithdhruba.app"),
30
+ npx: chalk.red("npx") + " " + chalk.white("codewithdhruba-01"),
31
+ labelWork: chalk.white.bold(" Work:"),
32
+ labelTwitter: chalk.white.bold(" Twitter:"),
33
+ labelGitHub: chalk.white.bold(" GitHub:"),
34
+ labelLinkedIn: chalk.white.bold(" LinkedIn:"),
35
+ labelWeb: chalk.white.bold(" Web:"),
36
+ labelCard: chalk.white.bold(" Card:")
37
+ };
38
+
39
+ const output = `
40
+ ${gradientText}
41
+
42
+ ${chalk.bold("software engineer | frontend developer | open source enthusiast")}
43
+
44
+ ${data.labelWork} ${data.work}
45
+ ${data.labelWeb} ${data.web}
46
+ ${data.labelTwitter} ${data.twitter}
47
+ ${data.labelGitHub} ${data.github}
48
+ ${data.labelLinkedIn} ${data.linkedin}
49
+
50
+ ${data.labelCard} ${data.npx}
51
+ `;
52
+
53
+ const boxenOptions = {
54
+ padding: 1,
55
+ margin: 1,
56
+ borderStyle: 'round',
57
+ borderColor: 'green',
58
+ title: 'me',
59
+ titleAlignment: 'center'
60
+ };
61
+
62
+ log(boxen(output, boxenOptions));
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "codewithdhruba-01",
3
+ "version": "1.0.0",
4
+ "description": "A CLI based portfolio for Dhrubaraj Pati",
5
+ "type": "module",
6
+ "main": "bin/index.js",
7
+ "bin": {
8
+ "codewithdhruba-01": "./bin/index.js"
9
+ },
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "keywords": [
14
+ "cli",
15
+ "portfolio"
16
+ ],
17
+ "author": "Dhrubaraj Pati",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "boxen": "^7.1.1",
21
+ "chalk": "^5.3.0",
22
+ "figlet": "^1.7.0",
23
+ "gradient-string": "^2.0.2"
24
+ }
25
+ }