@myapihq/cli 1.0.75 → 1.0.79
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/commands/auth.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/domain.js +2 -2
- package/dist/commands/funnel.js +1 -1
- package/dist/commands/org.js +2 -2
- package/dist/commands/setup.js +2 -2
- package/dist/commands/update.js +2 -2
- package/dist/index.js +23 -9
- package/package.json +1 -1
package/dist/commands/auth.js
CHANGED
|
@@ -41,7 +41,7 @@ async function patch(path, body, apiKey) {
|
|
|
41
41
|
// myapi auth link — upgrade anonymous session to registered account.
|
|
42
42
|
export async function link(flags = {}, emailArg) {
|
|
43
43
|
if (flags.help) {
|
|
44
|
-
info('Usage: myapi auth link [email]\n\
|
|
44
|
+
info('Usage: myapi auth link [email]\n\nBehavior depends on whether the email is new or already registered:\n\n New email: Attaches it to your current anonymous account, upgrading it\n to a registered account. A one-time code is sent to confirm.\n\n Existing email: Does NOT merge accounts. The existing account is added as a\n second active session — your anonymous account stays separate.\n Switch between sessions with: myapi auth switch\n\nTo create a completely new account from scratch, use: myapi auth setup');
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const config = loadConfig();
|
package/dist/commands/config.js
CHANGED
|
@@ -35,7 +35,7 @@ export async function setFunnel(id, flags, via = 'auth config') {
|
|
|
35
35
|
}
|
|
36
36
|
export async function setDomain(domain, flags, via = 'auth config') {
|
|
37
37
|
if (!domain || flags.help) {
|
|
38
|
-
info(`Usage: myapi ${via} set-domain <domain>\n\nSets the default domain used by domain commands when
|
|
38
|
+
info(`Usage: myapi ${via} set-domain <domain>\n\nSets the default domain used by domain commands when the domain argument is omitted.\n\nExample:\n myapi ${via} set-domain example.com`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const config = requireConfig();
|
package/dist/commands/domain.js
CHANGED
|
@@ -130,7 +130,7 @@ export async function run(subcommand, args, flags) {
|
|
|
130
130
|
}
|
|
131
131
|
if (flags.help) {
|
|
132
132
|
if (subcommand === 'list')
|
|
133
|
-
info('Usage: myapi domain list --org <id> [--filter=all|unassigned|org] [--json]\n\nLists
|
|
133
|
+
info('Usage: myapi domain list [--org <id>] [--filter=all|unassigned|org] [--json]\n\nLists registered domains. --org (or default org) is used to identify your account.\n\n --filter=all All domains owned by the account.\n --filter=unassigned Domains not yet assigned to any org.\n --filter=org (Default) Domains assigned to the specified org.\n --json Output raw JSON\n\nNote: --filter=all and --filter=unassigned are account-wide and do not filter by org;\nthe --org flag is only needed to authenticate the request.');
|
|
134
134
|
else if (subcommand === 'check')
|
|
135
135
|
info('Usage: myapi domain check <domain> --org <id> [--json]\n\nChecks if a domain name is available for registration.\n\nFlags:\n --json Output raw JSON');
|
|
136
136
|
else if (subcommand === 'register')
|
|
@@ -142,7 +142,7 @@ export async function run(subcommand, args, flags) {
|
|
|
142
142
|
else if (subcommand === 'status')
|
|
143
143
|
info('Usage: myapi domain status <domain> --org <id> [--json]\n\nGets the registration status of a domain.\n\nFlags:\n --json Output raw JSON');
|
|
144
144
|
else if (subcommand === 'settings')
|
|
145
|
-
info('Usage: myapi domain settings <domain> --org <id>\n\nGets the
|
|
145
|
+
info('Usage: myapi domain settings <domain> --org <id>\n\nGets the current edge/CDN settings for a domain (security level, browser check, cache).\nUse "myapi domain update-settings" to change them.');
|
|
146
146
|
else if (subcommand === 'update-settings')
|
|
147
147
|
info('Usage: myapi domain update-settings <domain> --org <id> [flags]\n\nUpdates edge/CDN settings for a domain.\n\nFlags:\n --security=<level> CDN security level. Controls bot/threat filtering.\n Values: essentially_off | low | medium | high | under_attack\n Default (if unset): medium\n --browser-check=<on|off> Enable or disable browser integrity challenge for suspicious traffic.\n Default: on\n --purge-cache Immediately clears the CDN cache for this domain.\n Use after deploying changes that are not yet visible.\n\nExample:\n myapi domain update-settings example.com --org <id> --security=high --purge-cache');
|
|
148
148
|
return;
|
package/dist/commands/funnel.js
CHANGED
|
@@ -14,7 +14,7 @@ export async function list(flags) {
|
|
|
14
14
|
}
|
|
15
15
|
const rows = funnels.map(f => ({
|
|
16
16
|
id: f.id,
|
|
17
|
-
preview_url: f.subdomain_url ||
|
|
17
|
+
preview_url: f.subdomain_url || '',
|
|
18
18
|
created_at: formatDate(f.created_at),
|
|
19
19
|
updated_at: formatDate(f.updated_at),
|
|
20
20
|
}));
|
package/dist/commands/org.js
CHANGED
|
@@ -65,7 +65,7 @@ export async function list(flags) {
|
|
|
65
65
|
}
|
|
66
66
|
const rows = orgs.map((o) => ({
|
|
67
67
|
id: o.id,
|
|
68
|
-
name: o.name,
|
|
68
|
+
name: o.id === config.default_org ? `${o.name} *` : o.name,
|
|
69
69
|
created_at: o.created_at ? formatDate(o.created_at) : '',
|
|
70
70
|
}));
|
|
71
71
|
printTable(rows);
|
|
@@ -110,7 +110,7 @@ export async function del(id, flags) {
|
|
|
110
110
|
}
|
|
111
111
|
export async function importOrg(args, flags) {
|
|
112
112
|
if (flags.help) {
|
|
113
|
-
info('Usage: myapi org
|
|
113
|
+
info('Usage: myapi org sync-brand <domain> --org <id>\n\nFetches an existing website and extracts brand signals (name, logo, description,\nbusiness sector) to enrich your organization profile automatically.\n\nThis does NOT register or transfer the domain — it only reads from the site.\nThe org must already exist before running this command.\n\nPrerequisite:\n myapi org create --name "My Brand" --yes\n\nExample:\n myapi org sync-brand example.com --org <id>');
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const config = requireConfig();
|
package/dist/commands/setup.js
CHANGED
|
@@ -98,8 +98,8 @@ async function anonymousFlow() {
|
|
|
98
98
|
// ---------------------------------------------------------------------------
|
|
99
99
|
// myapi auth import-key <key> — non-interactively import a raw API key.
|
|
100
100
|
export async function importKey(apiKey, flags) {
|
|
101
|
-
if (!apiKey) {
|
|
102
|
-
info('Usage: myapi auth import-key <api_key> [--install-skills] [--no-skills]');
|
|
101
|
+
if (flags.help || !apiKey) {
|
|
102
|
+
info('Usage: myapi auth import-key <api_key> [--install-skills] [--no-skills]\n\nImports an existing API key non-interactively. Use this in CI, Docker, or any\nenvironment where the interactive "myapi auth setup" flow is not practical.\n\nThe key is validated against the API before being saved. Your default org and\nfunnel are auto-detected from the account and written to the local config.\n\nFlags:\n --install-skills Also install the MyAPI skills pack for AI agents after importing\n --no-skills Skip skills installation even if previously installed\n\nExamples:\n myapi auth import-key hqlive_xxxxxxxxxxxxxxxxxxxx\n myapi auth import-key hqlive_xxxxxxxxxxxxxxxxxxxx --install-skills');
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
const auth = { Authorization: `Bearer ${apiKey}` };
|
package/dist/commands/update.js
CHANGED
|
@@ -33,12 +33,12 @@ async function isVersionInstallable(version) {
|
|
|
33
33
|
function npmInstallArgs(version) {
|
|
34
34
|
const npmCandidate = process.execPath.replace(/[/\\]node(\.exe)?$/, '/npm');
|
|
35
35
|
const bin = existsSync(npmCandidate) ? npmCandidate : 'npm';
|
|
36
|
-
const baseArgs = ['install', '-g', '--prefer-online', `@myapihq/cli@${version}`];
|
|
36
|
+
const baseArgs = ['install', '-g', '--prefer-online', '--silent', '--no-fund', `@myapihq/cli@${version}`];
|
|
37
37
|
try {
|
|
38
38
|
const self = process.argv[1];
|
|
39
39
|
const binDir = self.replace(/[/\\][^/\\]+$/, '');
|
|
40
40
|
const prefix = binDir.replace(/[/\\]bin$/, '');
|
|
41
|
-
return { bin, args: ['install', '-g', '--prefer-online', '--prefix', prefix, `@myapihq/cli@${version}`] };
|
|
41
|
+
return { bin, args: ['install', '-g', '--prefer-online', '--silent', '--no-fund', '--prefix', prefix, `@myapihq/cli@${version}`] };
|
|
42
42
|
}
|
|
43
43
|
catch {
|
|
44
44
|
return { bin, args: baseArgs };
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ async function main() {
|
|
|
93
93
|
await configCmd.run(restArgs[0], restArgs.slice(1), flags);
|
|
94
94
|
else if (subcommand === 'api-keys') {
|
|
95
95
|
if (flags.help && !restArgs[0]) {
|
|
96
|
-
info('Usage: myapi auth api-keys <subcommand>\n\nManage programmatic API keys for your account. API keys are used to authenticate\nrequests to the MyAPI SDK and REST API.\n\nSubcommands:\n list List all API keys with their IDs and creation dates\n create Create a new API key (the key value is shown once)\n revoke <id> Permanently revoke an API key by ID\n\nExamples:\n myapi auth api-keys list\n myapi auth api-keys create\n myapi auth api-keys revoke
|
|
96
|
+
info('Usage: myapi auth api-keys <subcommand>\n\nManage programmatic API keys for your account. API keys are used to authenticate\nrequests to the MyAPI SDK and REST API.\n\nSubcommands:\n list List all API keys with their IDs and creation dates\n create Create a new API key (the key value is shown once)\n revoke <id> Permanently revoke an API key by ID\n\nExamples:\n myapi auth api-keys list\n myapi auth api-keys create\n myapi auth api-keys revoke hqlive_xxxxxxxxxxxxxxxxxxxx');
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
if (!restArgs[0]) {
|
|
@@ -115,7 +115,7 @@ async function main() {
|
|
|
115
115
|
break;
|
|
116
116
|
case 'org':
|
|
117
117
|
if (!subcommand || (flags.help && !subcommand)) {
|
|
118
|
-
info('Usage: myapi org <subcommand>\n\nSubcommands:\n list
|
|
118
|
+
info('Usage: myapi org <subcommand>\n\nSubcommands:\n list List organizations\n create Create an organization (use --yes to auto-set it as your default org and funnel)\n get Get details of an organization\n delete Delete an organization\n sync-brand Sync brand info (name, logo, description) from an existing website into an org');
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
if (subcommand === 'list')
|
|
@@ -126,8 +126,12 @@ async function main() {
|
|
|
126
126
|
await orgCmd.get(restArgs[0], flags);
|
|
127
127
|
else if (subcommand === 'delete')
|
|
128
128
|
await orgCmd.del(restArgs[0], flags);
|
|
129
|
-
else if (subcommand === '
|
|
129
|
+
else if (subcommand === 'sync-brand')
|
|
130
130
|
await orgCmd.importOrg(restArgs, flags);
|
|
131
|
+
else if (subcommand === 'import') {
|
|
132
|
+
process.stderr.write('› Note: "org import" is deprecated — use "org sync-brand" instead.\n');
|
|
133
|
+
await orgCmd.importOrg(restArgs, flags);
|
|
134
|
+
}
|
|
131
135
|
else
|
|
132
136
|
printHelp();
|
|
133
137
|
break;
|
|
@@ -161,8 +165,8 @@ async function main() {
|
|
|
161
165
|
await authCmd.whoami(flags);
|
|
162
166
|
break;
|
|
163
167
|
case 'keys':
|
|
164
|
-
if (!subcommand || flags.help) {
|
|
165
|
-
info('Usage: myapi keys <subcommand>\n\nManage programmatic API keys for your account. API keys are used to authenticate\nrequests to the MyAPI SDK and REST API.\n\nSubcommands:\n list List all API keys with their IDs and creation dates\n create Create a new API key (the key value is shown once)\n revoke <id> Permanently revoke an API key by ID\n\nExamples:\n myapi keys list\n myapi keys create\n myapi keys revoke
|
|
168
|
+
if (!subcommand || (flags.help && !subcommand)) {
|
|
169
|
+
info('Usage: myapi keys <subcommand>\n\nManage programmatic API keys for your account. API keys are used to authenticate\nrequests to the MyAPI SDK and REST API.\n\nSubcommands:\n list List all API keys with their IDs and creation dates\n create Create a new API key (the key value is shown once)\n revoke <id> Permanently revoke an API key by ID\n\nExamples:\n myapi keys list\n myapi keys create\n myapi keys revoke hqlive_xxxxxxxxxxxxxxxxxxxx\n\nAlias for: myapi auth api-keys');
|
|
166
170
|
break;
|
|
167
171
|
}
|
|
168
172
|
if (subcommand === 'create')
|
|
@@ -184,12 +188,22 @@ async function main() {
|
|
|
184
188
|
success('› Skills installed.');
|
|
185
189
|
break;
|
|
186
190
|
case 'help':
|
|
187
|
-
if (subcommand)
|
|
191
|
+
if (subcommand === 'funnel')
|
|
192
|
+
await funnelCmd.run(undefined, [], { help: true });
|
|
193
|
+
else if (subcommand === 'domain')
|
|
194
|
+
await domainCmd.run(undefined, [], { help: true });
|
|
195
|
+
else if (subcommand === 'auth')
|
|
196
|
+
info('Usage: myapi auth <subcommand>\n\nSubcommands:\n setup Configure your account\n import-key Import an existing API key non-interactively\n whoami Show current account · supports --json\n link [email] Upgrade anonymous account to registered (or add a second session)\n switch [index] Switch active account by index or email\n config Manage CLI defaults (org, funnel, domain)\n install-skills Install or update the MyAPI skills pack for AI agents\n api-keys Manage API keys · list / create / revoke');
|
|
197
|
+
else if (subcommand === 'org')
|
|
198
|
+
info('Usage: myapi org <subcommand>\n\nSubcommands:\n list List organizations\n create Create an organization\n get Get details of an organization\n delete Delete an organization\n sync-brand Sync brand info from an existing website into an org');
|
|
199
|
+
else if (subcommand === 'billing')
|
|
200
|
+
info('Usage: myapi billing <subcommand>\n\nSubcommands:\n balance Check balance\n history View billing history\n topup Top up your balance\n setup Setup a payment method');
|
|
201
|
+
else if (subcommand === 'keys')
|
|
202
|
+
info('Usage: myapi keys <subcommand>\n\nSubcommands:\n list List all API keys\n create Create a new API key\n revoke <id> Revoke an API key\n\nAlias for: myapi auth api-keys');
|
|
203
|
+
else if (subcommand)
|
|
188
204
|
info(`Run: myapi ${subcommand} --help`);
|
|
189
|
-
|
|
190
|
-
else {
|
|
205
|
+
else
|
|
191
206
|
printHelp();
|
|
192
|
-
}
|
|
193
207
|
break;
|
|
194
208
|
default:
|
|
195
209
|
error(`Unknown command: ${command}. Run "myapi" for available commands.`);
|