@atlasauth/cli 0.6.0 → 0.7.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/CHANGELOG.md +8 -0
- package/README.md +5 -0
- package/dist/args.d.ts +6 -0
- package/dist/args.js +4 -0
- package/dist/args.js.map +1 -1
- package/dist/commands/actions-gallery.d.ts +8 -0
- package/dist/commands/actions-gallery.js +197 -0
- package/dist/commands/actions-gallery.js.map +1 -0
- package/dist/commands/actions.d.ts +2 -0
- package/dist/commands/actions.js +17 -2
- package/dist/commands/actions.js.map +1 -1
- package/dist/commands/info.d.ts +75 -0
- package/dist/commands/info.js +362 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/migrate.d.ts +12 -0
- package/dist/commands/migrate.js +65 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/context.d.ts +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +59 -2
- package/dist/help.js.map +1 -1
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlasauth/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 — 2026-10-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `atlas migrate code --from <clerk|authjs|supabase|auth0|better-auth> [path]`: rewrites an app's auth code onto Atlas. A dry run with a diff unless `--yes`; prints what needs a manual look with file and line, the packages to add and remove, and the env vars to set; `--json`.
|
|
8
|
+
- `atlas info [path]`: CLI, Node and OS versions, the framework and Atlas SDK packages with update-available from npm, the configured instance (key prefixes only) and whether the app's publishable key belongs to it, API reachability and latency, and the preflight summary; `--json`; secrets redacted.
|
|
9
|
+
- `atlas actions gallery | show | install | installs | update | publish`: the Actions gallery. Secret values come from `--secrets-file` (dotenv), never argv.
|
|
10
|
+
|
|
3
11
|
## 0.6.0 — 2026-10-23
|
|
4
12
|
|
|
5
13
|
### Added
|
package/README.md
CHANGED
|
@@ -48,6 +48,11 @@ atlas init --product <name> [--domain <d>] [--instance-env development|produ
|
|
|
48
48
|
atlas preflight [--instance <id> | --product <name>] [--fail-on error|warning]
|
|
49
49
|
atlas env --product <name> --format dotenv|coolify|vercel
|
|
50
50
|
atlas client rotate <client-id> [--now | --overlap <seconds>]
|
|
51
|
+
atlas import --from <vendor> <export-file> [--dry-run]
|
|
52
|
+
atlas migrate code --from <clerk|authjs|supabase|auth0|better-auth> [path] [--yes]
|
|
53
|
+
atlas info [path]
|
|
54
|
+
atlas actions list | deploy <file> | test <file> | gallery [query] | show <slug>
|
|
55
|
+
| install <slug> [--secrets-file f] | installs | update <id> | publish <template.json>
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
Every command takes `--json` for raw JSON (otherwise a human table). Paginated
|
package/dist/args.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ declare const OPTIONS: {
|
|
|
67
67
|
readonly trigger: {
|
|
68
68
|
readonly type: "string";
|
|
69
69
|
};
|
|
70
|
+
readonly 'secrets-file': {
|
|
71
|
+
readonly type: "string";
|
|
72
|
+
};
|
|
73
|
+
readonly draft: {
|
|
74
|
+
readonly type: "boolean";
|
|
75
|
+
};
|
|
70
76
|
readonly product: {
|
|
71
77
|
readonly type: "string";
|
|
72
78
|
};
|
package/dist/args.js
CHANGED
|
@@ -39,6 +39,10 @@ const OPTIONS = {
|
|
|
39
39
|
prune: { type: 'boolean' },
|
|
40
40
|
// actions.
|
|
41
41
|
trigger: { type: 'string' },
|
|
42
|
+
// actions install / update: secret values from a dotenv file, never argv.
|
|
43
|
+
'secrets-file': { type: 'string' },
|
|
44
|
+
// actions publish: keep the new version a draft instead of submitting it.
|
|
45
|
+
draft: { type: 'boolean' },
|
|
42
46
|
// init / preflight / env / client rotate.
|
|
43
47
|
product: { type: 'string' },
|
|
44
48
|
domain: { type: 'string' },
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;AAgHA,sBAeC;AAGD,kBAGC;AAGD,oBAOC;AAGD,sBAQC;AA1JD,yCAAsC;AACtC,qCAAoC;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,GAAG;IACd,UAAU;IACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,qDAAqD;IACrD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,gBAAgB;IAChB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,YAAY;IACZ,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,0BAA0B;IAC1B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,SAAS,EAAE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AM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,OAAO,GAAG;SACP,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,yFAAyF;AACzF,SAAgB,KAAK,CAAC,MAAc;IAClC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,iBAAQ,CAAC,4CAA4C,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ParsedArgs } from '../args';
|
|
2
|
+
import type { RunContext } from '../context';
|
|
3
|
+
export declare function gallery(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
4
|
+
export declare function show(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
5
|
+
export declare function install(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
6
|
+
export declare function installs(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
7
|
+
export declare function update(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
8
|
+
export declare function publish(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gallery = gallery;
|
|
4
|
+
exports.show = show;
|
|
5
|
+
exports.install = install;
|
|
6
|
+
exports.installs = installs;
|
|
7
|
+
exports.update = update;
|
|
8
|
+
exports.publish = publish;
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const args_1 = require("../args");
|
|
11
|
+
const errors_1 = require("../errors");
|
|
12
|
+
const output_1 = require("../output");
|
|
13
|
+
const secrets_1 = require("../secrets");
|
|
14
|
+
const shared_1 = require("./shared");
|
|
15
|
+
/**
|
|
16
|
+
* The gallery half of `atlas actions`:
|
|
17
|
+
*
|
|
18
|
+
* gallery [query] [--trigger t] browse first-party and community templates
|
|
19
|
+
* show <slug> a template's description, secrets and code
|
|
20
|
+
* install <slug> [--secrets-file f] install as a DISABLED action (secrets from a dotenv file)
|
|
21
|
+
* installs actions from the gallery, with update status
|
|
22
|
+
* update <action-id> [--secrets-file f]
|
|
23
|
+
* move an installed action to the latest version
|
|
24
|
+
* publish <template.json> [--draft] create or version your own template and submit it
|
|
25
|
+
*
|
|
26
|
+
* Secret VALUES come from a dotenv file, never from argv (shell history).
|
|
27
|
+
*/
|
|
28
|
+
const GALLERY_COLUMNS = [
|
|
29
|
+
{ header: 'SLUG', get: (t) => t.slug },
|
|
30
|
+
{ header: 'NAME', get: (t) => t.name },
|
|
31
|
+
{ header: 'TRIGGER', get: (t) => t.trigger },
|
|
32
|
+
{ header: 'BY', get: (t) => (t.author.first_party ? 'Atlas' : `${t.author.name}${t.verified ? ' ✓' : ''}`) },
|
|
33
|
+
{ header: 'VERSION', get: (t) => t.latest_version },
|
|
34
|
+
{ header: 'INSTALLS', get: (t) => t.install_count },
|
|
35
|
+
{ header: 'CALLS OUT', get: (t) => (t.uses_http ? 'yes' : '') },
|
|
36
|
+
];
|
|
37
|
+
const INSTALL_COLUMNS = [
|
|
38
|
+
{ header: 'ACTION', get: (i) => i.action_id },
|
|
39
|
+
{ header: 'NAME', get: (i) => i.action_name },
|
|
40
|
+
{ header: 'TEMPLATE', get: (i) => i.template_slug },
|
|
41
|
+
{ header: 'VERSION', get: (i) => i.installed_version },
|
|
42
|
+
{ header: 'LATEST', get: (i) => i.latest_version ?? 'removed' },
|
|
43
|
+
{ header: 'UPDATE', get: (i) => (i.update_available ? 'available' : '') },
|
|
44
|
+
{ header: 'ENABLED', get: (i) => i.enabled },
|
|
45
|
+
{ header: 'MISSING SECRETS', get: (i) => i.missing_secrets },
|
|
46
|
+
];
|
|
47
|
+
function secretsFrom(ctx, args) {
|
|
48
|
+
const file = (0, args_1.str)(args.values, 'secrets-file');
|
|
49
|
+
if (!file)
|
|
50
|
+
return undefined;
|
|
51
|
+
return (0, secrets_1.parseDotenv)(ctx.readFile(file));
|
|
52
|
+
}
|
|
53
|
+
async function gallery(ctx, args) {
|
|
54
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
55
|
+
const q = args.positionals.slice(2).join(' ').trim() || undefined;
|
|
56
|
+
const trigger = (0, args_1.str)(args.values, 'trigger');
|
|
57
|
+
const page = await client.actionGallery.list({ q, trigger });
|
|
58
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
59
|
+
(0, output_1.printJson)(ctx.io, page);
|
|
60
|
+
else {
|
|
61
|
+
ctx.io.out((0, output_1.renderTable)(GALLERY_COLUMNS, page.data));
|
|
62
|
+
ctx.io.out('');
|
|
63
|
+
ctx.io.out("Details: 'atlas actions show <slug>'. Install: 'atlas actions install <slug> [--secrets-file .env.action]'.");
|
|
64
|
+
}
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
async function show(ctx, args) {
|
|
68
|
+
const slug = (0, shared_1.requireArg)(args.positionals, 2, 'slug');
|
|
69
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
70
|
+
const t = await client.actionGallery.get(slug);
|
|
71
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
72
|
+
(0, output_1.printJson)(ctx.io, t);
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
ctx.io.out(`${t.name} (${t.slug} ${t.latest_version}, ${t.trigger})`);
|
|
76
|
+
ctx.io.out(`By ${t.author.first_party ? 'Atlas' : t.author.name}${t.verified && !t.author.first_party ? ' (verified)' : ''} · ${t.license} · ${t.install_count} install(s)`);
|
|
77
|
+
ctx.io.out('');
|
|
78
|
+
ctx.io.out(t.summary);
|
|
79
|
+
if (t.uses_http)
|
|
80
|
+
ctx.io.out('Sends outbound HTTPS requests (after the sign-in completes).');
|
|
81
|
+
ctx.io.out('');
|
|
82
|
+
ctx.io.out('Secrets:');
|
|
83
|
+
if (t.secrets.length === 0)
|
|
84
|
+
ctx.io.out(' (none)');
|
|
85
|
+
for (const s of t.secrets)
|
|
86
|
+
ctx.io.out(` ${s.name}${s.required ? ' (required)' : ''} ${s.description}`);
|
|
87
|
+
ctx.io.out('');
|
|
88
|
+
ctx.io.out('Code:');
|
|
89
|
+
ctx.io.out(t.code.replace(/^/gm, ' '));
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
async function install(ctx, args) {
|
|
93
|
+
const slug = (0, shared_1.requireArg)(args.positionals, 2, 'slug');
|
|
94
|
+
const secrets = secretsFrom(ctx, args);
|
|
95
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
96
|
+
const res = await client.actionGallery.install(slug, {
|
|
97
|
+
...((0, args_1.str)(args.values, 'name') ? { name: (0, args_1.str)(args.values, 'name') } : {}),
|
|
98
|
+
...(secrets ? { secrets } : {}),
|
|
99
|
+
});
|
|
100
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
101
|
+
(0, output_1.printJson)(ctx.io, res);
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
ctx.io.out(`Installed ${res.template.slug} ${res.template.version} as action ${res.action.id} (${res.action.name}), DISABLED.`);
|
|
105
|
+
if (res.missing_secrets.length > 0) {
|
|
106
|
+
ctx.io.out(`Still needs: ${res.missing_secrets.join(', ')}. Set them with 'atlas actions update ${res.action.id} --secrets-file <file>' or in the dashboard.`);
|
|
107
|
+
}
|
|
108
|
+
ctx.io.out(`Next: bind it to the ${res.action.trigger} flow and enable it (dashboard → Actions), after a dry run.`);
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
async function installs(ctx, args) {
|
|
112
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
113
|
+
const page = await client.actionGallery.installs();
|
|
114
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
115
|
+
(0, output_1.printJson)(ctx.io, page);
|
|
116
|
+
else
|
|
117
|
+
ctx.io.out((0, output_1.renderTable)(INSTALL_COLUMNS, page.data));
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
async function update(ctx, args) {
|
|
121
|
+
const id = (0, shared_1.requireArg)(args.positionals, 2, 'action-id');
|
|
122
|
+
const secrets = secretsFrom(ctx, args);
|
|
123
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
124
|
+
const res = await client.actionGallery.update(id, secrets ? { secrets } : {});
|
|
125
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
126
|
+
(0, output_1.printJson)(ctx.io, res);
|
|
127
|
+
else if (res.updated)
|
|
128
|
+
ctx.io.out(`Updated ${id} from ${res.from_version} to ${res.version}.`);
|
|
129
|
+
else
|
|
130
|
+
ctx.io.out(`${id} already runs the latest version (${res.version}).`);
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
async function publish(ctx, args) {
|
|
134
|
+
const file = (0, shared_1.requireArg)(args.positionals, 2, 'template.json');
|
|
135
|
+
let manifest;
|
|
136
|
+
try {
|
|
137
|
+
manifest = JSON.parse(ctx.readFile(file));
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
throw new errors_1.CliError(`${file} is not valid JSON (${err.message}).`);
|
|
141
|
+
}
|
|
142
|
+
for (const key of ['slug', 'name', 'trigger', 'version']) {
|
|
143
|
+
if (!manifest[key])
|
|
144
|
+
throw new errors_1.CliError(`${file} needs "${key}".`);
|
|
145
|
+
}
|
|
146
|
+
const code = manifest.code ?? (manifest.code_file ? ctx.readFile((0, node_path_1.resolve)((0, node_path_1.dirname)(file), manifest.code_file)) : undefined);
|
|
147
|
+
if (!code?.trim())
|
|
148
|
+
throw new errors_1.CliError(`${file} needs "code" or "code_file".`);
|
|
149
|
+
const submit = args.values.draft !== true;
|
|
150
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
151
|
+
const mine = await client.actionTemplates.list();
|
|
152
|
+
const existing = mine.data.find((t) => t.slug === manifest.slug);
|
|
153
|
+
const version = { version: manifest.version, code, secrets: manifest.secrets ?? [], changelog: manifest.changelog, submit };
|
|
154
|
+
let result;
|
|
155
|
+
if (existing) {
|
|
156
|
+
const listing = {
|
|
157
|
+
name: manifest.name,
|
|
158
|
+
summary: manifest.summary,
|
|
159
|
+
description: manifest.description,
|
|
160
|
+
category: manifest.category,
|
|
161
|
+
tags: manifest.tags,
|
|
162
|
+
license: manifest.license,
|
|
163
|
+
repository_url: manifest.repository_url,
|
|
164
|
+
...(manifest.author_name ? { author_name: manifest.author_name } : {}),
|
|
165
|
+
};
|
|
166
|
+
await client.actionTemplates.update(existing.id, listing);
|
|
167
|
+
result = await client.actionTemplates.addVersion(existing.id, version);
|
|
168
|
+
if (!(0, shared_1.wantsJson)(args.values))
|
|
169
|
+
ctx.io.out(`Added ${manifest.slug} ${manifest.version}${submit ? ' and submitted it for review' : ' as a draft'}.`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (!manifest.author_name)
|
|
173
|
+
throw new errors_1.CliError(`${file} needs "author_name" (shown as the author) for a new template.`);
|
|
174
|
+
const body = {
|
|
175
|
+
slug: manifest.slug,
|
|
176
|
+
name: manifest.name,
|
|
177
|
+
author_name: manifest.author_name,
|
|
178
|
+
trigger: manifest.trigger,
|
|
179
|
+
summary: manifest.summary,
|
|
180
|
+
description: manifest.description,
|
|
181
|
+
category: manifest.category,
|
|
182
|
+
tags: manifest.tags,
|
|
183
|
+
license: manifest.license,
|
|
184
|
+
repository_url: manifest.repository_url,
|
|
185
|
+
...version,
|
|
186
|
+
};
|
|
187
|
+
result = await client.actionTemplates.create(body);
|
|
188
|
+
if (!(0, shared_1.wantsJson)(args.values))
|
|
189
|
+
ctx.io.out(`Created ${manifest.slug} ${manifest.version}${submit ? ' and submitted it for review' : ' as a draft'}.`);
|
|
190
|
+
}
|
|
191
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
192
|
+
(0, output_1.printJson)(ctx.io, result);
|
|
193
|
+
else if (submit)
|
|
194
|
+
ctx.io.out('It is listed in the gallery once approved; follow its status with --json or in the dashboard.');
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=actions-gallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-gallery.js","sourceRoot":"","sources":["../../src/commands/actions-gallery.ts"],"names":[],"mappings":";;AAwDA,0BAYC;AAED,oBAqBC;AAED,0BAkBC;AAED,4BAMC;AAED,wBASC;AAqBD,0BAuDC;AA9MD,yCAA6C;AAQ7C,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAgE;AAChE,wCAAyC;AACzC,qCAAgE;AAEhE;;;;;;;;;;;;GAYG;AAEH,MAAM,eAAe,GAAiC;IACpD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,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AAC,GAAG,CAAC,+FAA+F,CAAC,CAAC;IAC7H,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -7,5 +7,7 @@ import type { RunContext } from '../context';
|
|
|
7
7
|
* deploy <file> --trigger <t> upload a file's code as a new action
|
|
8
8
|
* test <file> [--trigger <t>] dry-run the file OFFLINE through @atlasauth/actions
|
|
9
9
|
* logs <id> where to find an action's execution history
|
|
10
|
+
* gallery | show | install | installs | update | publish
|
|
11
|
+
* the Actions gallery (see ./actions-gallery.ts)
|
|
10
12
|
*/
|
|
11
13
|
export declare function actions(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
package/dist/commands/actions.js
CHANGED
|
@@ -7,6 +7,7 @@ const args_1 = require("../args");
|
|
|
7
7
|
const errors_1 = require("../errors");
|
|
8
8
|
const output_1 = require("../output");
|
|
9
9
|
const shared_1 = require("./shared");
|
|
10
|
+
const actions_gallery_1 = require("./actions-gallery");
|
|
10
11
|
const COLUMNS = [
|
|
11
12
|
{ header: 'ID', get: (a) => a.id },
|
|
12
13
|
{ header: 'NAME', get: (a) => a.name },
|
|
@@ -32,6 +33,8 @@ function parseTrigger(raw) {
|
|
|
32
33
|
* deploy <file> --trigger <t> upload a file's code as a new action
|
|
33
34
|
* test <file> [--trigger <t>] dry-run the file OFFLINE through @atlasauth/actions
|
|
34
35
|
* logs <id> where to find an action's execution history
|
|
36
|
+
* gallery | show | install | installs | update | publish
|
|
37
|
+
* the Actions gallery (see ./actions-gallery.ts)
|
|
35
38
|
*/
|
|
36
39
|
async function actions(ctx, args) {
|
|
37
40
|
const sub = args.positionals[1];
|
|
@@ -111,10 +114,22 @@ async function actions(ctx, args) {
|
|
|
111
114
|
ctx.io.out(lines.join('\n'));
|
|
112
115
|
return 0;
|
|
113
116
|
}
|
|
117
|
+
case 'gallery':
|
|
118
|
+
return (0, actions_gallery_1.gallery)(ctx, args);
|
|
119
|
+
case 'show':
|
|
120
|
+
return (0, actions_gallery_1.show)(ctx, args);
|
|
121
|
+
case 'install':
|
|
122
|
+
return (0, actions_gallery_1.install)(ctx, args);
|
|
123
|
+
case 'installs':
|
|
124
|
+
return (0, actions_gallery_1.installs)(ctx, args);
|
|
125
|
+
case 'update':
|
|
126
|
+
return (0, actions_gallery_1.update)(ctx, args);
|
|
127
|
+
case 'publish':
|
|
128
|
+
return (0, actions_gallery_1.publish)(ctx, args);
|
|
114
129
|
default:
|
|
115
130
|
throw new errors_1.CliError(sub
|
|
116
|
-
? `Unknown subcommand 'actions ${sub}'. Try: list, deploy, test, logs.`
|
|
117
|
-
: 'actions needs a subcommand: list, deploy, test, logs.');
|
|
131
|
+
? `Unknown subcommand 'actions ${sub}'. Try: list, deploy, test, logs, gallery, show, install, installs, update, publish.`
|
|
132
|
+
: 'actions needs a subcommand: list, deploy, test, logs, gallery, show, install, installs, update, publish.');
|
|
118
133
|
}
|
|
119
134
|
}
|
|
120
135
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/commands/actions.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/commands/actions.ts"],"names":[],"mappings":";;AAwCA,0BAiGC;AAzID,yCAAqC;AAErC,gDAAiF;AACjF,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAyE;AACzE,qCAAgE;AAChE,uDAAsF;AAEtF,MAAM,OAAO,GAAqB;IAChC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;IAC5C,EAAE,MAAM,EAAE,SAA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,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,KAAK,SAAS;YACZ,OAAO,IAAA,yBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,IAAA,sBAAI,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzB,KAAK,SAAS;YACZ,OAAO,IAAA,yBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,KAAK,UAAU;YACb,OAAO,IAAA,0BAAQ,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,IAAA,wBAAM,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,IAAA,yBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE5B;YACE,MAAM,IAAI,iBAAQ,CAChB,GAAG;gBACD,CAAC,CAAC,+BAA+B,GAAG,sFAAsF;gBAC1H,CAAC,CAAC,0GAA0G,CAC/G,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ParsedArgs } from '../args';
|
|
2
|
+
import type { RunContext } from '../context';
|
|
3
|
+
export interface InfoPackage {
|
|
4
|
+
name: string;
|
|
5
|
+
wanted: string;
|
|
6
|
+
installed: string | null;
|
|
7
|
+
latest: string | null;
|
|
8
|
+
update_available: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface InfoReport {
|
|
11
|
+
object: 'atlas_info';
|
|
12
|
+
generated_at: string;
|
|
13
|
+
cli: {
|
|
14
|
+
version: string;
|
|
15
|
+
latest: string | null;
|
|
16
|
+
update_available: boolean;
|
|
17
|
+
};
|
|
18
|
+
runtime: {
|
|
19
|
+
node: string;
|
|
20
|
+
platform: string;
|
|
21
|
+
arch: string;
|
|
22
|
+
};
|
|
23
|
+
project: {
|
|
24
|
+
path: string;
|
|
25
|
+
name: string | null;
|
|
26
|
+
framework: {
|
|
27
|
+
name: string;
|
|
28
|
+
package: string;
|
|
29
|
+
version: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
packages: InfoPackage[];
|
|
32
|
+
};
|
|
33
|
+
instance: {
|
|
34
|
+
configured: boolean;
|
|
35
|
+
api_url: string | null;
|
|
36
|
+
key_source: string | null;
|
|
37
|
+
secret_key_prefix: string | null;
|
|
38
|
+
instance_id: string | null;
|
|
39
|
+
environment: string | null;
|
|
40
|
+
frontend_api_host: string | null;
|
|
41
|
+
publishable_key_prefix: string | null;
|
|
42
|
+
publishable_key_source: string | null;
|
|
43
|
+
publishable_key_matches_instance: boolean | null;
|
|
44
|
+
error: string | null;
|
|
45
|
+
};
|
|
46
|
+
api: {
|
|
47
|
+
reachable: boolean;
|
|
48
|
+
health_status: number | null;
|
|
49
|
+
health_latency_ms: number | null;
|
|
50
|
+
instance_latency_ms: number | null;
|
|
51
|
+
error: string | null;
|
|
52
|
+
};
|
|
53
|
+
preflight: {
|
|
54
|
+
ran: boolean;
|
|
55
|
+
ok: boolean | null;
|
|
56
|
+
errors: number;
|
|
57
|
+
warnings: number;
|
|
58
|
+
info: number;
|
|
59
|
+
findings: Array<{
|
|
60
|
+
severity: string;
|
|
61
|
+
code: string;
|
|
62
|
+
}>;
|
|
63
|
+
error: string | null;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** `sk_live_abc…` → `sk_live_`; anything else → its first 3 chars. */
|
|
67
|
+
export declare function keyPrefix(key: string): string;
|
|
68
|
+
/** Mask anything that looks like an Atlas (or other bearer) secret in free text. */
|
|
69
|
+
export declare function redactSecrets(text: string): string;
|
|
70
|
+
/** Dotted-number compare that tolerates prerelease tags (`1.2.0-rc.1` < `1.2.0`). */
|
|
71
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
72
|
+
export declare function info(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
73
|
+
export declare function collectInfo(ctx: RunContext, args: ParsedArgs): Promise<InfoReport>;
|
|
74
|
+
/** The human block: aligned, copyable, nothing secret. */
|
|
75
|
+
export declare function renderInfo(r: InfoReport): string[];
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keyPrefix = keyPrefix;
|
|
4
|
+
exports.redactSecrets = redactSecrets;
|
|
5
|
+
exports.compareVersions = compareVersions;
|
|
6
|
+
exports.info = info;
|
|
7
|
+
exports.collectInfo = collectInfo;
|
|
8
|
+
exports.renderInfo = renderInfo;
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const backend_1 = require("@atlasauth/backend");
|
|
11
|
+
const project_1 = require("../project");
|
|
12
|
+
const secrets_1 = require("../secrets");
|
|
13
|
+
const version_1 = require("../version");
|
|
14
|
+
const project_commands_1 = require("./project-commands");
|
|
15
|
+
const shared_1 = require("./shared");
|
|
16
|
+
/**
|
|
17
|
+
* `atlas info` — the environment in one copyable block, for support tickets and
|
|
18
|
+
* "works on my machine" debugging:
|
|
19
|
+
*
|
|
20
|
+
* - CLI, Node and OS versions;
|
|
21
|
+
* - the detected framework and every Atlas SDK package in the project, with the
|
|
22
|
+
* installed version and "update available" from the npm registry;
|
|
23
|
+
* - the configured instance — key PREFIXES only (`sk_live_`, `pk_test_`), never a
|
|
24
|
+
* key — whether the app's publishable key belongs to that instance, the API
|
|
25
|
+
* URL, reachability and latency;
|
|
26
|
+
* - the instance's preflight summary.
|
|
27
|
+
*
|
|
28
|
+
* Every network step is best-effort with a short timeout: `atlas info` reports a
|
|
29
|
+
* failure as data instead of failing, because it is what you run when things are
|
|
30
|
+
* broken. A final redaction pass masks anything shaped like a secret.
|
|
31
|
+
*/
|
|
32
|
+
const NPM_REGISTRY = 'https://registry.npmjs.org';
|
|
33
|
+
const TIMEOUT_MS = 5_000;
|
|
34
|
+
/** Frameworks, in detection priority (the first one present wins as "framework"). */
|
|
35
|
+
const FRAMEWORKS = [
|
|
36
|
+
['next', 'Next.js'],
|
|
37
|
+
['@remix-run/react', 'Remix'],
|
|
38
|
+
['@react-router/dev', 'React Router'],
|
|
39
|
+
['@tanstack/react-start', 'TanStack Start'],
|
|
40
|
+
['nuxt', 'Nuxt'],
|
|
41
|
+
['@sveltejs/kit', 'SvelteKit'],
|
|
42
|
+
['astro', 'Astro'],
|
|
43
|
+
['gatsby', 'Gatsby'],
|
|
44
|
+
['@builder.io/qwik-city', 'Qwik City'],
|
|
45
|
+
['@angular/core', 'Angular'],
|
|
46
|
+
['expo', 'Expo'],
|
|
47
|
+
['react-native', 'React Native'],
|
|
48
|
+
['electron', 'Electron'],
|
|
49
|
+
['@nestjs/core', 'NestJS'],
|
|
50
|
+
['hono', 'Hono'],
|
|
51
|
+
['fastify', 'Fastify'],
|
|
52
|
+
['express', 'Express'],
|
|
53
|
+
['solid-js', 'Solid'],
|
|
54
|
+
['vue', 'Vue'],
|
|
55
|
+
['vite', 'Vite'],
|
|
56
|
+
['react', 'React'],
|
|
57
|
+
];
|
|
58
|
+
const PUBLISHABLE_ENV = ['ATLAS_PUBLISHABLE_KEY', 'NEXT_PUBLIC_ATLAS_PUBLISHABLE_KEY', 'VITE_ATLAS_PUBLISHABLE_KEY', 'REACT_APP_ATLAS_PUBLISHABLE_KEY', 'PUBLIC_ATLAS_PUBLISHABLE_KEY', 'EXPO_PUBLIC_ATLAS_PUBLISHABLE_KEY'];
|
|
59
|
+
const ENV_FILES = ['.env', '.env.local', '.env.development', '.env.development.local'];
|
|
60
|
+
/** `sk_live_abc…` → `sk_live_`; anything else → its first 3 chars. */
|
|
61
|
+
function keyPrefix(key) {
|
|
62
|
+
const m = /^([a-z]+_(?:live|test)_)/.exec(key) ?? /^([a-z]+_)/.exec(key);
|
|
63
|
+
return m ? m[1] : `${key.slice(0, 3)}…`;
|
|
64
|
+
}
|
|
65
|
+
/** Mask anything that looks like an Atlas (or other bearer) secret in free text. */
|
|
66
|
+
function redactSecrets(text) {
|
|
67
|
+
return text.replace(/\b((?:sk|psk|rk|whsec|ak|fck|cft)_(?:(?:live|test)_)?)[A-Za-z0-9_-]{6,}/g, '$1[redacted]');
|
|
68
|
+
}
|
|
69
|
+
/** Dotted-number compare that tolerates prerelease tags (`1.2.0-rc.1` < `1.2.0`). */
|
|
70
|
+
function compareVersions(a, b) {
|
|
71
|
+
const parse = (v) => {
|
|
72
|
+
const [core = '', pre] = v.replace(/^[^\d]*/, '').split('-', 2);
|
|
73
|
+
return { nums: core.split('.').map((n) => Number.parseInt(n, 10) || 0), pre };
|
|
74
|
+
};
|
|
75
|
+
const x = parse(a);
|
|
76
|
+
const y = parse(b);
|
|
77
|
+
for (let i = 0; i < Math.max(x.nums.length, y.nums.length); i++) {
|
|
78
|
+
const d = (x.nums[i] ?? 0) - (y.nums[i] ?? 0);
|
|
79
|
+
if (d !== 0)
|
|
80
|
+
return d > 0 ? 1 : -1;
|
|
81
|
+
}
|
|
82
|
+
if (x.pre && !y.pre)
|
|
83
|
+
return -1;
|
|
84
|
+
if (!x.pre && y.pre)
|
|
85
|
+
return 1;
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
function isAtlasPackage(name) {
|
|
89
|
+
return name.startsWith('@atlasauth/') || name === 'gatsby-plugin-atlasauth';
|
|
90
|
+
}
|
|
91
|
+
function errorText(err) {
|
|
92
|
+
if (err instanceof backend_1.AtlasApiError)
|
|
93
|
+
return `HTTP ${err.status}${err.code ? ` ${err.code}` : ''}: ${err.message}`;
|
|
94
|
+
if (err instanceof Error)
|
|
95
|
+
return err.name === 'AbortError' || err.name === 'TimeoutError' ? `timed out after ${TIMEOUT_MS} ms` : err.message;
|
|
96
|
+
return String(err);
|
|
97
|
+
}
|
|
98
|
+
async function withTimeout(run) {
|
|
99
|
+
const controller = new AbortController();
|
|
100
|
+
let timer;
|
|
101
|
+
const expired = new Promise((_, reject) => {
|
|
102
|
+
timer = setTimeout(() => {
|
|
103
|
+
controller.abort();
|
|
104
|
+
const err = new Error(`timed out after ${TIMEOUT_MS} ms`);
|
|
105
|
+
err.name = 'TimeoutError';
|
|
106
|
+
reject(err);
|
|
107
|
+
}, TIMEOUT_MS);
|
|
108
|
+
});
|
|
109
|
+
try {
|
|
110
|
+
return await Promise.race([run(controller.signal), expired]);
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
clearTimeout(timer);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function info(ctx, args) {
|
|
117
|
+
const report = await collectInfo(ctx, args);
|
|
118
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
119
|
+
// Redact the serialized form too: belt and braces over every free-text field.
|
|
120
|
+
ctx.io.out(redactSecrets(JSON.stringify(report, null, 2)));
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
for (const line of renderInfo(report))
|
|
124
|
+
ctx.io.out(redactSecrets(line));
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
async function collectInfo(ctx, args) {
|
|
128
|
+
const fetchImpl = ctx.fetch ?? globalThis.fetch;
|
|
129
|
+
const projectDir = (0, node_path_1.resolve)(args.positionals[1] ?? process.cwd());
|
|
130
|
+
const readJson = (path) => {
|
|
131
|
+
try {
|
|
132
|
+
return JSON.parse(ctx.readFile(path));
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const pkg = readJson((0, node_path_1.join)(projectDir, 'package.json'));
|
|
139
|
+
const deps = {
|
|
140
|
+
...(pkg?.dependencies ?? {}),
|
|
141
|
+
...(pkg?.devDependencies ?? {}),
|
|
142
|
+
};
|
|
143
|
+
const installedVersion = (name) => {
|
|
144
|
+
const v = readJson((0, node_path_1.join)(projectDir, 'node_modules', ...name.split('/'), 'package.json'))?.version;
|
|
145
|
+
return typeof v === 'string' ? v : null;
|
|
146
|
+
};
|
|
147
|
+
const latestOf = async (name) => {
|
|
148
|
+
if (typeof fetchImpl !== 'function')
|
|
149
|
+
return null;
|
|
150
|
+
try {
|
|
151
|
+
return await withTimeout(async (signal) => {
|
|
152
|
+
const res = await fetchImpl(`${NPM_REGISTRY}/${name.replace('/', '%2F')}/latest`, {
|
|
153
|
+
headers: { accept: 'application/json' },
|
|
154
|
+
signal,
|
|
155
|
+
});
|
|
156
|
+
if (!res.ok)
|
|
157
|
+
return null;
|
|
158
|
+
const body = (await res.json());
|
|
159
|
+
return typeof body.version === 'string' ? body.version : null;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const atlasNames = Object.keys(deps).filter(isAtlasPackage).sort();
|
|
167
|
+
const cliVersion = (0, version_1.getVersion)();
|
|
168
|
+
const [cliLatest, ...latest] = await Promise.all([latestOf('@atlasauth/cli'), ...atlasNames.map(latestOf)]);
|
|
169
|
+
const packages = atlasNames.map((name, i) => {
|
|
170
|
+
const installed = installedVersion(name);
|
|
171
|
+
const newest = latest[i] ?? null;
|
|
172
|
+
const current = installed ?? deps[name];
|
|
173
|
+
return {
|
|
174
|
+
name,
|
|
175
|
+
wanted: deps[name],
|
|
176
|
+
installed,
|
|
177
|
+
latest: newest,
|
|
178
|
+
update_available: Boolean(newest && /\d/.test(current) && compareVersions(current, newest) < 0),
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
const fw = FRAMEWORKS.find(([name]) => deps[name] !== undefined);
|
|
182
|
+
const framework = fw ? { name: fw[1], package: fw[0], version: installedVersion(fw[0]) ?? deps[fw[0]] ?? null } : null;
|
|
183
|
+
// Publishable key: the process env first, then the project's .env files.
|
|
184
|
+
let publishable = null;
|
|
185
|
+
for (const name of PUBLISHABLE_ENV) {
|
|
186
|
+
const v = ctx.env[name]?.trim();
|
|
187
|
+
if (v) {
|
|
188
|
+
publishable = { key: v, source: `env ${name}` };
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (!publishable) {
|
|
193
|
+
outer: for (const file of ENV_FILES) {
|
|
194
|
+
const vars = (0, secrets_1.readEnvFile)((0, node_path_1.join)(projectDir, file));
|
|
195
|
+
for (const name of PUBLISHABLE_ENV) {
|
|
196
|
+
const v = vars?.[name]?.trim();
|
|
197
|
+
if (v) {
|
|
198
|
+
publishable = { key: v, source: `${file} ${name}` };
|
|
199
|
+
break outer;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const report = {
|
|
205
|
+
object: 'atlas_info',
|
|
206
|
+
generated_at: new Date().toISOString(),
|
|
207
|
+
cli: {
|
|
208
|
+
version: cliVersion,
|
|
209
|
+
latest: cliLatest ?? null,
|
|
210
|
+
update_available: Boolean(cliLatest && compareVersions(cliVersion, cliLatest) < 0),
|
|
211
|
+
},
|
|
212
|
+
runtime: { node: process.version, platform: process.platform, arch: process.arch },
|
|
213
|
+
project: { path: projectDir, name: typeof pkg?.name === 'string' ? pkg.name : null, framework, packages },
|
|
214
|
+
instance: {
|
|
215
|
+
configured: false,
|
|
216
|
+
api_url: null,
|
|
217
|
+
key_source: null,
|
|
218
|
+
secret_key_prefix: null,
|
|
219
|
+
instance_id: null,
|
|
220
|
+
environment: null,
|
|
221
|
+
frontend_api_host: null,
|
|
222
|
+
publishable_key_prefix: publishable ? keyPrefix(publishable.key) : null,
|
|
223
|
+
publishable_key_source: publishable?.source ?? null,
|
|
224
|
+
publishable_key_matches_instance: null,
|
|
225
|
+
error: null,
|
|
226
|
+
},
|
|
227
|
+
api: { reachable: false, health_status: null, health_latency_ms: null, instance_latency_ms: null, error: null },
|
|
228
|
+
preflight: { ran: false, ok: null, errors: 0, warnings: 0, info: 0, findings: [], error: null },
|
|
229
|
+
};
|
|
230
|
+
let cred = null;
|
|
231
|
+
try {
|
|
232
|
+
const resolved = (0, project_commands_1.instanceCredential)(ctx, args);
|
|
233
|
+
cred = { secretKey: resolved.secretKey, apiUrl: resolved.apiUrl };
|
|
234
|
+
report.instance.configured = true;
|
|
235
|
+
report.instance.api_url = resolved.apiUrl;
|
|
236
|
+
report.instance.secret_key_prefix = keyPrefix(resolved.secretKey);
|
|
237
|
+
report.instance.key_source = resolved.instance
|
|
238
|
+
? 'project manifest'
|
|
239
|
+
: ctx.env.ATLAS_SECRET_KEY?.trim()
|
|
240
|
+
? 'env ATLAS_SECRET_KEY'
|
|
241
|
+
: 'stored profile';
|
|
242
|
+
}
|
|
243
|
+
catch (err) {
|
|
244
|
+
report.instance.error = errorText(err);
|
|
245
|
+
report.instance.api_url = ctx.env.ATLAS_API_URL?.trim() || null;
|
|
246
|
+
}
|
|
247
|
+
// Reachability: the unauthenticated health endpoint, timed.
|
|
248
|
+
const apiUrl = (report.instance.api_url ?? 'https://atlasauth.net').replace(/\/+$/, '');
|
|
249
|
+
if (!report.instance.api_url)
|
|
250
|
+
report.instance.api_url = apiUrl;
|
|
251
|
+
if (typeof fetchImpl === 'function') {
|
|
252
|
+
const started = Date.now();
|
|
253
|
+
try {
|
|
254
|
+
const res = await withTimeout((signal) => fetchImpl(`${apiUrl}/v1/health`, { signal }));
|
|
255
|
+
report.api.health_status = res.status;
|
|
256
|
+
report.api.health_latency_ms = Date.now() - started;
|
|
257
|
+
report.api.reachable = res.status < 500;
|
|
258
|
+
}
|
|
259
|
+
catch (err) {
|
|
260
|
+
report.api.error = errorText(err);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (cred) {
|
|
264
|
+
const http = (0, project_1.httpFor)(ctx, cred);
|
|
265
|
+
const started = Date.now();
|
|
266
|
+
try {
|
|
267
|
+
const inst = await withTimeout(() => http.get('/v1/instance'));
|
|
268
|
+
report.api.instance_latency_ms = Date.now() - started;
|
|
269
|
+
report.api.reachable = true;
|
|
270
|
+
report.instance.instance_id = inst.id ?? null;
|
|
271
|
+
report.instance.environment = inst.environment ?? null;
|
|
272
|
+
report.instance.frontend_api_host = inst.frontend_api_host ?? null;
|
|
273
|
+
if (publishable) {
|
|
274
|
+
report.instance.publishable_key_matches_instance = inst.publishable_key
|
|
275
|
+
? inst.publishable_key === publishable.key
|
|
276
|
+
: (0, backend_1.instanceIdFromPublishableKey)(publishable.key) === inst.id;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
report.instance.error = errorText(err);
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
const pre = await withTimeout(() => http.get('/v1/instance/preflight'));
|
|
284
|
+
const findings = pre.findings ?? [];
|
|
285
|
+
report.preflight = {
|
|
286
|
+
ran: true,
|
|
287
|
+
ok: pre.ok ?? null,
|
|
288
|
+
errors: findings.filter((f) => f.severity === 'error').length,
|
|
289
|
+
warnings: findings.filter((f) => f.severity === 'warning').length,
|
|
290
|
+
info: findings.filter((f) => f.severity === 'info').length,
|
|
291
|
+
findings: findings.map((f) => ({ severity: f.severity, code: f.code })),
|
|
292
|
+
error: null,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
catch (err) {
|
|
296
|
+
report.preflight.error = errorText(err);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return report;
|
|
300
|
+
}
|
|
301
|
+
/** The human block: aligned, copyable, nothing secret. */
|
|
302
|
+
function renderInfo(r) {
|
|
303
|
+
const lines = [];
|
|
304
|
+
const row = (label, value) => lines.push(` ${label.padEnd(22)}${value}`);
|
|
305
|
+
const upd = (u, latest) => (u && latest ? ` (update available: ${latest})` : '');
|
|
306
|
+
lines.push('Atlas environment (safe to paste into a support ticket: no secrets)');
|
|
307
|
+
lines.push('');
|
|
308
|
+
lines.push('System');
|
|
309
|
+
row('atlas CLI', `${r.cli.version}${upd(r.cli.update_available, r.cli.latest)}`);
|
|
310
|
+
row('Node.js', r.runtime.node);
|
|
311
|
+
row('OS', `${r.runtime.platform} ${r.runtime.arch}`);
|
|
312
|
+
lines.push('');
|
|
313
|
+
lines.push('Project');
|
|
314
|
+
row('path', r.project.path);
|
|
315
|
+
if (r.project.name)
|
|
316
|
+
row('name', r.project.name);
|
|
317
|
+
row('framework', r.project.framework ? `${r.project.framework.name} ${r.project.framework.version ?? ''}`.trim() : 'not detected');
|
|
318
|
+
if (r.project.packages.length === 0)
|
|
319
|
+
row('Atlas packages', 'none in package.json');
|
|
320
|
+
for (const p of r.project.packages) {
|
|
321
|
+
row(p.name, `${p.installed ?? `${p.wanted} (not installed)`}${upd(p.update_available, p.latest)}`);
|
|
322
|
+
}
|
|
323
|
+
lines.push('');
|
|
324
|
+
lines.push('Instance');
|
|
325
|
+
if (!r.instance.configured)
|
|
326
|
+
row('credential', `not configured (${r.instance.error ?? 'no key'})`);
|
|
327
|
+
else {
|
|
328
|
+
row('secret key', `${r.instance.secret_key_prefix}… (${r.instance.key_source})`);
|
|
329
|
+
if (r.instance.instance_id)
|
|
330
|
+
row('instance', `${r.instance.instance_id} (${r.instance.environment ?? 'unknown'})`);
|
|
331
|
+
if (r.instance.frontend_api_host)
|
|
332
|
+
row('frontend API host', r.instance.frontend_api_host);
|
|
333
|
+
if (r.instance.error)
|
|
334
|
+
row('instance lookup', `failed: ${r.instance.error}`);
|
|
335
|
+
}
|
|
336
|
+
row('publishable key', r.instance.publishable_key_prefix
|
|
337
|
+
? `${r.instance.publishable_key_prefix}… (${r.instance.publishable_key_source})${r.instance.publishable_key_matches_instance === false
|
|
338
|
+
? ' MISMATCH: not this instance’s key'
|
|
339
|
+
: r.instance.publishable_key_matches_instance
|
|
340
|
+
? ' matches instance'
|
|
341
|
+
: ''}`
|
|
342
|
+
: 'not found in env or .env files');
|
|
343
|
+
lines.push('');
|
|
344
|
+
lines.push('API');
|
|
345
|
+
row('URL', r.instance.api_url ?? 'unknown');
|
|
346
|
+
row('reachable', r.api.reachable
|
|
347
|
+
? `yes (health ${r.api.health_status ?? '?'} in ${r.api.health_latency_ms ?? '?'} ms${r.api.instance_latency_ms !== null ? `, instance ${r.api.instance_latency_ms} ms` : ''})`
|
|
348
|
+
: `no${r.api.error ? ` (${r.api.error})` : r.api.health_status ? ` (health ${r.api.health_status})` : ''}`);
|
|
349
|
+
lines.push('');
|
|
350
|
+
lines.push('Preflight');
|
|
351
|
+
if (!r.preflight.ran)
|
|
352
|
+
row('status', r.preflight.error ? `failed: ${r.preflight.error}` : 'not run (no instance credential)');
|
|
353
|
+
else {
|
|
354
|
+
row('result', `${r.preflight.errors} error(s), ${r.preflight.warnings} warning(s), ${r.preflight.info} info`);
|
|
355
|
+
for (const f of r.preflight.findings.filter((x) => x.severity !== 'info'))
|
|
356
|
+
row(f.severity, f.code);
|
|
357
|
+
if (r.preflight.errors + r.preflight.warnings > 0)
|
|
358
|
+
lines.push(" Run 'atlas preflight' for the fixes.");
|
|
359
|
+
}
|
|
360
|
+
return lines;
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/commands/info.ts"],"names":[],"mappings":";;AA8GA,8BAGC;AAGD,sCAEC;AAGD,0CAcC;AA8BD,oBASC;AAED,kCAgLC;AAGD,gCA2DC;AA9ZD,yCAA0C;AAC1C,gDAAiF;AAIjF,wCAAqC;AACrC,wCAAyC;AACzC,wCAAwC;AACxC,yDAAwD;AACxD,qCAAqC;AAErC;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,YAAY,GAAG,4BAA4B,CAAC;AAClD,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,qFAAqF;AACrF,MAAM,UAAU,GAAgD;IAC9D,CAAC,MAAM,EAAE,SAAS,CAAC;IACnB,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAC7B,CAAC,mBAAmB,EAAE,cAAc,CAAC;IACrC,CAAC,uBAAuB,EAAE,gBAAgB,CAAC;IAC3C,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,eAAe,EAAE,WAAW,CAAC;IAC9B,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,QAAQ,EAAE,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AG,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC7G,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG;QAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC;SACxH,CAAC;QACJ,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,cAAc,CAAC,CAAC,SAAS,CAAC,QAAQ,gBAAgB,CAAC,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,CAAC;QAC9G,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC;YAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACnG,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ParsedArgs } from '../args';
|
|
2
|
+
import type { RunContext } from '../context';
|
|
3
|
+
/**
|
|
4
|
+
* `atlas migrate code --from <vendor> [path]` — rewrite an app's auth code onto
|
|
5
|
+
* Atlas (Clerk, Auth.js/NextAuth, Supabase Auth, Auth0, Better Auth).
|
|
6
|
+
*
|
|
7
|
+
* Safe by default: without `--yes` it is a dry run that prints the diff of every
|
|
8
|
+
* file it would change plus a report of what it could not rewrite (file:line).
|
|
9
|
+
* `--yes` writes the changes. Running it again over migrated code changes nothing.
|
|
10
|
+
* Users move separately, with `atlas import --from <vendor>`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function migrate(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrate = migrate;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const upgrade_1 = require("@atlasauth/upgrade");
|
|
7
|
+
const args_1 = require("../args");
|
|
8
|
+
const errors_1 = require("../errors");
|
|
9
|
+
const output_1 = require("../output");
|
|
10
|
+
const shared_1 = require("./shared");
|
|
11
|
+
/**
|
|
12
|
+
* `atlas migrate code --from <vendor> [path]` — rewrite an app's auth code onto
|
|
13
|
+
* Atlas (Clerk, Auth.js/NextAuth, Supabase Auth, Auth0, Better Auth).
|
|
14
|
+
*
|
|
15
|
+
* Safe by default: without `--yes` it is a dry run that prints the diff of every
|
|
16
|
+
* file it would change plus a report of what it could not rewrite (file:line).
|
|
17
|
+
* `--yes` writes the changes. Running it again over migrated code changes nothing.
|
|
18
|
+
* Users move separately, with `atlas import --from <vendor>`.
|
|
19
|
+
*/
|
|
20
|
+
async function migrate(ctx, args) {
|
|
21
|
+
const sub = args.positionals[1];
|
|
22
|
+
if (sub !== 'code') {
|
|
23
|
+
throw new errors_1.CliError(sub ? `Unknown subcommand 'migrate ${sub}'. Try: code.` : 'migrate needs a subcommand: code.');
|
|
24
|
+
}
|
|
25
|
+
const raw = (0, args_1.str)(args.values, 'from');
|
|
26
|
+
const vendor = (0, upgrade_1.resolveVendor)(raw);
|
|
27
|
+
if (!vendor) {
|
|
28
|
+
throw new errors_1.CliError(raw
|
|
29
|
+
? `Unknown --from '${raw}'. Use one of: ${upgrade_1.MIGRATE_VENDORS.join(', ')}.`
|
|
30
|
+
: `migrate code needs --from <${upgrade_1.MIGRATE_VENDORS.join('|')}>.`);
|
|
31
|
+
}
|
|
32
|
+
const target = (0, node_path_1.resolve)(args.positionals[2] ?? process.cwd());
|
|
33
|
+
if (!(0, node_fs_1.existsSync)(target))
|
|
34
|
+
throw new errors_1.CliError(`Path not found: ${target}`);
|
|
35
|
+
const write = args.values.yes === true && args.values['dry-run'] !== true;
|
|
36
|
+
const result = (0, upgrade_1.runMigration)(target, { from: vendor, write });
|
|
37
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
38
|
+
(0, output_1.printJson)(ctx.io, {
|
|
39
|
+
object: 'code_migration',
|
|
40
|
+
vendor: result.vendor,
|
|
41
|
+
written: write,
|
|
42
|
+
env_style: result.envStyle,
|
|
43
|
+
files_scanned: result.filesScanned,
|
|
44
|
+
files_changed: result.filesChanged,
|
|
45
|
+
rewrites: result.rewrites,
|
|
46
|
+
changes: result.changes.map((c) => ({ path: c.path, diff: (0, upgrade_1.unifiedDiff)(c.before, c.after, c.path) })),
|
|
47
|
+
manual: result.manual,
|
|
48
|
+
packages: result.packages,
|
|
49
|
+
env_to_set: result.envToSet,
|
|
50
|
+
});
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
for (const change of result.changes) {
|
|
54
|
+
if (write)
|
|
55
|
+
ctx.io.out(`updated ${change.path}`);
|
|
56
|
+
else {
|
|
57
|
+
ctx.io.out((0, upgrade_1.unifiedDiff)(change.before, change.after, change.path));
|
|
58
|
+
ctx.io.out('');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const line of (0, upgrade_1.formatMigration)(result, { written: write }))
|
|
62
|
+
ctx.io.out(line);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAA,yBAAe,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/context.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { type Prompter } from './prompt';
|
|
|
9
9
|
* enforces — that the command set maps only onto namespaces that really exist,
|
|
10
10
|
* and it keeps the fake a test injects small (five namespaces, not forty).
|
|
11
11
|
*/
|
|
12
|
-
export type ManagementClient = Pick<AtlasClient, 'users' | 'organizations' | 'apiKeys' | 'webhooks' | 'sessions' | 'actions'>;
|
|
12
|
+
export type ManagementClient = Pick<AtlasClient, 'users' | 'organizations' | 'apiKeys' | 'webhooks' | 'sessions' | 'actions' | 'actionGallery' | 'actionTemplates'>;
|
|
13
13
|
/**
|
|
14
14
|
* Everything a command touches the outside world through, in one injectable
|
|
15
15
|
* bag. Production wires the real IO/config/prompt/client; every test builds
|
package/dist/help.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* out of the handlers so the dispatch code stays about control flow and the
|
|
4
4
|
* copy can be read (and kept consistent) in one place.
|
|
5
5
|
*/
|
|
6
|
-
export declare const TOP_HELP = "atlas \u2014 manage an Atlas instance from the terminal\n\nUsage: atlas <command> [subcommand] [arguments] [options]\n\nCommands:\n login Authenticate and store a profile credential\n logout Remove a stored profile credential\n whoami Show the active profile and instance\n users list|get|create|delete\n orgs list|get|members\n api-keys list|create|revoke\n webhooks list|create\n sessions revoke\n config export|import Config-as-code: round-trip the instance's config\n actions list|deploy|test|logs\n init Create or complete an app's setup (idempotent); secrets to 0600 files\n preflight Check an instance's setup; non-zero exit on errors (for CI)\n env Print deploy variables: public values + secret file paths\n client rotate Rotate an OAuth client secret straight into its file\n referrals connect|backfill|status\n Connect a referral platform, backfill, check the connection\n import --from <vendor> <file>\n Move users from Auth0, Clerk, Supabase, Firebase, Cognito,\n Auth.js, WorkOS or Better Auth (resumable; --dry-run first)\n mcp install Add the Atlas MCP server (docs search) to Cursor, Claude Code,\n Codex or VS Code\n\nGlobal options:\n --profile <name> Use a named profile (default: active, else \"default\")\n --json Emit raw JSON instead of a human table\n --limit <n> Page size for list commands that paginate\n --starting-after <cursor> Pagination cursor (from a prior page's hint)\n -h, --help Show this help, or help for a command\n -v, --version Print the version\n\nEnvironment overrides:\n ATLAS_SECRET_KEY Secret key to use instead of the stored one\n ATLAS_API_URL API URL to use instead of the stored one\n ATLAS_PLATFORM_KEY Platform key (psk_) for atlas init\n REFERALLY_BASE_URL Referalli base URL for atlas referrals connect\n REFERALLY_API_KEY Referalli merchant key for atlas referrals connect (never stored)\n\nSecrets: a command that receives a secret writes it to a 0600 file under\n~/.config/<product>/ and prints only the path. --print-secret prints it instead.\n\nRun 'atlas <command> --help' for command-specific help.";
|
|
6
|
+
export declare const TOP_HELP = "atlas \u2014 manage an Atlas instance from the terminal\n\nUsage: atlas <command> [subcommand] [arguments] [options]\n\nCommands:\n login Authenticate and store a profile credential\n logout Remove a stored profile credential\n whoami Show the active profile and instance\n users list|get|create|delete\n orgs list|get|members\n api-keys list|create|revoke\n webhooks list|create\n sessions revoke\n config export|import Config-as-code: round-trip the instance's config\n actions list|deploy|test|logs|gallery|show|install|installs|update|publish\n init Create or complete an app's setup (idempotent); secrets to 0600 files\n preflight Check an instance's setup; non-zero exit on errors (for CI)\n env Print deploy variables: public values + secret file paths\n client rotate Rotate an OAuth client secret straight into its file\n referrals connect|backfill|status\n Connect a referral platform, backfill, check the connection\n import --from <vendor> <file>\n Move users from Auth0, Clerk, Supabase, Firebase, Cognito,\n Auth.js, WorkOS or Better Auth (resumable; --dry-run first)\n migrate code --from <vendor> [path]\n Rewrite an app's auth code onto Atlas (Clerk, Auth.js,\n Supabase, Auth0, Better Auth); a dry run with a diff unless --yes\n info [path] Print the environment for a support ticket (versions, SDKs,\n instance, API latency, preflight); secrets redacted\n mcp install Add the Atlas MCP server (docs search) to Cursor, Claude Code,\n Codex or VS Code\n\nGlobal options:\n --profile <name> Use a named profile (default: active, else \"default\")\n --json Emit raw JSON instead of a human table\n --limit <n> Page size for list commands that paginate\n --starting-after <cursor> Pagination cursor (from a prior page's hint)\n -h, --help Show this help, or help for a command\n -v, --version Print the version\n\nEnvironment overrides:\n ATLAS_SECRET_KEY Secret key to use instead of the stored one\n ATLAS_API_URL API URL to use instead of the stored one\n ATLAS_PLATFORM_KEY Platform key (psk_) for atlas init\n REFERALLY_BASE_URL Referalli base URL for atlas referrals connect\n REFERALLY_API_KEY Referalli merchant key for atlas referrals connect (never stored)\n\nSecrets: a command that receives a secret writes it to a 0600 file under\n~/.config/<product>/ and prints only the path. --print-secret prints it instead.\n\nRun 'atlas <command> --help' for command-specific help.";
|
|
7
7
|
/** Per-command help, keyed by the resource word. */
|
|
8
8
|
export declare const COMMAND_HELP: Record<string, string>;
|
package/dist/help.js
CHANGED
|
@@ -20,7 +20,7 @@ Commands:
|
|
|
20
20
|
webhooks list|create
|
|
21
21
|
sessions revoke
|
|
22
22
|
config export|import Config-as-code: round-trip the instance's config
|
|
23
|
-
actions list|deploy|test|logs
|
|
23
|
+
actions list|deploy|test|logs|gallery|show|install|installs|update|publish
|
|
24
24
|
init Create or complete an app's setup (idempotent); secrets to 0600 files
|
|
25
25
|
preflight Check an instance's setup; non-zero exit on errors (for CI)
|
|
26
26
|
env Print deploy variables: public values + secret file paths
|
|
@@ -30,6 +30,11 @@ Commands:
|
|
|
30
30
|
import --from <vendor> <file>
|
|
31
31
|
Move users from Auth0, Clerk, Supabase, Firebase, Cognito,
|
|
32
32
|
Auth.js, WorkOS or Better Auth (resumable; --dry-run first)
|
|
33
|
+
migrate code --from <vendor> [path]
|
|
34
|
+
Rewrite an app's auth code onto Atlas (Clerk, Auth.js,
|
|
35
|
+
Supabase, Auth0, Better Auth); a dry run with a diff unless --yes
|
|
36
|
+
info [path] Print the environment for a support ticket (versions, SDKs,
|
|
37
|
+
instance, API latency, preflight); secrets redacted
|
|
33
38
|
mcp install Add the Atlas MCP server (docs search) to Cursor, Claude Code,
|
|
34
39
|
Codex or VS Code
|
|
35
40
|
|
|
@@ -54,6 +59,43 @@ Secrets: a command that receives a secret writes it to a 0600 file under
|
|
|
54
59
|
Run 'atlas <command> --help' for command-specific help.`;
|
|
55
60
|
/** Per-command help, keyed by the resource word. */
|
|
56
61
|
exports.COMMAND_HELP = {
|
|
62
|
+
migrate: `atlas migrate code — rewrite an app's auth code onto Atlas
|
|
63
|
+
|
|
64
|
+
Usage:
|
|
65
|
+
atlas migrate code --from <vendor> [path] [--yes] [--json]
|
|
66
|
+
|
|
67
|
+
Vendors:
|
|
68
|
+
clerk @clerk/* SDKs
|
|
69
|
+
authjs Auth.js / NextAuth (next-auth v4 and v5, @auth/*)
|
|
70
|
+
supabase Supabase Auth (supabase.auth.*, auth-helpers, auth-ui); the
|
|
71
|
+
Supabase client itself stays for your database
|
|
72
|
+
auth0 @auth0/auth0-react, @auth0/nextjs-auth0 (v3 and v4), @auth0/auth0-spa-js
|
|
73
|
+
better-auth better-auth (client, server, Next.js handler, cookies)
|
|
74
|
+
|
|
75
|
+
What it rewrites: imports, providers, hooks, server session helpers, middleware,
|
|
76
|
+
sign-in/out calls and env var names, onto native Atlas APIs and the drop-in
|
|
77
|
+
compat helpers in @atlasauth/react/compat and @atlasauth/nextjs/compat that keep the
|
|
78
|
+
old shapes. Everything it cannot rewrite is listed with file:line and marked in
|
|
79
|
+
code with TODO(atlas-migrate).
|
|
80
|
+
|
|
81
|
+
Options:
|
|
82
|
+
--yes Write the changes (without it: a dry run printing the diff)
|
|
83
|
+
--dry-run Force a dry run even with --yes
|
|
84
|
+
--json Machine-readable result (diffs, report, packages, env)
|
|
85
|
+
|
|
86
|
+
Safe to re-run: migrated code is left as it is. Move your users with
|
|
87
|
+
'atlas import --from <vendor> <export-file>'.`,
|
|
88
|
+
info: `atlas info — the environment, for support tickets
|
|
89
|
+
|
|
90
|
+
Usage:
|
|
91
|
+
atlas info [path] [--json] [--product <name> | --instance <id>]
|
|
92
|
+
|
|
93
|
+
Prints the CLI, Node and OS versions; the project's framework and Atlas SDK
|
|
94
|
+
packages with the installed version and whether npm has a newer one; the
|
|
95
|
+
configured instance (key prefixes only, never a key) and whether the app's
|
|
96
|
+
publishable key belongs to it; API reachability and latency; and the
|
|
97
|
+
instance's preflight summary. Network steps time out after 5 s and are
|
|
98
|
+
reported, not fatal. Anything shaped like a secret is redacted.`,
|
|
57
99
|
import: `atlas import — move users from another auth provider
|
|
58
100
|
|
|
59
101
|
Usage:
|
|
@@ -258,9 +300,24 @@ Usage:
|
|
|
258
300
|
atlas actions test <file> [--trigger <t>] [--json]
|
|
259
301
|
atlas actions logs <action-id> [--json]
|
|
260
302
|
|
|
303
|
+
atlas actions gallery [query] [--trigger <t>] [--json]
|
|
304
|
+
atlas actions show <slug> [--json]
|
|
305
|
+
atlas actions install <slug> [--name <n>] [--secrets-file <dotenv>] [--json]
|
|
306
|
+
atlas actions installs [--json]
|
|
307
|
+
atlas actions update <action-id> [--secrets-file <dotenv>] [--json]
|
|
308
|
+
atlas actions publish <template.json> [--draft] [--json]
|
|
309
|
+
|
|
261
310
|
deploy uploads the file's code verbatim as a new action (created, not yet bound).
|
|
262
311
|
test runs the file OFFLINE through the @atlasauth/actions harness — no network,
|
|
263
312
|
no real users — and exits non-zero if the action throws. logs explains where an
|
|
264
|
-
action's execution history is recorded (Atlas has no live log-stream endpoint)
|
|
313
|
+
action's execution history is recorded (Atlas has no live log-stream endpoint).
|
|
314
|
+
|
|
315
|
+
The gallery: gallery lists first-party and community templates; install copies
|
|
316
|
+
one into the instance as a DISABLED, unbound action (secret values come from a
|
|
317
|
+
dotenv file, never argv); installs shows which actions came from the gallery
|
|
318
|
+
and whether a newer version exists; update moves one to the latest version.
|
|
319
|
+
publish reads a manifest {slug, name, author_name, summary, description,
|
|
320
|
+
category, tags, trigger, license, version, code_file, secrets, changelog},
|
|
321
|
+
creates the template or adds the version, and submits it for review.`,
|
|
265
322
|
};
|
|
266
323
|
//# sourceMappingURL=help.js.map
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEU,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAkDgC,CAAC;AAEzD,oDAAoD;AACvC,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;8CAyBmC;IAC5C,IAAI,EAAE;;;;;;;;;;gEAUwD;IAC9D,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;2EAyBiE;IACzE,GAAG,EAAE;;;;;;;;;;;;;;;+CAewC;IAC7C,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAmC4D;IAEvE,KAAK,EAAE;;;;;;mCAM0B;IAEjC,MAAM,EAAE;;uCAE6B;IAErC,MAAM,EAAE;;gDAEsC;IAE9C,KAAK,EAAE;;;;;;wCAM+B;IAEtC,IAAI,EAAE;;;;;uCAK+B;IAErC,UAAU,EAAE;;;;;;8CAMgC;IAE5C,QAAQ,EAAE;;;;;;0EAM8D;IAExE,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA4BiE;IAEvE,SAAS,EAAE;;;;;;oDAMuC;IAElD,GAAG,EAAE;;;;;;;qDAO8C;IAEnD,MAAM,EAAE;;;;;;;;wDAQ8C;IAEtD,QAAQ,EAAE;;;8CAGkC;IAE5C,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;8EAoBoE;IAC5E,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;qEA0B0D;CACpE,CAAC"}
|
package/dist/run.js
CHANGED
|
@@ -9,6 +9,8 @@ const auth_1 = require("./commands/auth");
|
|
|
9
9
|
const config_1 = require("./commands/config");
|
|
10
10
|
const init_1 = require("./commands/init");
|
|
11
11
|
const import_1 = require("./commands/import");
|
|
12
|
+
const info_1 = require("./commands/info");
|
|
13
|
+
const migrate_1 = require("./commands/migrate");
|
|
12
14
|
const mcp_1 = require("./commands/mcp");
|
|
13
15
|
const project_commands_1 = require("./commands/project-commands");
|
|
14
16
|
const orgs_1 = require("./commands/orgs");
|
|
@@ -37,6 +39,8 @@ const COMMANDS = {
|
|
|
37
39
|
client: project_commands_1.client,
|
|
38
40
|
referrals: referrals_1.referrals,
|
|
39
41
|
import: import_1.importUsers,
|
|
42
|
+
migrate: migrate_1.migrate,
|
|
43
|
+
info: info_1.info,
|
|
40
44
|
mcp: mcp_1.mcp,
|
|
41
45
|
};
|
|
42
46
|
/**
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;AAuDA,kBAwCC;AA/FD,gDAAmD;AACnD,iCAAgD;AAChD,gDAA6C;AAC7C,kDAA8C;AAC9C,0CAAwD;AACxD,8CAA2C;AAC3C,0CAAuC;AACvC,8CAAgD;AAChD,0CAAuC;AACvC,gDAA6C;AAC7C,wCAAqC;AACrC,kEAA4E;AAC5E,0CAAuC;AACvC,oDAAiD;AACjD,kDAA+C;AAC/C,4CAAyC;AACzC,kDAA+C;AAE/C,qCAAoC;AACpC,iCAAgD;AAChD,uCAAuC;AAKvC,kFAAkF;AAClF,MAAM,QAAQ,GAA4B;IACxC,KAAK,EAAL,YAA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C,EAAE,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "atlas — manage an Atlas instance from the terminal via the Backend API.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"atlas": "dist/cli.js"
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlasauth/
|
|
19
|
-
"@atlasauth/
|
|
18
|
+
"@atlasauth/backend": "0.16.0",
|
|
19
|
+
"@atlasauth/upgrade": "0.2.0",
|
|
20
|
+
"@atlasauth/actions": "0.3.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@types/node": "^22.9.0",
|