@contextium/cli 0.3.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 +227 -0
- package/dist/commands/cat.d.ts +3 -0
- package/dist/commands/cat.d.ts.map +1 -0
- package/dist/commands/cat.js +153 -0
- package/dist/commands/cat.js.map +1 -0
- package/dist/commands/files.d.ts +3 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +121 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/find.d.ts +3 -0
- package/dist/commands/find.d.ts.map +1 -0
- package/dist/commands/find.js +119 -0
- package/dist/commands/find.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +157 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +44 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +22 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/projects.d.ts +3 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +64 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +79 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/setup-claude.d.ts +3 -0
- package/dist/commands/setup-claude.d.ts.map +1 -0
- package/dist/commands/setup-claude.js +106 -0
- package/dist/commands/setup-claude.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +103 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +3 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +118 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tags.d.ts +3 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +312 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/commands/whoami.d.ts +3 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +35 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/workspaces.d.ts +3 -0
- package/dist/commands/workspaces.d.ts.map +1 -0
- package/dist/commands/workspaces.js +48 -0
- package/dist/commands/workspaces.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-client.d.ts +11 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +61 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/cache.d.ts +20 -0
- package/dist/lib/cache.d.ts.map +1 -0
- package/dist/lib/cache.js +79 -0
- package/dist/lib/cache.js.map +1 -0
- package/dist/lib/config.d.ts +4 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +40 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/msal.d.ts +25 -0
- package/dist/lib/msal.d.ts.map +1 -0
- package/dist/lib/msal.js +150 -0
- package/dist/lib/msal.js.map +1 -0
- package/dist/lib/output.d.ts +40 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +70 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Simple output helpers (chalk alternative for minimal deps)
|
|
2
|
+
export const colors = {
|
|
3
|
+
reset: '\x1b[0m',
|
|
4
|
+
bold: '\x1b[1m',
|
|
5
|
+
dim: '\x1b[2m',
|
|
6
|
+
red: '\x1b[31m',
|
|
7
|
+
green: '\x1b[32m',
|
|
8
|
+
yellow: '\x1b[33m',
|
|
9
|
+
blue: '\x1b[34m',
|
|
10
|
+
cyan: '\x1b[36m',
|
|
11
|
+
gray: '\x1b[90m',
|
|
12
|
+
white: '\x1b[37m',
|
|
13
|
+
};
|
|
14
|
+
export function colorize(text, color) {
|
|
15
|
+
return `${colors[color]}${text}${colors.reset}`;
|
|
16
|
+
}
|
|
17
|
+
export const chalk = {
|
|
18
|
+
red: (text) => colorize(text, 'red'),
|
|
19
|
+
green: (text) => colorize(text, 'green'),
|
|
20
|
+
yellow: (text) => colorize(text, 'yellow'),
|
|
21
|
+
blue: (text) => colorize(text, 'blue'),
|
|
22
|
+
cyan: (text) => colorize(text, 'cyan'),
|
|
23
|
+
gray: (text) => colorize(text, 'gray'),
|
|
24
|
+
dim: (text) => colorize(text, 'dim'),
|
|
25
|
+
bold: (text) => colorize(text, 'bold'),
|
|
26
|
+
white: (text) => colorize(text, 'white'),
|
|
27
|
+
};
|
|
28
|
+
export class Spinner {
|
|
29
|
+
constructor(text) {
|
|
30
|
+
this.frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
31
|
+
this.currentFrame = 0;
|
|
32
|
+
this.text = text;
|
|
33
|
+
}
|
|
34
|
+
start() {
|
|
35
|
+
this.interval = setInterval(() => {
|
|
36
|
+
process.stdout.write(`\r${this.frames[this.currentFrame]} ${this.text}`);
|
|
37
|
+
this.currentFrame = (this.currentFrame + 1) % this.frames.length;
|
|
38
|
+
}, 80);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
stop() {
|
|
42
|
+
if (this.interval) {
|
|
43
|
+
clearInterval(this.interval);
|
|
44
|
+
process.stdout.write('\r\x1b[K'); // Clear line
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
succeed(message) {
|
|
48
|
+
this.stop();
|
|
49
|
+
console.log(`${chalk.green('✓')} ${message}`);
|
|
50
|
+
}
|
|
51
|
+
fail(message) {
|
|
52
|
+
this.stop();
|
|
53
|
+
console.log(`${chalk.red('✗')} ${message}`);
|
|
54
|
+
}
|
|
55
|
+
warn(message) {
|
|
56
|
+
this.stop();
|
|
57
|
+
console.log(`${chalk.yellow('⚠')} ${message}`);
|
|
58
|
+
}
|
|
59
|
+
info(message) {
|
|
60
|
+
this.stop();
|
|
61
|
+
console.log(`${chalk.blue('ℹ')} ${message}`);
|
|
62
|
+
}
|
|
63
|
+
set setText(text) {
|
|
64
|
+
this.text = text;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function ora(text) {
|
|
68
|
+
return new Spinner(text);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAA0B;IAC/D,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAC5C,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAChD,MAAM,EAAE,CAA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
+
workspace?: string;
|
|
6
|
+
cache: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
ttl: number;
|
|
9
|
+
directory: string;
|
|
10
|
+
max_size_mb: number;
|
|
11
|
+
};
|
|
12
|
+
sync: {
|
|
13
|
+
auto: boolean;
|
|
14
|
+
on_command: string[];
|
|
15
|
+
notify_changes: boolean;
|
|
16
|
+
interval: number;
|
|
17
|
+
};
|
|
18
|
+
files: {
|
|
19
|
+
include: string[];
|
|
20
|
+
exclude: string[];
|
|
21
|
+
tags: string[];
|
|
22
|
+
auto_include_tags: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface File {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
path: string;
|
|
29
|
+
content?: string;
|
|
30
|
+
currentVersion: number;
|
|
31
|
+
projectId: string;
|
|
32
|
+
folderId: string | null;
|
|
33
|
+
status: string;
|
|
34
|
+
createdBy: string;
|
|
35
|
+
updatedBy: string;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
deletedAt: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface Project {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
slug: string;
|
|
44
|
+
file_count: number;
|
|
45
|
+
created_at: string;
|
|
46
|
+
}
|
|
47
|
+
export interface Workspace {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
slug: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SearchResults {
|
|
53
|
+
results: {
|
|
54
|
+
files: File[];
|
|
55
|
+
};
|
|
56
|
+
total: number;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,M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AAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE;QACP,KAAK,EAAE,IAAI,EAAE,CAAA;KACd,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contextium/cli",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Command-line tool for syncing Contextium documentation to local cache and piping to AI coding assistants",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"contextium",
|
|
7
|
+
"cli",
|
|
8
|
+
"documentation",
|
|
9
|
+
"ai",
|
|
10
|
+
"cursor",
|
|
11
|
+
"claude",
|
|
12
|
+
"copilot",
|
|
13
|
+
"ide",
|
|
14
|
+
"developer-tools",
|
|
15
|
+
"knowledge-management"
|
|
16
|
+
],
|
|
17
|
+
"author": "Contextium",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/tomjutla/contextium.git",
|
|
22
|
+
"directory": "apps/cli"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://contextium.io/docs/cli",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/tomjutla/contextium/issues"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"type": "module",
|
|
30
|
+
"bin": {
|
|
31
|
+
"contextium": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"README.md"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"dev": "tsx watch src/index.ts",
|
|
40
|
+
"start": "node dist/index.js",
|
|
41
|
+
"type-check": "tsc --noEmit",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@azure/msal-node": "^5.0.6",
|
|
46
|
+
"axios": "^1.6.5",
|
|
47
|
+
"commander": "^11.1.0",
|
|
48
|
+
"open": "^11.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.11.0",
|
|
52
|
+
"tsx": "^4.7.0",
|
|
53
|
+
"typescript": "^5.3.3"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|