@promptscript/cli 1.0.0-alpha.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/LICENSE +21 -0
- package/README.md +196 -0
- package/bin/prs.js +2 -0
- package/index.js +16492 -0
- package/package.json +39 -0
- package/package.publish.json +32 -0
- package/src/cli.d.ts +7 -0
- package/src/cli.d.ts.map +1 -0
- package/src/commands/check.d.ts +11 -0
- package/src/commands/check.d.ts.map +1 -0
- package/src/commands/compile.d.ts +6 -0
- package/src/commands/compile.d.ts.map +1 -0
- package/src/commands/diff.d.ts +6 -0
- package/src/commands/diff.d.ts.map +1 -0
- package/src/commands/index.d.ts +6 -0
- package/src/commands/index.d.ts.map +1 -0
- package/src/commands/init.d.ts +8 -0
- package/src/commands/init.d.ts.map +1 -0
- package/src/commands/pull.d.ts +8 -0
- package/src/commands/pull.d.ts.map +1 -0
- package/src/commands/validate.d.ts +6 -0
- package/src/commands/validate.d.ts.map +1 -0
- package/src/config/index.d.ts +2 -0
- package/src/config/index.d.ts.map +1 -0
- package/src/config/loader.d.ts +19 -0
- package/src/config/loader.d.ts.map +1 -0
- package/src/index.d.ts +20 -0
- package/src/index.d.ts.map +1 -0
- package/src/output/console.d.ts +108 -0
- package/src/output/console.d.ts.map +1 -0
- package/src/output/index.d.ts +3 -0
- package/src/output/index.d.ts.map +1 -0
- package/src/output/pager.d.ts +37 -0
- package/src/output/pager.d.ts.map +1 -0
- package/src/services.d.ts +25 -0
- package/src/services.d.ts.map +1 -0
- package/src/types.d.ts +83 -0
- package/src/types.d.ts.map +1 -0
- package/src/utils/ai-tools-detector.d.ts +32 -0
- package/src/utils/ai-tools-detector.d.ts.map +1 -0
- package/src/utils/project-detector.d.ts +34 -0
- package/src/utils/project-detector.d.ts.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@promptscript/cli",
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
|
+
"description": "CLI for PromptScript - The Infrastructure-as-Code for AI Context",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/mrwogu/promptscript.git",
|
|
8
|
+
"directory": "packages/cli"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./index.js",
|
|
15
|
+
"bin": {
|
|
16
|
+
"prs": "./bin/prs.js",
|
|
17
|
+
"promptscript": "./bin/prs.js"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@inquirer/prompts": "^8.2.0",
|
|
21
|
+
"chalk": "^5.6.2",
|
|
22
|
+
"chokidar": "^5.0.0",
|
|
23
|
+
"commander": "^14.0.2",
|
|
24
|
+
"ora": "^9.0.0",
|
|
25
|
+
"yaml": "^2.8.2"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"promptscript",
|
|
32
|
+
"ai",
|
|
33
|
+
"cli",
|
|
34
|
+
"copilot",
|
|
35
|
+
"claude",
|
|
36
|
+
"cursor"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT"
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@promptscript/cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "CLI for PromptScript - The Infrastructure-as-Code for AI Context",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/mrwogu/promptscript.git",
|
|
8
|
+
"directory": "packages/cli"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./index.js",
|
|
15
|
+
"bin": {
|
|
16
|
+
"prs": "./bin/prs.js",
|
|
17
|
+
"promptscript": "./bin/prs.js"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@inquirer/prompts": "^8.2.0",
|
|
21
|
+
"chalk": "^5.6.2",
|
|
22
|
+
"chokidar": "^5.0.0",
|
|
23
|
+
"commander": "^14.0.2",
|
|
24
|
+
"ora": "^9.0.0",
|
|
25
|
+
"yaml": "^2.8.2"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"keywords": ["promptscript", "ai", "cli", "copilot", "claude", "cursor"],
|
|
31
|
+
"license": "MIT"
|
|
32
|
+
}
|
package/src/cli.d.ts
ADDED
package/src/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/cli.ts"],"names":[],"mappings":";AAmGA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CheckOptions } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check configuration and dependencies health.
|
|
4
|
+
* Verifies:
|
|
5
|
+
* - Config file exists and is valid
|
|
6
|
+
* - Entry file exists
|
|
7
|
+
* - Registry path exists (if configured)
|
|
8
|
+
* - Inherit paths are resolvable (if configured)
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkCommand(_options: CheckOptions): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqKxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAuFlD;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/diff.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkG/C;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CliServices } from '../services.js';
|
|
2
|
+
import type { InitOptions } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize PromptScript in the current directory.
|
|
5
|
+
* Creates configuration file and initial project structure.
|
|
6
|
+
*/
|
|
7
|
+
export declare function initCommand(options: InitOptions, services?: CliServices): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAKzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAsB/C;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PullOptions } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pull updates from registry.
|
|
4
|
+
* Currently supports local registry path only.
|
|
5
|
+
* Remote registry support will be added in future versions.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pullCommand(options: PullOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=pull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/pull.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA0InD;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA4C7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PromptScriptConfig } from '@promptscript/core';
|
|
2
|
+
/**
|
|
3
|
+
* List of config file names to search for.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CONFIG_FILES: string[];
|
|
6
|
+
/**
|
|
7
|
+
* Find the config file in the current directory.
|
|
8
|
+
* @param customPath - Optional custom config file path.
|
|
9
|
+
* @returns The path to the config file, or null if not found.
|
|
10
|
+
*/
|
|
11
|
+
export declare function findConfigFile(customPath?: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Load the PromptScript configuration.
|
|
14
|
+
* @param customPath - Optional custom config file path.
|
|
15
|
+
* @returns The parsed configuration.
|
|
16
|
+
* @throws Error if no config file is found or parsing fails.
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadConfig(customPath?: string): Promise<PromptScriptConfig>;
|
|
19
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/config/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,YAAY,UAKxB,CAAC;AA6BF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmBjE;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqBjF"}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command-line interface for PromptScript.
|
|
3
|
+
*
|
|
4
|
+
* Compile, validate, and manage AI instructions at enterprise scale.
|
|
5
|
+
* main entry point for the CLI application.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { run } from './cli.js';
|
|
10
|
+
export { initCommand } from './commands/init.js';
|
|
11
|
+
export { compileCommand } from './commands/compile.js';
|
|
12
|
+
export { validateCommand } from './commands/validate.js';
|
|
13
|
+
export { pullCommand } from './commands/pull.js';
|
|
14
|
+
export { diffCommand } from './commands/diff.js';
|
|
15
|
+
export { checkCommand } from './commands/check.js';
|
|
16
|
+
export { loadConfig, findConfigFile, CONFIG_FILES } from './config/loader.js';
|
|
17
|
+
export { ConsoleOutput, createSpinner, LogLevel, setContext, getContext, isVerbose, isQuiet, } from './output/console.js';
|
|
18
|
+
export type { CLIContext } from './output/console.js';
|
|
19
|
+
export type { InitOptions, CompileOptions, ValidateOptions, PullOptions, DiffOptions, CheckOptions, } from './types.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,OAAO,GACR,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,YAAY,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type Ora } from 'ora';
|
|
2
|
+
/**
|
|
3
|
+
* Log level for controlling output verbosity.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum LogLevel {
|
|
6
|
+
/** Suppress all output except errors */
|
|
7
|
+
Quiet = 0,
|
|
8
|
+
/** Normal output (default) */
|
|
9
|
+
Normal = 1,
|
|
10
|
+
/** Verbose output with additional details */
|
|
11
|
+
Verbose = 2
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Global CLI context for sharing state across commands.
|
|
15
|
+
*/
|
|
16
|
+
export interface CLIContext {
|
|
17
|
+
/** Current log level */
|
|
18
|
+
logLevel: LogLevel;
|
|
19
|
+
/** Whether colors are enabled */
|
|
20
|
+
colors: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Set the global CLI context.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setContext(context: Partial<CLIContext>): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the current CLI context.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getContext(): CLIContext;
|
|
30
|
+
/**
|
|
31
|
+
* Check if verbose logging is enabled.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isVerbose(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Check if quiet mode is enabled.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isQuiet(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a spinner for async operations.
|
|
40
|
+
* Returns a no-op spinner in quiet mode.
|
|
41
|
+
* @param text - Initial text to display.
|
|
42
|
+
* @returns An ora spinner instance.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createSpinner(text: string): Ora;
|
|
45
|
+
/**
|
|
46
|
+
* Console output utilities for formatted CLI output.
|
|
47
|
+
* Respects the global log level settings.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ConsoleOutput: {
|
|
50
|
+
/**
|
|
51
|
+
* Print a success message.
|
|
52
|
+
*/
|
|
53
|
+
success(message: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Print an error message.
|
|
56
|
+
* Always printed regardless of log level.
|
|
57
|
+
*/
|
|
58
|
+
error(message: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Print a warning message.
|
|
61
|
+
*/
|
|
62
|
+
warning(message: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Print a warning message (alias for warning).
|
|
65
|
+
*/
|
|
66
|
+
warn(message: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Print an info message.
|
|
69
|
+
*/
|
|
70
|
+
info(message: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Print a gray/muted message.
|
|
73
|
+
*/
|
|
74
|
+
muted(message: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Print a verbose message (only shown with --verbose).
|
|
77
|
+
*/
|
|
78
|
+
verbose(message: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Print a debug message (only shown with --verbose).
|
|
81
|
+
*/
|
|
82
|
+
debug(message: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Print a dry-run indicator.
|
|
85
|
+
*/
|
|
86
|
+
dryRun(message: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Print a blank line.
|
|
89
|
+
*/
|
|
90
|
+
newline(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Print a header.
|
|
93
|
+
*/
|
|
94
|
+
header(message: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Print stats in gray.
|
|
97
|
+
*/
|
|
98
|
+
stats(message: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Format a file path for display.
|
|
101
|
+
*/
|
|
102
|
+
formatPath(path: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Format a location string.
|
|
105
|
+
*/
|
|
106
|
+
formatLocation(file: string, line?: number, column?: number): string;
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/output/console.ts"],"names":[],"mappings":"AACA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,oBAAY,QAAQ;IAClB,wCAAwC;IACxC,KAAK,IAAI;IACT,8BAA8B;IAC9B,MAAM,IAAI;IACV,6CAA6C;IAC7C,OAAO,IAAI;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;CACjB;AAUD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAE7D;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,UAAU,CAEvC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAQ/C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;;OAGG;mBACY,MAAM,GAAG,IAAI;IAI5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAK3B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAK3B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;oBACa,MAAM,GAAG,IAAI;IAK7B;;OAEG;eACQ,IAAI;IAKf;;OAEG;oBACa,MAAM,GAAG,IAAI;IAK7B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;qBACc,MAAM,GAAG,MAAM;IAIhC;;OAEG;yBACkB,MAAM,SAAS,MAAM,WAAW,MAAM,GAAG,MAAM;CAUrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if stdout is an interactive terminal (TTY).
|
|
3
|
+
*/
|
|
4
|
+
export declare function isTTY(): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Get the pager command from environment or use default.
|
|
7
|
+
* Respects PAGER environment variable like git does.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPagerCommand(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Pager for streaming output through a pager like less/more.
|
|
12
|
+
* Similar to how git handles long output.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Pager {
|
|
15
|
+
private lines;
|
|
16
|
+
private enabled;
|
|
17
|
+
constructor(enabled?: boolean);
|
|
18
|
+
/**
|
|
19
|
+
* Write a line to the pager buffer.
|
|
20
|
+
*/
|
|
21
|
+
write(line: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Write multiple lines to the pager buffer.
|
|
24
|
+
*/
|
|
25
|
+
writeLines(lines: string[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* Flush all buffered content through the pager.
|
|
28
|
+
* If pager is disabled or not a TTY, just prints to stdout.
|
|
29
|
+
*/
|
|
30
|
+
flush(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a new pager instance.
|
|
34
|
+
* @param enabled - Whether to enable paging (default: true)
|
|
35
|
+
*/
|
|
36
|
+
export declare function createPager(enabled?: boolean): Pager;
|
|
37
|
+
//# sourceMappingURL=pager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/output/pager.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;GAGG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,OAAO,CAAU;gBAEb,OAAO,UAAO;IAK1B;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIzB;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAIjC;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAuD7B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,UAAO,GAAG,KAAK,CAEjD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { writeFile, mkdir, readFile, readdir } from 'fs/promises';
|
|
2
|
+
import { existsSync, readFileSync } from 'fs';
|
|
3
|
+
import * as prompts from '@inquirer/prompts';
|
|
4
|
+
export interface FileSystem {
|
|
5
|
+
writeFile: typeof writeFile;
|
|
6
|
+
mkdir: typeof mkdir;
|
|
7
|
+
readFile: typeof readFile;
|
|
8
|
+
readdir: typeof readdir;
|
|
9
|
+
existsSync: typeof existsSync;
|
|
10
|
+
readFileSync: typeof readFileSync;
|
|
11
|
+
}
|
|
12
|
+
export interface PromptSystem {
|
|
13
|
+
input: typeof prompts.input;
|
|
14
|
+
confirm: typeof prompts.confirm;
|
|
15
|
+
checkbox: typeof prompts.checkbox;
|
|
16
|
+
}
|
|
17
|
+
export interface CliServices {
|
|
18
|
+
fs: FileSystem;
|
|
19
|
+
prompts: PromptSystem;
|
|
20
|
+
cwd: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const defaultFileSystem: FileSystem;
|
|
23
|
+
export declare const defaultPrompts: PromptSystem;
|
|
24
|
+
export declare const createDefaultServices: () => CliServices;
|
|
25
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,YAAY,EAAE,OAAO,YAAY,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IAC5B,OAAO,EAAE,OAAO,OAAO,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,UAAU,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,iBAAiB,EAAE,UAO/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAI5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,WAIvC,CAAC"}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the init command.
|
|
3
|
+
*/
|
|
4
|
+
export interface InitOptions {
|
|
5
|
+
/** Team namespace */
|
|
6
|
+
team?: string;
|
|
7
|
+
/** Project name (overrides auto-detection) */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Inheritance path (e.g., @company/team) */
|
|
10
|
+
inherit?: string;
|
|
11
|
+
/** Registry path or URL */
|
|
12
|
+
registry?: string;
|
|
13
|
+
/** Target AI tools (github, claude, cursor) */
|
|
14
|
+
targets?: string[];
|
|
15
|
+
/** Interactive mode (prompts for all options) */
|
|
16
|
+
interactive?: boolean;
|
|
17
|
+
/** Skip prompts, use defaults */
|
|
18
|
+
yes?: boolean;
|
|
19
|
+
/** Force reinitialize even if already initialized */
|
|
20
|
+
force?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Options for the compile command.
|
|
24
|
+
*/
|
|
25
|
+
export interface CompileOptions {
|
|
26
|
+
/** Specific target to compile (github, claude, cursor) */
|
|
27
|
+
target?: string;
|
|
28
|
+
/** Output format (github, claude, cursor) - alias for target */
|
|
29
|
+
format?: string;
|
|
30
|
+
/** Compile all configured targets */
|
|
31
|
+
all?: boolean;
|
|
32
|
+
/** Watch mode for continuous compilation */
|
|
33
|
+
watch?: boolean;
|
|
34
|
+
/** Output directory */
|
|
35
|
+
output?: string;
|
|
36
|
+
/** Preview changes without writing files */
|
|
37
|
+
dryRun?: boolean;
|
|
38
|
+
/** Registry path or URL (overrides config) */
|
|
39
|
+
registry?: string;
|
|
40
|
+
/** Path to custom config file */
|
|
41
|
+
config?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Options for the validate command.
|
|
45
|
+
*/
|
|
46
|
+
export interface ValidateOptions {
|
|
47
|
+
/** Treat warnings as errors */
|
|
48
|
+
strict?: boolean;
|
|
49
|
+
/** Output format (text, json) */
|
|
50
|
+
format?: 'text' | 'json';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Options for the pull command.
|
|
54
|
+
*/
|
|
55
|
+
export interface PullOptions {
|
|
56
|
+
/** Force overwrite local files */
|
|
57
|
+
force?: boolean;
|
|
58
|
+
/** Preview changes without pulling */
|
|
59
|
+
dryRun?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the diff command.
|
|
63
|
+
*/
|
|
64
|
+
export interface DiffOptions {
|
|
65
|
+
/** Specific target to diff */
|
|
66
|
+
target?: string;
|
|
67
|
+
/** Show diff for all targets at once */
|
|
68
|
+
all?: boolean;
|
|
69
|
+
/** Show full diff without truncation */
|
|
70
|
+
full?: boolean;
|
|
71
|
+
/** Disable pager (like git --no-pager) */
|
|
72
|
+
noPager?: boolean;
|
|
73
|
+
/** Force colored output */
|
|
74
|
+
color?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Options for the check command.
|
|
78
|
+
*/
|
|
79
|
+
export interface CheckOptions {
|
|
80
|
+
/** Attempt to fix issues automatically */
|
|
81
|
+
fix?: boolean;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iCAAiC;IACjC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,wCAAwC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CliServices } from '../services.js';
|
|
2
|
+
/**
|
|
3
|
+
* Supported AI tool targets.
|
|
4
|
+
*/
|
|
5
|
+
export type AIToolTarget = 'github' | 'claude' | 'cursor';
|
|
6
|
+
/**
|
|
7
|
+
* AI tool detection result.
|
|
8
|
+
*/
|
|
9
|
+
export interface AIToolsDetection {
|
|
10
|
+
/** Detected AI tools with existing configuration */
|
|
11
|
+
detected: AIToolTarget[];
|
|
12
|
+
/** Details about detected files */
|
|
13
|
+
details: Record<AIToolTarget, string[]>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Detect existing AI tool configurations.
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectAITools(services?: CliServices): Promise<AIToolsDetection>;
|
|
19
|
+
/**
|
|
20
|
+
* Get all available targets.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAllTargets(): AIToolTarget[];
|
|
23
|
+
/**
|
|
24
|
+
* Get suggested targets based on detection.
|
|
25
|
+
* If no tools detected, suggest all. Otherwise, suggest detected ones.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getSuggestedTargets(detection: AIToolsDetection): AIToolTarget[];
|
|
28
|
+
/**
|
|
29
|
+
* Format detection results for display.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatDetectionResults(detection: AIToolsDetection): string[];
|
|
32
|
+
//# sourceMappingURL=ai-tools-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tools-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/ai-tools-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;CACzC;AA0CD;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,gBAAgB,CAAC,CAgC3B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAE/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAgB5E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CliServices } from '../services.js';
|
|
2
|
+
/**
|
|
3
|
+
* Project detection result.
|
|
4
|
+
*/
|
|
5
|
+
export interface ProjectInfo {
|
|
6
|
+
/** Detected project name */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Source of the detected name */
|
|
9
|
+
source: 'package.json' | 'pyproject.toml' | 'cargo.toml' | 'go.mod' | 'directory';
|
|
10
|
+
/** Detected programming languages */
|
|
11
|
+
languages: string[];
|
|
12
|
+
/** Detected frameworks */
|
|
13
|
+
frameworks: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Detect project information from current directory.
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectProject(services?: CliServices): Promise<ProjectInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* Detect project name from various sources.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectProjectName(services: CliServices): Promise<{
|
|
23
|
+
name: string;
|
|
24
|
+
source: ProjectInfo['source'];
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Detect programming languages used in the project.
|
|
28
|
+
*/
|
|
29
|
+
export declare function detectLanguages(services: CliServices): Promise<string[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Detect frameworks used in the project.
|
|
32
|
+
*/
|
|
33
|
+
export declare function detectFrameworks(services: CliServices): Promise<string[]>;
|
|
34
|
+
//# sourceMappingURL=project-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/project-detector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;IAClF,qCAAqC;IACrC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AA6CD;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,WAAW,CAAC,CAWtB;AAmED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAC/B,CAAC,CAQD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAuB9E;AAoFD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQ/E"}
|