@powerformer/refly-cli 0.1.10 → 0.1.12
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/bin/refly.js +35 -39
- package/dist/bin/refly.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/refly.js
CHANGED
|
@@ -3060,11 +3060,21 @@ __export(paths_exports, {
|
|
|
3060
3060
|
getCacheDir: () => getCacheDir,
|
|
3061
3061
|
getClaudeCommandsDir: () => getClaudeCommandsDir,
|
|
3062
3062
|
getClaudeSkillDir: () => getClaudeSkillDir,
|
|
3063
|
+
getCliVersion: () => getCliVersion,
|
|
3063
3064
|
getConfigPath: () => getConfigPath,
|
|
3064
3065
|
getCurrentSessionPath: () => getCurrentSessionPath,
|
|
3065
3066
|
getReflyDir: () => getReflyDir,
|
|
3066
3067
|
getSessionPath: () => getSessionPath
|
|
3067
3068
|
});
|
|
3069
|
+
function getCliVersion() {
|
|
3070
|
+
try {
|
|
3071
|
+
const pkgPath = path.join(__dirname, "..", "..", "package.json");
|
|
3072
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
3073
|
+
return pkg.version || "0.1.0";
|
|
3074
|
+
} catch {
|
|
3075
|
+
return "0.1.0";
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3068
3078
|
function getReflyDir() {
|
|
3069
3079
|
const dir = path.join(os.homedir(), ".refly");
|
|
3070
3080
|
ensureDir(dir);
|
|
@@ -4040,55 +4050,42 @@ var OutputFormatter = class {
|
|
|
4040
4050
|
}
|
|
4041
4051
|
// === CLI Status Format (Phase 1: Charm-style cards) ===
|
|
4042
4052
|
outputStatusPretty(payload) {
|
|
4043
|
-
const { cli_version,
|
|
4053
|
+
const { cli_version, auth_status, user, skill } = payload;
|
|
4044
4054
|
const sym = this.useUnicode ? Symbols : AsciiSymbol;
|
|
4045
4055
|
console.log(`${sym.DIAMOND} ${UI.bold("Refly CLI")} v${cli_version || "?"}`);
|
|
4046
4056
|
console.log();
|
|
4047
4057
|
const authOk = auth_status === "valid";
|
|
4048
4058
|
const userObj = user;
|
|
4049
|
-
|
|
4059
|
+
let authText = "";
|
|
4050
4060
|
if (authOk && userObj?.email) {
|
|
4051
|
-
|
|
4061
|
+
authText = String(userObj.email);
|
|
4052
4062
|
} else if (auth_status === "expired") {
|
|
4053
|
-
|
|
4063
|
+
authText = "Token expired";
|
|
4054
4064
|
} else {
|
|
4055
|
-
|
|
4065
|
+
authText = "Not authenticated";
|
|
4056
4066
|
}
|
|
4057
|
-
console.log(
|
|
4058
|
-
UI.card({
|
|
4059
|
-
title: "Auth",
|
|
4060
|
-
status: authOk ? "success" : "error",
|
|
4061
|
-
lines: authLines,
|
|
4062
|
-
width: 45
|
|
4063
|
-
})
|
|
4064
|
-
);
|
|
4065
|
-
console.log();
|
|
4066
|
-
const endpoint = String(api_endpoint || "\u2014");
|
|
4067
|
-
console.log(
|
|
4068
|
-
UI.card({
|
|
4069
|
-
title: "Connection",
|
|
4070
|
-
status: authOk ? "success" : "pending",
|
|
4071
|
-
lines: [{ text: endpoint }],
|
|
4072
|
-
width: 45
|
|
4073
|
-
})
|
|
4074
|
-
);
|
|
4075
|
-
console.log();
|
|
4076
4067
|
const skillObj = skill;
|
|
4077
4068
|
const skillInstalled = skillObj?.installed === true;
|
|
4078
4069
|
const skillVersion = skillObj?.version ? `v${skillObj.version}` : "";
|
|
4079
4070
|
const skillUpToDate = skillObj?.up_to_date === true;
|
|
4080
|
-
|
|
4071
|
+
let skillText = "";
|
|
4081
4072
|
if (skillInstalled) {
|
|
4082
|
-
|
|
4083
|
-
skillLines.push({ text: versionText });
|
|
4073
|
+
skillText = skillVersion + (skillUpToDate ? " (up to date)" : " (update available)");
|
|
4084
4074
|
} else {
|
|
4085
|
-
|
|
4075
|
+
skillText = "Not installed";
|
|
4086
4076
|
}
|
|
4077
|
+
const authIcon = authOk ? styled(sym.SUCCESS, Style.TEXT_SUCCESS) : styled(sym.FAILURE, Style.TEXT_DANGER);
|
|
4078
|
+
const connIcon = authOk ? styled(sym.SUCCESS, Style.TEXT_SUCCESS) : styled(sym.PENDING, Style.TEXT_DIM);
|
|
4079
|
+
const skillIcon = skillInstalled ? styled(sym.SUCCESS, Style.TEXT_SUCCESS) : styled(sym.PENDING, Style.TEXT_DIM);
|
|
4080
|
+
const lines = [
|
|
4081
|
+
{ text: `${authIcon} Account ${authOk ? authText : authText}`, muted: !authOk },
|
|
4082
|
+
{ text: `${connIcon} Link https://refly.ai/` },
|
|
4083
|
+
{ text: `${skillIcon} Version ${skillText}`, muted: !skillInstalled }
|
|
4084
|
+
];
|
|
4087
4085
|
console.log(
|
|
4088
4086
|
UI.card({
|
|
4089
|
-
title: "
|
|
4090
|
-
|
|
4091
|
-
lines: skillLines,
|
|
4087
|
+
title: "Status",
|
|
4088
|
+
lines,
|
|
4092
4089
|
width: 45
|
|
4093
4090
|
})
|
|
4094
4091
|
);
|
|
@@ -8548,8 +8545,8 @@ var ConfigSchema = external_exports.object({
|
|
|
8548
8545
|
installedAt: external_exports.string().optional()
|
|
8549
8546
|
}).optional()
|
|
8550
8547
|
});
|
|
8551
|
-
var DEFAULT_API_ENDPOINT = "https://
|
|
8552
|
-
var DEFAULT_WEB_URL = "https://refly.
|
|
8548
|
+
var DEFAULT_API_ENDPOINT = "https://staging-api.refly.ai";
|
|
8549
|
+
var DEFAULT_WEB_URL = "https://staging.refly.ai";
|
|
8553
8550
|
var DEFAULT_CONFIG = {
|
|
8554
8551
|
version: 1,
|
|
8555
8552
|
api: {
|
|
@@ -9583,7 +9580,7 @@ async function verifyConnection() {
|
|
|
9583
9580
|
|
|
9584
9581
|
// src/commands/login.ts
|
|
9585
9582
|
init_logger();
|
|
9586
|
-
|
|
9583
|
+
init_paths();
|
|
9587
9584
|
var loginCommand = new Command("login").description("Authenticate with Refly").option("-k, --api-key <key>", "Authenticate using an API key").action(async (options) => {
|
|
9588
9585
|
try {
|
|
9589
9586
|
if (options.apiKey) {
|
|
@@ -9639,7 +9636,7 @@ async function loginWithDeviceFlow() {
|
|
|
9639
9636
|
const initResponse = await apiRequest("/v1/auth/cli/device/init", {
|
|
9640
9637
|
method: "POST",
|
|
9641
9638
|
body: {
|
|
9642
|
-
cliVersion:
|
|
9639
|
+
cliVersion: getCliVersion(),
|
|
9643
9640
|
host: hostname2
|
|
9644
9641
|
},
|
|
9645
9642
|
requireAuth: false
|
|
@@ -9679,7 +9676,7 @@ async function loginWithDeviceFlow() {
|
|
|
9679
9676
|
process.exit(1);
|
|
9680
9677
|
});
|
|
9681
9678
|
const webUrl = getWebUrl();
|
|
9682
|
-
const authUrl = `${webUrl}/cli/auth?device_id=${encodeURIComponent(deviceId)}&cli_version=${encodeURIComponent(
|
|
9679
|
+
const authUrl = `${webUrl}/cli/auth?device_id=${encodeURIComponent(deviceId)}&cli_version=${encodeURIComponent(getCliVersion())}&host=${encodeURIComponent(hostname2)}`;
|
|
9683
9680
|
process.stderr.write("\n");
|
|
9684
9681
|
process.stderr.write("To authorize this device, open the following URL in your browser:\n");
|
|
9685
9682
|
process.stderr.write("\n");
|
|
@@ -9834,7 +9831,7 @@ function println(message) {
|
|
|
9834
9831
|
}
|
|
9835
9832
|
|
|
9836
9833
|
// src/commands/init.ts
|
|
9837
|
-
var DEFAULT_API_ENDPOINT2 = "https://
|
|
9834
|
+
var DEFAULT_API_ENDPOINT2 = "https://staging-api.refly.ai";
|
|
9838
9835
|
var initCommand = new Command("init").description("Initialize Refly CLI, install skill files, and authenticate").option("--force", "Force reinstall even if already installed").option("--host <url>", "API server URL", DEFAULT_API_ENDPOINT2).option("--skip-login", "Skip automatic login after initialization").action(async (options) => {
|
|
9839
9836
|
try {
|
|
9840
9837
|
const { force, host, skipLogin } = options;
|
|
@@ -9993,7 +9990,6 @@ var logoutCommand = new Command("logout").description("Logout and remove stored
|
|
|
9993
9990
|
// src/commands/status.ts
|
|
9994
9991
|
init_cjs_shims();
|
|
9995
9992
|
init_paths();
|
|
9996
|
-
var CLI_VERSION2 = "0.1.0";
|
|
9997
9993
|
var statusCommand = new Command("status").description("Check CLI configuration and authentication status").action(async () => {
|
|
9998
9994
|
try {
|
|
9999
9995
|
loadConfig();
|
|
@@ -10020,7 +10016,7 @@ var statusCommand = new Command("status").description("Check CLI configuration a
|
|
|
10020
10016
|
}
|
|
10021
10017
|
}
|
|
10022
10018
|
const payload = {
|
|
10023
|
-
cli_version:
|
|
10019
|
+
cli_version: getCliVersion(),
|
|
10024
10020
|
config_dir: getReflyDir(),
|
|
10025
10021
|
api_endpoint: getApiEndpoint(),
|
|
10026
10022
|
auth_status: authStatus,
|