@aidran/cli 0.1.0 → 0.4.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/README.md +25 -19
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -35
- package/dist/index.js.map +1 -1
- package/dist/logo.d.ts +18 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +51 -0
- package/dist/logo.js.map +1 -0
- package/dist/verify.js +1 -3
- package/dist/verify.js.map +1 -1
- package/dist/wizard.d.ts +9 -0
- package/dist/wizard.d.ts.map +1 -0
- package/dist/wizard.js +242 -0
- package/dist/wizard.js.map +1 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
# @aidran/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `aidran` binary — interactive setup wizard and non-interactive subcommands for the [AIDRAN](https://aidran.ai) discourse-intelligence platform.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
npm install -g @aidran/cli
|
|
9
|
+
# or: pnpm add -g @aidran/cli
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
After installing, run `aidran` (no args) to launch the interactive wizard.
|
|
13
|
+
|
|
14
|
+
Prefer to skip the global install? Use the convenience meta-package or `npx`:
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
```sh
|
|
17
|
+
npm install -g aidran # meta-package — also exports types and schemas
|
|
18
|
+
npx @aidran/cli # no install, one-off invocation
|
|
14
19
|
```
|
|
15
20
|
|
|
16
|
-
##
|
|
21
|
+
## Wizard
|
|
22
|
+
|
|
23
|
+
Running `aidran` with no arguments in a terminal launches an interactive wizard with the AIDRAN logo, a menu, and guided prompts. It can:
|
|
24
|
+
|
|
25
|
+
- Generate a secure random `AIDRAN_API_KEY`
|
|
26
|
+
- Write `.env`, `.env.example`, and `drizzle.config.ts`
|
|
27
|
+
- Apply migrations to your Postgres
|
|
28
|
+
- Verify the schema
|
|
29
|
+
|
|
30
|
+
## Commands (non-interactive)
|
|
17
31
|
|
|
18
32
|
```sh
|
|
19
33
|
aidran init # Write .env.example and drizzle.config.ts to cwd
|
|
@@ -22,21 +36,13 @@ aidran verify # Sanity-check the schema against $DATABASE_URL
|
|
|
22
36
|
aidran help # Show usage
|
|
23
37
|
```
|
|
24
38
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
mkdir my-aidran-project && cd my-aidran-project
|
|
29
|
-
npx @aidran/cli init # writes .env.example + drizzle.config.ts
|
|
30
|
-
cp .env.example .env # fill in DATABASE_URL
|
|
31
|
-
DATABASE_URL='postgres://...' npx @aidran/cli migrate
|
|
32
|
-
DATABASE_URL='postgres://...' npx @aidran/cli verify
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
After `migrate`, your Postgres has all the AIDRAN corpus tables (`records`, `stories`, `signals`, `topics`, etc.). You can then `import { records, stories } from '@aidran/db'` in your application and query them with full type safety via Drizzle.
|
|
39
|
+
These run directly without prompts — suitable for CI, scripts, or anyone who already knows what they want.
|
|
36
40
|
|
|
37
41
|
## What it ships
|
|
38
42
|
|
|
39
|
-
The package bundles the AIDRAN migrations folder (the same SQL the production system runs) and uses `drizzle-orm/node-postgres/migrator` to apply them. Idempotent — drizzle tracks applied migrations in a `drizzle.__drizzle_migrations` table.
|
|
43
|
+
The package bundles the AIDRAN migrations folder (the same SQL the production system runs, via the `@aidran/db` dependency) and uses `drizzle-orm/node-postgres/migrator` to apply them. Idempotent — drizzle tracks applied migrations in a `drizzle.__drizzle_migrations` table.
|
|
44
|
+
|
|
45
|
+
The interactive UI uses [`@clack/prompts`](https://www.npmjs.com/package/@clack/prompts) for the wizard and [`picocolors`](https://www.npmjs.com/package/picocolors) for terminal styling. Both detect non-TTY contexts automatically and degrade to plain output.
|
|
40
46
|
|
|
41
47
|
## Status
|
|
42
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @aidran/cli — entry point.
|
|
4
4
|
*
|
|
5
|
+
* Behavior matrix:
|
|
6
|
+
* `aidran` (TTY) → interactive wizard
|
|
7
|
+
* `aidran` (non-TTY) → prints help (so CI never hangs)
|
|
8
|
+
* `aidran <subcommand>` → direct execution, no wizard
|
|
9
|
+
*
|
|
5
10
|
* Subcommands:
|
|
6
|
-
*
|
|
7
|
-
* aidran
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* init Scaffold .env.example + drizzle.config.ts in cwd
|
|
12
|
+
* migrate Apply @aidran/db migrations to $DATABASE_URL
|
|
13
|
+
* verify Sanity-check the schema against $DATABASE_URL
|
|
14
|
+
* help Show usage
|
|
10
15
|
*/
|
|
11
16
|
export {};
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
|
package/dist/index.js
CHANGED
|
@@ -2,56 +2,75 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @aidran/cli — entry point.
|
|
4
4
|
*
|
|
5
|
+
* Behavior matrix:
|
|
6
|
+
* `aidran` (TTY) → interactive wizard
|
|
7
|
+
* `aidran` (non-TTY) → prints help (so CI never hangs)
|
|
8
|
+
* `aidran <subcommand>` → direct execution, no wizard
|
|
9
|
+
*
|
|
5
10
|
* Subcommands:
|
|
6
|
-
*
|
|
7
|
-
* aidran
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* init Scaffold .env.example + drizzle.config.ts in cwd
|
|
12
|
+
* migrate Apply @aidran/db migrations to $DATABASE_URL
|
|
13
|
+
* verify Sanity-check the schema against $DATABASE_URL
|
|
14
|
+
* help Show usage
|
|
10
15
|
*/
|
|
16
|
+
import pc from 'picocolors';
|
|
17
|
+
import { renderWordmark, renderLogoPlain } from './logo.js';
|
|
11
18
|
import { runMigrate } from './migrate.js';
|
|
12
19
|
import { runInit } from './init.js';
|
|
13
20
|
import { runVerify } from './verify.js';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
import { runWizard } from './wizard.js';
|
|
22
|
+
function buildHelp() {
|
|
23
|
+
return `${renderWordmark()}
|
|
24
|
+
${pc.bold('Usage:')}
|
|
25
|
+
${pc.cyan('aidran')} Launch interactive setup wizard (in a TTY)
|
|
26
|
+
${pc.cyan('aidran <command>')} Run a command directly
|
|
18
27
|
|
|
19
|
-
Commands:
|
|
20
|
-
init Scaffold .env.example and drizzle.config.ts in the current directory
|
|
21
|
-
migrate Apply @aidran/db migrations to the database at $DATABASE_URL
|
|
22
|
-
verify Confirm $DATABASE_URL is reachable and required tables exist
|
|
23
|
-
help Show this help text
|
|
28
|
+
${pc.bold('Commands:')}
|
|
29
|
+
${pc.cyan('init')} Scaffold .env.example and drizzle.config.ts in the current directory
|
|
30
|
+
${pc.cyan('migrate')} Apply @aidran/db migrations to the database at $DATABASE_URL
|
|
31
|
+
${pc.cyan('verify')} Confirm $DATABASE_URL is reachable and required tables exist
|
|
32
|
+
${pc.cyan('help')} Show this help text
|
|
24
33
|
|
|
25
|
-
Environment:
|
|
26
|
-
DATABASE_URL Postgres connection string used by 'migrate' and 'verify'
|
|
34
|
+
${pc.bold('Environment:')}
|
|
35
|
+
${pc.dim('DATABASE_URL')} Postgres connection string used by 'migrate' and 'verify'
|
|
36
|
+
${pc.dim('AIDRAN_API_KEY')} Bearer token used by the reference delivery API stub
|
|
27
37
|
`;
|
|
38
|
+
}
|
|
28
39
|
const [, , command] = process.argv;
|
|
29
|
-
const
|
|
40
|
+
const directCommands = {
|
|
30
41
|
init: runInit,
|
|
31
42
|
migrate: runMigrate,
|
|
32
43
|
verify: runVerify,
|
|
33
|
-
help: async () => {
|
|
34
|
-
process.stdout.write(HELP);
|
|
35
|
-
},
|
|
36
|
-
'--help': async () => {
|
|
37
|
-
process.stdout.write(HELP);
|
|
38
|
-
},
|
|
39
|
-
'-h': async () => {
|
|
40
|
-
process.stdout.write(HELP);
|
|
41
|
-
},
|
|
42
44
|
};
|
|
43
|
-
|
|
44
|
-
if
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
async function main() {
|
|
46
|
+
// No subcommand: launch wizard if interactive, otherwise print help.
|
|
47
|
+
if (!command) {
|
|
48
|
+
const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
49
|
+
if (interactive) {
|
|
50
|
+
await runWizard();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Non-TTY (CI, piped): plain logo + help so logs are scrubbed of ANSI.
|
|
54
|
+
process.stdout.write(renderLogoPlain());
|
|
55
|
+
process.stdout.write('\n');
|
|
56
|
+
process.stdout.write(buildHelp());
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (command === 'help' || command === '--help' || command === '-h') {
|
|
60
|
+
process.stdout.write(buildHelp());
|
|
61
|
+
return;
|
|
51
62
|
}
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
const handler = directCommands[command];
|
|
64
|
+
if (!handler) {
|
|
65
|
+
process.stderr.write(`aidran: unknown command '${command}'\n\n`);
|
|
66
|
+
process.stdout.write(buildHelp());
|
|
67
|
+
process.exit(1);
|
|
54
68
|
}
|
|
69
|
+
await handler();
|
|
70
|
+
}
|
|
71
|
+
main().catch((err) => {
|
|
72
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
73
|
+
process.stderr.write(`${pc.red('aidran:')} ${msg}\n`);
|
|
55
74
|
process.exit(1);
|
|
56
75
|
});
|
|
57
76
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,SAAS,SAAS;IAChB,OAAO,GAAG,cAAc,EAAE;EAC1B,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;IACf,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjB,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC;;EAE7B,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;IAClB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;IACf,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;IAClB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;EAEjB,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC;IACrB,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC;IACtB,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC;CAC3B,CAAC;AACF,CAAC;AAED,MAAM,CAAC,EAAE,AAAD,EAAG,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AAEnC,MAAM,cAAc,GAAwC;IAC1D,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,UAAU;IACnB,MA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AAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/logo.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIDRAN brand assets rendered as Unicode block-character ASCII art.
|
|
3
|
+
*
|
|
4
|
+
* Generated by chafa from the canonical icon-192.png and logo.png. Sizes
|
|
5
|
+
* are tuned to look clean at a standard 80-column terminal — re-running
|
|
6
|
+
* chafa with larger --size yields more detail at the cost of vertical
|
|
7
|
+
* real-estate.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Full composite: icon + wordmark + tagline, all in cyan.
|
|
11
|
+
* Used at the top of the wizard. ~18 lines total.
|
|
12
|
+
*/
|
|
13
|
+
export declare function renderLogo(): string;
|
|
14
|
+
/** Wordmark only — for compact contexts (help, footer). ~6 lines total. */
|
|
15
|
+
export declare function renderWordmark(): string;
|
|
16
|
+
/** Plain (no color) variant of the composite — for non-TTY contexts. */
|
|
17
|
+
export declare function renderLogoPlain(): string;
|
|
18
|
+
//# sourceMappingURL=logo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../src/logo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAInC;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED,wEAAwE;AACxE,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
package/dist/logo.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIDRAN brand assets rendered as Unicode block-character ASCII art.
|
|
3
|
+
*
|
|
4
|
+
* Generated by chafa from the canonical icon-192.png and logo.png. Sizes
|
|
5
|
+
* are tuned to look clean at a standard 80-column terminal — re-running
|
|
6
|
+
* chafa with larger --size yields more detail at the cost of vertical
|
|
7
|
+
* real-estate.
|
|
8
|
+
*/
|
|
9
|
+
import pc from 'picocolors';
|
|
10
|
+
/** A-mark icon, 12 content rows × 36 cols. */
|
|
11
|
+
const ICON_LINES = [
|
|
12
|
+
' ▟▇▇▇▇▇▇▇▇▇▇▇▇▙ ',
|
|
13
|
+
' ▗▟██████████████▙▖ ',
|
|
14
|
+
' ▗██████████████████▖ ',
|
|
15
|
+
' ▗████████████████████▖ ',
|
|
16
|
+
' ▟██████████▘▝██████████▙ ',
|
|
17
|
+
' ▟█████████▛ ▝██████████▙ ',
|
|
18
|
+
' ▗███████████▂▂▂▂▂▂███████████▖ ',
|
|
19
|
+
' ▗██████████████████████████████▖ ',
|
|
20
|
+
' ▄████████████████████████████████▄ ',
|
|
21
|
+
'▟██████████████████████████████████▙',
|
|
22
|
+
'██████████▘▔▔▔▔▔▔▔▔▔▔▔▔▔▔▝██████████',
|
|
23
|
+
'█████████▘ ▝█████████',
|
|
24
|
+
];
|
|
25
|
+
/** AIDRAN wordmark, 5 content rows × 80 cols. */
|
|
26
|
+
const WORDMARK_LINES = [
|
|
27
|
+
' ▅▆▆▆▄ ▆▆▆ ▗▆▆▆▆▆▆▆▆▅▃ ▕▆▆▆▆▆▆▆▆▅▃ ▗▆▆▆▆▖ ▕▆▆▆▄▁ ▆▆▆ ',
|
|
28
|
+
' ▗▟██▀██▙ ▐██▏▐██▀▀▀▀▀▜██▋▕██▛▀▀▀▀███▎ ▗██▛▜██▖ ▕█████▆▃ ███ ',
|
|
29
|
+
' ▗███▆▆███▙▖ ▐██▏▐██▃▃▃▃▃▟██▋▕████████▛▀ ▟███▆▆███▙ ▕██▋ ▀▜█████ ',
|
|
30
|
+
' ▕██▛▔▔▔▔▔▜██ ▐██ ▐███████▛▀▀ ▕██▌ ▝▀█▇▖ ▟██▀▔▔▔▔▀██▙▕██▋ ▔▀███ ',
|
|
31
|
+
];
|
|
32
|
+
const TAGLINE = 'discourse-intelligence platform';
|
|
33
|
+
/**
|
|
34
|
+
* Full composite: icon + wordmark + tagline, all in cyan.
|
|
35
|
+
* Used at the top of the wizard. ~18 lines total.
|
|
36
|
+
*/
|
|
37
|
+
export function renderLogo() {
|
|
38
|
+
const icon = ICON_LINES.map((line) => pc.cyan(line)).join('\n');
|
|
39
|
+
const word = WORDMARK_LINES.map((line) => pc.cyan(line)).join('\n');
|
|
40
|
+
return `\n${icon}\n\n${word}\n${pc.dim(` ${TAGLINE}`)}\n`;
|
|
41
|
+
}
|
|
42
|
+
/** Wordmark only — for compact contexts (help, footer). ~6 lines total. */
|
|
43
|
+
export function renderWordmark() {
|
|
44
|
+
const word = WORDMARK_LINES.map((line) => pc.cyan(line)).join('\n');
|
|
45
|
+
return `\n${word}\n${pc.dim(` ${TAGLINE}`)}\n`;
|
|
46
|
+
}
|
|
47
|
+
/** Plain (no color) variant of the composite — for non-TTY contexts. */
|
|
48
|
+
export function renderLogoPlain() {
|
|
49
|
+
return `\n${ICON_LINES.join('\n')}\n\n${WORDMARK_LINES.join('\n')}\n ${TAGLINE}\n`;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=logo.js.map
|
package/dist/logo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","sourceRoot":"","sources":["../src/logo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,8CAA8C;AAC9C,MAAM,UAAU,GAAG;IACjB,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;CAC9B,CAAC;AAEX,iDAAiD;AACjD,MAAM,cAAc,GAAG;IACrB,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;CAClE,CAAC;AAEX,MAAM,OAAO,GAAG,iCAAiC,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,KAAK,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,IAAI,CAAC;AACpE,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,cAAc;IAC5B,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,KAAK,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,IAAI,CAAC;AACzD,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,OAAO,IAAI,CAAC;AAC7F,CAAC"}
|
package/dist/verify.js
CHANGED
|
@@ -27,9 +27,7 @@ export async function runVerify() {
|
|
|
27
27
|
process.stdout.write(`aidran: connected to ${url.replace(/:[^:@]+@/, ':***@')}\n`);
|
|
28
28
|
process.stdout.write(`aidran: found ${found.size}/${EXPECTED_TABLES.length} expected tables\n`);
|
|
29
29
|
if (missing.length > 0) {
|
|
30
|
-
|
|
31
|
-
process.stdout.write("aidran: run 'aidran migrate' to apply schema\n");
|
|
32
|
-
process.exit(1);
|
|
30
|
+
throw new Error(`missing tables: ${missing.join(', ')} — run 'aidran migrate' to apply schema`);
|
|
33
31
|
}
|
|
34
32
|
process.stdout.write('aidran: schema looks healthy ✓\n');
|
|
35
33
|
}
|
package/dist/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,MAAM,eAAe,GAAG;IACtB,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,yBAAyB;CACjB,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACrC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAC/B;sEACgE,EAChE,CAAC,eAAe,CAAC,CAClB,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7D,O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AAM,CAAC,KAAK,CAAC,wBAAwB,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,KAAK,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,oBAAoB,CAAC,CAAC;QAEhG,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CACb,mBAAmB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAC/E,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC3D,CAAC;YAAS,CAAC;QACT,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/wizard.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive AIDRAN setup wizard. Launched automatically when the user runs
|
|
3
|
+
* `aidran` with no arguments in a TTY context. Composes @clack/prompts for
|
|
4
|
+
* the interactive bits with the existing runMigrate / runVerify / runInit
|
|
5
|
+
* command implementations so the wizard never diverges from non-interactive
|
|
6
|
+
* behavior.
|
|
7
|
+
*/
|
|
8
|
+
export declare function runWizard(): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoDH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAkC/C"}
|
package/dist/wizard.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive AIDRAN setup wizard. Launched automatically when the user runs
|
|
3
|
+
* `aidran` with no arguments in a TTY context. Composes @clack/prompts for
|
|
4
|
+
* the interactive bits with the existing runMigrate / runVerify / runInit
|
|
5
|
+
* command implementations so the wizard never diverges from non-interactive
|
|
6
|
+
* behavior.
|
|
7
|
+
*/
|
|
8
|
+
import { intro, outro, select, text, confirm, isCancel, cancel, spinner, note, log, } from '@clack/prompts';
|
|
9
|
+
import pc from 'picocolors';
|
|
10
|
+
import { randomBytes } from 'node:crypto';
|
|
11
|
+
import { writeFile, access } from 'node:fs/promises';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
import { renderLogo } from './logo.js';
|
|
14
|
+
import { runMigrate } from './migrate.js';
|
|
15
|
+
import { runVerify } from './verify.js';
|
|
16
|
+
const HELP_BODY = `Subcommands (all work non-interactively):
|
|
17
|
+
|
|
18
|
+
${pc.cyan('aidran init')} Scaffold .env.example + drizzle.config.ts
|
|
19
|
+
${pc.cyan('aidran migrate')} Apply @aidran/db migrations to $DATABASE_URL
|
|
20
|
+
${pc.cyan('aidran verify')} Confirm schema is healthy
|
|
21
|
+
${pc.cyan('aidran help')} This text
|
|
22
|
+
|
|
23
|
+
Environment:
|
|
24
|
+
${pc.dim('DATABASE_URL')} Postgres connection string (required for migrate/verify)
|
|
25
|
+
${pc.dim('AIDRAN_API_KEY')} Bearer token for the reference delivery API
|
|
26
|
+
`;
|
|
27
|
+
function bail() {
|
|
28
|
+
cancel('Cancelled.');
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
async function exists(path) {
|
|
32
|
+
try {
|
|
33
|
+
await access(path);
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function generateApiKey() {
|
|
41
|
+
return randomBytes(32).toString('base64url');
|
|
42
|
+
}
|
|
43
|
+
export async function runWizard() {
|
|
44
|
+
process.stdout.write(renderLogo());
|
|
45
|
+
intro(pc.bgCyan(pc.black(' AIDRAN ')));
|
|
46
|
+
const action = await select({
|
|
47
|
+
message: 'What would you like to do?',
|
|
48
|
+
options: [
|
|
49
|
+
{ value: 'init', label: 'Initialize', hint: 'scaffold config files in this directory' },
|
|
50
|
+
{ value: 'migrate', label: 'Migrate', hint: 'apply schema to your Postgres' },
|
|
51
|
+
{ value: 'verify', label: 'Verify', hint: 'check that the schema is healthy' },
|
|
52
|
+
{ value: 'help', label: 'Help', hint: 'show all subcommands' },
|
|
53
|
+
{ value: 'exit', label: 'Exit', hint: 'leave the wizard' },
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
if (isCancel(action))
|
|
57
|
+
bail();
|
|
58
|
+
switch (action) {
|
|
59
|
+
case 'init':
|
|
60
|
+
await initFlow();
|
|
61
|
+
break;
|
|
62
|
+
case 'migrate':
|
|
63
|
+
await migrateFlow();
|
|
64
|
+
break;
|
|
65
|
+
case 'verify':
|
|
66
|
+
await verifyFlow();
|
|
67
|
+
break;
|
|
68
|
+
case 'help':
|
|
69
|
+
note(HELP_BODY, 'Help');
|
|
70
|
+
outro(pc.dim('Run any subcommand directly to skip the wizard.'));
|
|
71
|
+
return;
|
|
72
|
+
case 'exit':
|
|
73
|
+
outro(pc.dim('See you next time.'));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function initFlow() {
|
|
78
|
+
const dbUrl = await text({
|
|
79
|
+
message: 'Postgres connection string (DATABASE_URL)',
|
|
80
|
+
placeholder: 'postgres://user:pass@host:5432/dbname',
|
|
81
|
+
initialValue: process.env.DATABASE_URL ?? 'postgres://aidran:aidran@localhost:5432/aidran',
|
|
82
|
+
validate: (value) => {
|
|
83
|
+
if (!value || value.trim().length === 0)
|
|
84
|
+
return 'Connection string is required.';
|
|
85
|
+
if (!value.startsWith('postgres://') && !value.startsWith('postgresql://')) {
|
|
86
|
+
return 'Must start with postgres:// or postgresql://';
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
if (isCancel(dbUrl))
|
|
92
|
+
bail();
|
|
93
|
+
const keyChoice = await select({
|
|
94
|
+
message: 'AIDRAN_API_KEY (bearer token for the reference delivery API)',
|
|
95
|
+
options: [
|
|
96
|
+
{ value: 'generate', label: 'Generate a secure random key', hint: 'recommended' },
|
|
97
|
+
{ value: 'enter', label: 'Enter my own key' },
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
if (isCancel(keyChoice))
|
|
101
|
+
bail();
|
|
102
|
+
let apiKey;
|
|
103
|
+
if (keyChoice === 'generate') {
|
|
104
|
+
apiKey = generateApiKey();
|
|
105
|
+
log.success(`Generated key: ${pc.cyan(apiKey.slice(0, 12))}${pc.dim('…')} (full value saved to .env)`);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const entered = await text({
|
|
109
|
+
message: 'Enter API key (min 16 chars)',
|
|
110
|
+
validate: (v) => (!v || v.length < 16 ? 'Key must be at least 16 characters.' : undefined),
|
|
111
|
+
});
|
|
112
|
+
if (isCancel(entered))
|
|
113
|
+
bail();
|
|
114
|
+
apiKey = entered;
|
|
115
|
+
}
|
|
116
|
+
const cwd = process.cwd();
|
|
117
|
+
const envPath = join(cwd, '.env');
|
|
118
|
+
const envExamplePath = join(cwd, '.env.example');
|
|
119
|
+
const drizzlePath = join(cwd, 'drizzle.config.ts');
|
|
120
|
+
if (await exists(envPath)) {
|
|
121
|
+
const overwrite = await confirm({
|
|
122
|
+
message: `.env already exists. Overwrite?`,
|
|
123
|
+
initialValue: false,
|
|
124
|
+
});
|
|
125
|
+
if (isCancel(overwrite) || !overwrite) {
|
|
126
|
+
log.warn('Skipping .env — keeping your existing values.');
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
await writeFile(envPath, `DATABASE_URL=${dbUrl}\nAIDRAN_API_KEY=${apiKey}\n`, 'utf8');
|
|
130
|
+
log.success(`Wrote ${pc.cyan('.env')}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
await writeFile(envPath, `DATABASE_URL=${dbUrl}\nAIDRAN_API_KEY=${apiKey}\n`, 'utf8');
|
|
135
|
+
log.success(`Wrote ${pc.cyan('.env')}`);
|
|
136
|
+
}
|
|
137
|
+
if (!(await exists(envExamplePath))) {
|
|
138
|
+
await writeFile(envExamplePath, `DATABASE_URL=postgres://aidran:aidran@localhost:5432/aidran\nAIDRAN_API_KEY=replace-me-with-a-long-random-string\n`, 'utf8');
|
|
139
|
+
log.success(`Wrote ${pc.cyan('.env.example')}`);
|
|
140
|
+
}
|
|
141
|
+
if (!(await exists(drizzlePath))) {
|
|
142
|
+
await writeFile(drizzlePath, `import { defineConfig } from 'drizzle-kit';\n\nexport default defineConfig({\n schema: './node_modules/@aidran/db/dist/schema/index.js',\n out: './migrations',\n dialect: 'postgresql',\n dbCredentials: { url: process.env.DATABASE_URL! },\n});\n`, 'utf8');
|
|
143
|
+
log.success(`Wrote ${pc.cyan('drizzle.config.ts')}`);
|
|
144
|
+
}
|
|
145
|
+
const migrateNow = await confirm({
|
|
146
|
+
message: 'Apply AIDRAN migrations to this database now?',
|
|
147
|
+
initialValue: true,
|
|
148
|
+
});
|
|
149
|
+
if (isCancel(migrateNow))
|
|
150
|
+
bail();
|
|
151
|
+
if (migrateNow) {
|
|
152
|
+
process.env.DATABASE_URL = dbUrl;
|
|
153
|
+
const s = spinner();
|
|
154
|
+
s.start('Applying migrations');
|
|
155
|
+
try {
|
|
156
|
+
await runMigrate();
|
|
157
|
+
s.stop('Migrations applied ✓');
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
s.stop(pc.red('Migration failed'));
|
|
161
|
+
log.error(err.message);
|
|
162
|
+
outro(pc.red('Setup incomplete — fix the error above and rerun.'));
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
const verifyNow = await confirm({
|
|
166
|
+
message: 'Run schema verification?',
|
|
167
|
+
initialValue: true,
|
|
168
|
+
});
|
|
169
|
+
if (isCancel(verifyNow))
|
|
170
|
+
bail();
|
|
171
|
+
if (verifyNow) {
|
|
172
|
+
const s2 = spinner();
|
|
173
|
+
s2.start('Verifying');
|
|
174
|
+
try {
|
|
175
|
+
await runVerify();
|
|
176
|
+
s2.stop('Schema healthy ✓');
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
s2.stop(pc.red('Verify failed'));
|
|
180
|
+
log.error(err.message);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
outro(pc.green('All set. Import @aidran/db in your code and start querying.'));
|
|
185
|
+
}
|
|
186
|
+
async function migrateFlow() {
|
|
187
|
+
let url = process.env.DATABASE_URL;
|
|
188
|
+
if (!url) {
|
|
189
|
+
const v = await text({
|
|
190
|
+
message: 'DATABASE_URL is not set. Enter Postgres connection string',
|
|
191
|
+
placeholder: 'postgres://user:pass@host:5432/dbname',
|
|
192
|
+
});
|
|
193
|
+
if (isCancel(v))
|
|
194
|
+
bail();
|
|
195
|
+
url = v;
|
|
196
|
+
process.env.DATABASE_URL = url;
|
|
197
|
+
}
|
|
198
|
+
const proceed = await confirm({
|
|
199
|
+
message: `Apply migrations to ${pc.cyan(url.replace(/:[^:@]+@/, ':***@'))}?`,
|
|
200
|
+
initialValue: true,
|
|
201
|
+
});
|
|
202
|
+
if (isCancel(proceed) || !proceed)
|
|
203
|
+
bail();
|
|
204
|
+
const s = spinner();
|
|
205
|
+
s.start('Applying migrations');
|
|
206
|
+
try {
|
|
207
|
+
await runMigrate();
|
|
208
|
+
s.stop('Migrations applied ✓');
|
|
209
|
+
outro(pc.green('Schema is up to date.'));
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
s.stop(pc.red('Migration failed'));
|
|
213
|
+
log.error(err.message);
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async function verifyFlow() {
|
|
218
|
+
let url = process.env.DATABASE_URL;
|
|
219
|
+
if (!url) {
|
|
220
|
+
const v = await text({
|
|
221
|
+
message: 'DATABASE_URL is not set. Enter Postgres connection string',
|
|
222
|
+
placeholder: 'postgres://user:pass@host:5432/dbname',
|
|
223
|
+
});
|
|
224
|
+
if (isCancel(v))
|
|
225
|
+
bail();
|
|
226
|
+
url = v;
|
|
227
|
+
process.env.DATABASE_URL = url;
|
|
228
|
+
}
|
|
229
|
+
const s = spinner();
|
|
230
|
+
s.start('Verifying schema');
|
|
231
|
+
try {
|
|
232
|
+
await runVerify();
|
|
233
|
+
s.stop('Schema healthy ✓');
|
|
234
|
+
outro(pc.green('Everything checks out.'));
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
s.stop(pc.red('Verification failed'));
|
|
238
|
+
log.error(err.message);
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,GAAG,GACJ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,SAAS,GAAG;;IAEd,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;IACtB,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACzB,EAAE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C,CAAC;QACnC,GAAG,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC;YACnB,OAAO,EAAE,2DAA2D;YACpE,WAAW,EAAE,uCAAuC;SACrD,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,CAAC,CAAC;YAAE,IAAI,EAAE,CAAC;QACxB,GAAG,GAAG,CAAW,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,SAAS,EAAE,CAAC;QAClB,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC3B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACtC,GAAG,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidran/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "AIDRAN — CLI for applying the @aidran/db migrations and scaffolding consumer projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aidran",
|
|
@@ -34,9 +34,11 @@
|
|
|
34
34
|
"NOTICE"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@clack/prompts": "^0.8.0",
|
|
37
38
|
"drizzle-orm": "^0.36.0",
|
|
38
39
|
"pg": "^8.13.0",
|
|
39
|
-
"
|
|
40
|
+
"picocolors": "^1.1.0",
|
|
41
|
+
"@aidran/db": "0.4.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@types/node": "^22.9.0",
|