@nalvietnam/avatar-cli 1.8.0 → 1.9.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.
package/dist/index.js
CHANGED
|
@@ -2313,7 +2313,7 @@ function registerGitnexusCommand(program2) {
|
|
|
2313
2313
|
// src/commands/init.ts
|
|
2314
2314
|
import { basename, join as join24, relative as relative3, resolve } from "path";
|
|
2315
2315
|
import { confirm as confirm5, input as input5, select as select9 } from "@inquirer/prompts";
|
|
2316
|
-
import
|
|
2316
|
+
import boxen6 from "boxen";
|
|
2317
2317
|
|
|
2318
2318
|
// src/lib/add-team-pack-submodule-with-retry-on-network-fail.ts
|
|
2319
2319
|
import { spawnSync as spawnSync13 } from "child_process";
|
|
@@ -3201,6 +3201,42 @@ function linkExistingRemoteToWorkspace(args) {
|
|
|
3201
3201
|
return { sshUrl, httpsUrl };
|
|
3202
3202
|
}
|
|
3203
3203
|
|
|
3204
|
+
// src/lib/format-pack-commands-cheatsheet-box.ts
|
|
3205
|
+
import boxen4 from "boxen";
|
|
3206
|
+
var PACK_COMMAND_CHEATSHEET = [
|
|
3207
|
+
{ cmd: "/avatar:help", desc: "H\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng Avatar \u2014 ch\u1EC9 c\u1EA7n g\xF5 t\u1EF1 nhi\xEAn" },
|
|
3208
|
+
{ cmd: "/avatar:brainstorm", desc: "Brainstorm \xFD t\u01B0\u1EDFng cho m\u1ED9t feature" },
|
|
3209
|
+
{ cmd: "/avatar:plan", desc: "T\u1EA1o plan th\xF4ng minh v\u1EDBi prompt enhancement" },
|
|
3210
|
+
{ cmd: "/avatar:scout", desc: "T\xECm file li\xEAn quan trong codebase, ti\u1EBFt ki\u1EC7m token" },
|
|
3211
|
+
{ cmd: "/avatar:implement", desc: "B\u1EAFt \u0111\u1EA7u code & test theo plan c\xF3 s\u1EB5n" },
|
|
3212
|
+
{ cmd: "/avatar:build-full-flow", desc: "Implement m\u1ED9t feature t\u1EEBng b\u01B0\u1EDBc (end-to-end)" },
|
|
3213
|
+
{ cmd: "/avatar:fix", desc: "Ph\xE2n t\xEDch v\xE0 fix v\u1EA5n \u0111\u1EC1 t\u1EF1 \u0111i\u1EC1u h\u01B0\u1EDBng" },
|
|
3214
|
+
{ cmd: "/avatar:debug", desc: "Debug v\u1EA5n \u0111\u1EC1 k\u1EF9 thu\u1EADt + \u0111\u01B0a ra gi\u1EA3i ph\xE1p" },
|
|
3215
|
+
{ cmd: "/avatar:test", desc: "Ch\u1EA1y test tr\xEAn m\xE1y + ph\xE2n t\xEDch b\xE1o c\xE1o t\u1ED5ng h\u1EE3p" },
|
|
3216
|
+
{ cmd: "/avatar:design:good", desc: "T\u1EA1o thi\u1EBFt k\u1EBF ch\u1EC9n chu, s\u1ED1ng \u0111\u1ED9ng" },
|
|
3217
|
+
{ cmd: "/avatar:docs:init", desc: "Ph\xE2n t\xEDch codebase + t\u1EA1o t\xE0i li\u1EC7u kh\u1EDFi \u0111\u1EA7u" },
|
|
3218
|
+
{ cmd: "/avatar:status", desc: "Xem l\u1EA1i thay \u0111\u1ED5i g\u1EA7n \u0111\xE2y + t\u1ED5ng k\u1EBFt c\xF4ng vi\u1EC7c" },
|
|
3219
|
+
{ cmd: "/avatar:journal", desc: "Ghi nh\u1EADt k\xFD session" }
|
|
3220
|
+
];
|
|
3221
|
+
function formatPackCommandsCheatsheetBox() {
|
|
3222
|
+
const maxCmdWidth = Math.max(...PACK_COMMAND_CHEATSHEET.map((e) => e.cmd.length));
|
|
3223
|
+
const header = chalk.bold("\u{1F3AF} Slash commands t\u1EEB team-ai-pack");
|
|
3224
|
+
const subheader = chalk.dim("G\xF5 trong Claude Code session \u0111\u1EC3 g\u1ECDi capability c\u1EE7a pack:");
|
|
3225
|
+
const lines = PACK_COMMAND_CHEATSHEET.map((e) => {
|
|
3226
|
+
const cmdPadded = chalk.cyan(e.cmd.padEnd(maxCmdWidth));
|
|
3227
|
+
return ` ${cmdPadded} ${chalk.dim(e.desc)}`;
|
|
3228
|
+
});
|
|
3229
|
+
const footer = chalk.dim(
|
|
3230
|
+
"Catalog \u0111\u1EA7y \u0111\u1EE7 46 commands: cat .claude/pack/scripts/commands_data.yaml"
|
|
3231
|
+
);
|
|
3232
|
+
const content = [header, subheader, "", ...lines, "", footer].join("\n");
|
|
3233
|
+
return boxen4(content, {
|
|
3234
|
+
padding: 1,
|
|
3235
|
+
borderStyle: "round",
|
|
3236
|
+
borderColor: "cyan"
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3204
3240
|
// src/lib/merge-pack-settings-into-project-settings.ts
|
|
3205
3241
|
import { promises as fs9 } from "fs";
|
|
3206
3242
|
import { join as join17 } from "path";
|
|
@@ -3761,7 +3797,7 @@ function buildScaffoldVariables(args) {
|
|
|
3761
3797
|
}
|
|
3762
3798
|
|
|
3763
3799
|
// src/commands/login.ts
|
|
3764
|
-
import
|
|
3800
|
+
import boxen5 from "boxen";
|
|
3765
3801
|
import open from "open";
|
|
3766
3802
|
|
|
3767
3803
|
// src/lib/google-oauth-device-flow.ts
|
|
@@ -3908,7 +3944,7 @@ async function runLogin(opts) {
|
|
|
3908
3944
|
"",
|
|
3909
3945
|
`Ho\u1EB7c Avatar t\u1EF1 m\u1EDF browser, click ${chalk.green("Allow")}...`
|
|
3910
3946
|
].join("\n");
|
|
3911
|
-
process.stdout.write(`${
|
|
3947
|
+
process.stdout.write(`${boxen5(instructions, { padding: 1, borderStyle: "round" })}
|
|
3912
3948
|
`);
|
|
3913
3949
|
void open(verificationUrl).catch(() => {
|
|
3914
3950
|
log.dim("(Kh\xF4ng m\u1EDF \u0111\u01B0\u1EE3c browser t\u1EF1 \u0111\u1ED9ng \u2014 copy URL \u1EDF tr\xEAn)");
|
|
@@ -4305,7 +4341,7 @@ async function finalizeWorkspaceScaffold(args) {
|
|
|
4305
4341
|
await writeRootClaudeMd(args.workspacePath, updatedVars);
|
|
4306
4342
|
log.dim("Updated CLAUDE.md v\u1EDBi GitNexus section");
|
|
4307
4343
|
}
|
|
4308
|
-
printInitSuccessBox(args.workspacePath, args.flow, aiResult, gitnexusResult);
|
|
4344
|
+
await printInitSuccessBox(args.workspacePath, args.flow, aiResult, gitnexusResult);
|
|
4309
4345
|
}
|
|
4310
4346
|
async function autoSyncPackOnInit(workspacePath) {
|
|
4311
4347
|
const packDir = join24(workspacePath, TEAM_PACK_RELATIVE_PATH);
|
|
@@ -4499,7 +4535,7 @@ function formatGitnexusStatusLine(result) {
|
|
|
4499
4535
|
}
|
|
4500
4536
|
return ` ${chalk.yellow("GitNexus:")} skipped (${(result.reason ?? "unknown").slice(0, 40)}) \xB7 th\u1EED ${chalk.cyan("avatar gitnexus install")}`;
|
|
4501
4537
|
}
|
|
4502
|
-
function printInitSuccessBox(rootPath, flow, aiResult = null, gitnexusResult = null) {
|
|
4538
|
+
async function printInitSuccessBox(rootPath, flow, aiResult = null, gitnexusResult = null) {
|
|
4503
4539
|
const lines = [
|
|
4504
4540
|
`${chalk.green("\u2713")} Workspace s\u1EB5n s\xE0ng: ${relative3(process.cwd(), rootPath) || rootPath}`,
|
|
4505
4541
|
` ${chalk.dim(`(flow: ${flow})`)}`,
|
|
@@ -4513,8 +4549,14 @@ function printInitSuccessBox(rootPath, flow, aiResult = null, gitnexusResult = n
|
|
|
4513
4549
|
` ${chalk.cyan("avatar sync")} Pull team-ai-pack m\u1EDBi`,
|
|
4514
4550
|
` ${chalk.cyan("avatar uninstall")} G\u1EE1 Avatar (gi\u1EEF code)`
|
|
4515
4551
|
];
|
|
4516
|
-
process.stdout.write(`${
|
|
4552
|
+
process.stdout.write(`${boxen6(lines.join("\n"), { padding: 1, borderStyle: "round" })}
|
|
4553
|
+
`);
|
|
4554
|
+
const packDir = join24(rootPath, TEAM_PACK_RELATIVE_PATH);
|
|
4555
|
+
if (await pathExists(packDir)) {
|
|
4556
|
+
process.stdout.write(`
|
|
4557
|
+
${formatPackCommandsCheatsheetBox()}
|
|
4517
4558
|
`);
|
|
4559
|
+
}
|
|
4518
4560
|
}
|
|
4519
4561
|
|
|
4520
4562
|
// src/lib/not-implemented-stub.ts
|
|
@@ -4566,7 +4608,7 @@ function registerSecretsCommand(program2) {
|
|
|
4566
4608
|
// src/commands/status.ts
|
|
4567
4609
|
import { promises as fs13 } from "fs";
|
|
4568
4610
|
import { join as join26 } from "path";
|
|
4569
|
-
import
|
|
4611
|
+
import boxen7 from "boxen";
|
|
4570
4612
|
|
|
4571
4613
|
// src/lib/pack-backup-manager.ts
|
|
4572
4614
|
import { promises as fs12 } from "fs";
|
|
@@ -4644,7 +4686,7 @@ function renderStatusBox(s) {
|
|
|
4644
4686
|
`${chalk.dim("Backups:")} ${s.backupCount}`,
|
|
4645
4687
|
`${chalk.dim("Tech stack:")} ${s.techStackSummary}`
|
|
4646
4688
|
];
|
|
4647
|
-
process.stdout.write(`${
|
|
4689
|
+
process.stdout.write(`${boxen7(lines.join("\n"), { padding: 1, borderStyle: "round" })}
|
|
4648
4690
|
`);
|
|
4649
4691
|
}
|
|
4650
4692
|
|
|
@@ -4836,7 +4878,7 @@ function registerToolsCommand(program2) {
|
|
|
4836
4878
|
// src/commands/uninstall.ts
|
|
4837
4879
|
import { relative as relative4 } from "path";
|
|
4838
4880
|
import { confirm as confirm6 } from "@inquirer/prompts";
|
|
4839
|
-
import
|
|
4881
|
+
import boxen8 from "boxen";
|
|
4840
4882
|
|
|
4841
4883
|
// src/lib/create-uninstall-backup-snapshot.ts
|
|
4842
4884
|
import { cp, mkdir, writeFile } from "fs/promises";
|
|
@@ -4990,7 +5032,7 @@ async function removeSubmoduleEntry(gitmodulesPath, submodulePath) {
|
|
|
4990
5032
|
}
|
|
4991
5033
|
|
|
4992
5034
|
// src/commands/uninstall.ts
|
|
4993
|
-
var CLI_VERSION = "1.
|
|
5035
|
+
var CLI_VERSION = "1.9.0";
|
|
4994
5036
|
function registerUninstallCommand(program2) {
|
|
4995
5037
|
program2.command("uninstall").description("G\u1EE1 Avatar kh\u1ECFi project \u2014 backup t\u1EF1 \u0111\u1ED9ng (M11)").option("--yes", "Skip confirm prompt").option("--no-backup", "Kh\xF4ng t\u1EA1o backup tr\u01B0\u1EDBc khi x\xF3a (nguy hi\u1EC3m)").option("--keep-submodule", "Gi\u1EEF submodule .claude/pack/").option("--keep-hooks", "Gi\u1EEF git hooks post-merge, pre-push").option("--dry-run", "Hi\u1EC3n th\u1ECB danh s\xE1ch s\u1EBD x\xF3a, kh\xF4ng th\u1EF1c thi").action(async (opts) => {
|
|
4996
5038
|
try {
|
|
@@ -5067,12 +5109,12 @@ function printUninstallSuccessBox(backupPath) {
|
|
|
5067
5109
|
lines.push(` ${chalk.dim("Backup:")} ${backupPath}`);
|
|
5068
5110
|
lines.push(` ${chalk.dim("Restore:")} ${chalk.cyan(`cp -r "${backupPath}"/* .`)}`);
|
|
5069
5111
|
}
|
|
5070
|
-
process.stdout.write(`${
|
|
5112
|
+
process.stdout.write(`${boxen8(lines.join("\n"), { padding: 1, borderStyle: "round" })}
|
|
5071
5113
|
`);
|
|
5072
5114
|
}
|
|
5073
5115
|
|
|
5074
5116
|
// src/index.ts
|
|
5075
|
-
var CLI_VERSION2 = "1.
|
|
5117
|
+
var CLI_VERSION2 = "1.9.0";
|
|
5076
5118
|
var program = new Command();
|
|
5077
5119
|
program.name("avatar").description("AI harness CLI for NAL Vietnam engineering").version(CLI_VERSION2, "-v, --version", "Hi\u1EC3n th\u1ECB phi\xEAn b\u1EA3n Avatar CLI").addHelpText(
|
|
5078
5120
|
"beforeAll",
|