Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 75c4db2

Browse files
committed
feat: implement git-style developer-focused CLI output v0.2.1
- Replace emoji-heavy friendly style with technical brackets [✓] [→] [i] [▶] [!] - Apply developer-focused color scheme (cyan/green/yellow/gray) - Update CLI header to "create-midnight-app v0.2.1" - Redesign requirement checker with technical format - Transform setup guide to git-style sections - Fix double "v" bug in version display - Maintain clean, professional output similar to git/cargo/npm CLI tools
1 parent 3069d9c commit 75c4db2

File tree

5 files changed

+47
-74
lines changed

5 files changed

+47
-74
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-mn-app",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Create Midnight Network applications with zero configuration",
55
"main": "dist/index.js",
66
"bin": {

src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ program
2525
.option("--skip-git", "Skip git repository initialization")
2626
.option("--verbose", "Show detailed output")
2727
.action(async (projectDirectory, options) => {
28-
console.log(chalk.blue.bold("🌙 Create Midnight App\n"));
28+
console.log(
29+
chalk.bold.cyan("\ncreate-midnight-app") + chalk.gray(" v0.2.1\n")
30+
);
2931

3032
try {
3133
await createApp(projectDirectory, options);

src/create-app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ export async function createApp(
122122
} else {
123123
packageManager = detectPackageManager();
124124
console.log(
125-
chalk.gray(`ℹ Detected package manager: ${chalk.cyan(packageManager)}\n`)
125+
chalk.bold("[" + chalk.blue("i") + "] ") +
126+
chalk.gray(`package manager: ${chalk.cyan(packageManager)}\n`)
126127
);
127128
}
128129

src/utils/requirement-checker.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,41 +83,41 @@ export class RequirementChecker {
8383
* Display requirement check results
8484
*/
8585
static displayResults(checks: RequirementCheck[]): boolean {
86-
console.log(chalk.blue.bold("\n🔍 Checking Requirements\n"));
86+
console.log(chalk.bold("[" + chalk.cyan("✓") + "] Requirements Check\n"));
8787

8888
let allPassed = true;
8989

9090
for (const check of checks) {
91+
const name = check.name.toLowerCase().padEnd(16);
9192
if (check.found) {
92-
console.log(
93-
`${chalk.green("✓")} ${check.name} ${
94-
check.version ? chalk.gray(`(${check.version})`) : ""
95-
}`
96-
);
93+
const version = check.version ? chalk.gray(`${check.version}`) : "";
94+
const status = chalk.green("[installed]");
95+
console.log(` ${chalk.gray(name)} ${version} ${status}`);
9796
} else {
9897
allPassed = false;
99-
console.log(
100-
`${chalk.red("✗")} ${check.name} ${chalk.red("not found")}`
101-
);
98+
const status = chalk.red("[missing]");
99+
console.log(` ${chalk.gray(name)} ${status}`);
102100
}
103101
}
104102

105103
if (!allPassed) {
106104
console.log();
107-
console.log(chalk.yellow.bold("⚠ Missing Requirements:\n"));
105+
console.log(
106+
chalk.bold("[" + chalk.yellow("!") + "] Missing Dependencies\n")
107+
);
108108

109109
for (const check of checks.filter((c) => !c.found)) {
110-
console.log(chalk.white(`${check.name}:`));
110+
console.log(chalk.white(` ${check.name}:`));
111111
if (check.installCommand) {
112-
console.log(chalk.gray(` Install: ${check.installCommand}`));
112+
console.log(chalk.gray(` $ ${check.installCommand}`));
113113
}
114114
if (check.installUrl) {
115-
console.log(chalk.gray(` Visit: ${check.installUrl}`));
115+
console.log(chalk.gray(` ${check.installUrl}`));
116116
}
117117
console.log();
118118
}
119119
} else {
120-
console.log(chalk.green("\n✓ All requirements met!\n"));
120+
console.log(chalk.gray("\n all dependencies satisfied\n"));
121121
}
122122

123123
return allPassed;

src/utils/setup-guide.ts

Lines changed: 27 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ export class SetupGuide {
2121
const template = getTemplate(templateName);
2222
if (!template || template.type !== "remote") return;
2323

24-
console.log();
25-
console.log(chalk.blue.bold("📚 Setup Instructions\n"));
24+
console.log(chalk.bold("\n[" + chalk.blue("→") + "] Next Steps\n"));
2625

2726
if (templateName === "counter") {
2827
this.displayCounterInstructions(projectName, packageManager);
@@ -47,70 +46,49 @@ export class SetupGuide {
4746
: "bun install";
4847
const runCmd = pm === "npm" ? "npm run" : pm;
4948

50-
console.log(chalk.white.bold("📂 Project Structure:"));
51-
console.log(
52-
chalk.gray(" contract/ - Smart contract in Compact language")
53-
);
54-
console.log(chalk.gray(" counter-cli/ - Command-line interface"));
49+
console.log(chalk.gray(" project structure:"));
50+
console.log(chalk.gray(" ├─ contract/ smart contract (compact)"));
51+
console.log(chalk.gray(" └─ counter-cli/ cli interface"));
5552
console.log();
5653

57-
console.log(chalk.white.bold("🚀 Getting Started:\n"));
58-
59-
console.log(chalk.yellow("1.") + " Navigate to your project:");
60-
console.log(` ${chalk.cyan(`cd ${projectName}`)}`);
61-
console.log();
62-
63-
console.log(chalk.yellow("2.") + " Install dependencies:");
64-
console.log(` ${chalk.cyan(installCmd)}`);
65-
console.log();
66-
67-
console.log(chalk.yellow("3.") + " Compile the smart contract:");
68-
console.log(` ${chalk.cyan(`cd contract && ${runCmd} compact`)}`);
54+
console.log(chalk.gray(" $ ") + chalk.cyan(`cd ${projectName}`));
55+
console.log(chalk.gray(" $ ") + chalk.cyan(installCmd));
6956
console.log(
70-
chalk.gray(" (First time may download ~500MB of ZK parameters)")
57+
chalk.gray(" $ ") + chalk.cyan(`cd contract && ${runCmd} compact`)
7158
);
72-
console.log();
73-
74-
console.log(chalk.yellow("4.") + " Build the project:");
75-
console.log(` ${chalk.cyan(`${runCmd} build`)}`);
76-
console.log(` ${chalk.cyan(`cd ../counter-cli && ${runCmd} build`)}`);
77-
console.log();
78-
7959
console.log(
80-
chalk.yellow("5.") + " Start the proof server (in a new terminal):"
60+
chalk.gray(" (downloads ~500MB zk parameters on first run)")
8161
);
62+
console.log(chalk.gray(" $ ") + chalk.cyan(`${runCmd} build`));
8263
console.log(
83-
chalk.cyan(
84-
" docker run -p 6300:6300 midnightnetwork/proof-server -- 'midnight-proof-server --network testnet'"
85-
)
64+
chalk.gray(" $ ") + chalk.cyan(`cd ../counter-cli && ${runCmd} build`)
8665
);
87-
console.log(chalk.gray(" Keep this running!"));
8866
console.log();
8967

90-
console.log(chalk.yellow("6.") + " Run the Counter DApp:");
68+
console.log(chalk.bold("[" + chalk.magenta("i") + "] Proof Server\n"));
9169
console.log(
92-
` ${chalk.cyan(`cd counter-cli && ${runCmd} start-testnet-remote`)}`
70+
chalk.gray(" $ ") +
71+
chalk.cyan(
72+
"docker run -p 6300:6300 midnightnetwork/proof-server -- 'midnight-proof-server --network testnet'"
73+
)
9374
);
75+
console.log(chalk.gray(" keep this terminal running"));
9476
console.log();
9577

96-
console.log(chalk.magenta.bold("💡 Important Notes:\n"));
78+
console.log(chalk.bold("[" + chalk.green("▶") + "] Run Application\n"));
9779
console.log(
98-
chalk.gray(
99-
" • You'll need to create a wallet and fund it from the faucet"
100-
)
80+
chalk.gray(" $ ") +
81+
chalk.cyan(`cd counter-cli && ${runCmd} start-testnet-remote`)
10182
);
102-
console.log(
103-
chalk.gray(" • Testnet faucet: https://midnight.network/test-faucet")
104-
);
105-
console.log(chalk.gray(" • Funding takes 2-3 minutes to process"));
10683
console.log();
10784

108-
console.log(chalk.white.bold("📖 Full Guide:"));
85+
console.log(chalk.bold("[" + chalk.yellow("!") + "] Important\n"));
86+
console.log(chalk.gray(" • create wallet and fund from faucet"));
10987
console.log(
110-
chalk.gray(
111-
" See README.md for detailed instructions and troubleshooting"
112-
)
88+
chalk.gray(" • testnet faucet: https://midnight.network/test-faucet")
11389
);
90+
console.log(chalk.gray(" • funding takes 2-3 minutes"));
91+
console.log(chalk.gray(" • see README.md for detailed guide"));
11492
console.log();
11593
}
11694

@@ -121,19 +99,11 @@ export class SetupGuide {
12199
const template = getTemplate(templateName);
122100
if (!template) return;
123101

124-
console.log();
125-
console.log(chalk.green("✓ Successfully cloned example project!"));
126-
console.log();
102+
console.log(chalk.bold("\n[" + chalk.green("✓") + "] Clone Complete\n"));
127103

128104
if (template.requiresCompactCompiler) {
129-
console.log(
130-
chalk.yellow(
131-
"⚠ This project requires the Compact compiler to be installed."
132-
)
133-
);
134-
console.log(
135-
chalk.gray(" Follow the setup instructions below to install it.")
136-
);
105+
console.log(chalk.gray(" compact compiler required"));
106+
console.log(chalk.gray(" follow setup instructions below"));
137107
console.log();
138108
}
139109
}

0 commit comments

Comments
 (0)