gyrus 0.1.0 → 0.1.1
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 +4 -4
- package/package.json +4 -4
- package/src/commands/version.ts +103 -0
- package/src/index.ts +8 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Gyrus
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ewgenius/gyrus/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/ewgenius/gyrus/actions/workflows/release.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/gyrus)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://bun.sh)
|
|
@@ -26,7 +26,7 @@ Gyrus is a unified CLI tool for managing knowledge notes and Architecture Decisi
|
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# Clone the repository
|
|
29
|
-
git clone https://github.com/
|
|
29
|
+
git clone https://github.com/ewgenius/gyrus.git
|
|
30
30
|
cd gyrus
|
|
31
31
|
|
|
32
32
|
# Install dependencies
|
|
@@ -270,4 +270,4 @@ working_folder: /path/to/project
|
|
|
270
270
|
|
|
271
271
|
## License
|
|
272
272
|
|
|
273
|
-
MIT
|
|
273
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gyrus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Model-agnostic knowledge management CLI with MCP server support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
|
-
"url": "git+https://github.com/
|
|
50
|
+
"url": "git+https://github.com/ewgenius/gyrus.git"
|
|
51
51
|
},
|
|
52
52
|
"bugs": {
|
|
53
|
-
"url": "https://github.com/
|
|
53
|
+
"url": "https://github.com/ewgenius/gyrus/issues"
|
|
54
54
|
},
|
|
55
|
-
"homepage": "https://github.com/
|
|
55
|
+
"homepage": "https://github.com/ewgenius/gyrus#readme",
|
|
56
56
|
"engines": {
|
|
57
57
|
"bun": ">=1.0.0"
|
|
58
58
|
},
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gyrus version command
|
|
3
|
+
* Display version information from package.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import packageJson from "../../package.json";
|
|
7
|
+
|
|
8
|
+
export interface VersionInfo {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
description: string;
|
|
12
|
+
runtime: string;
|
|
13
|
+
platform: string;
|
|
14
|
+
arch: string;
|
|
15
|
+
homepage: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get version information
|
|
20
|
+
*/
|
|
21
|
+
export function getVersionInfo(): VersionInfo {
|
|
22
|
+
return {
|
|
23
|
+
name: packageJson.name,
|
|
24
|
+
version: packageJson.version,
|
|
25
|
+
description: packageJson.description,
|
|
26
|
+
runtime: `Bun ${Bun.version}`,
|
|
27
|
+
platform: process.platform,
|
|
28
|
+
arch: process.arch,
|
|
29
|
+
homepage: packageJson.homepage,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the version string
|
|
35
|
+
*/
|
|
36
|
+
export function getVersion(): string {
|
|
37
|
+
return packageJson.version;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Parse version command arguments
|
|
42
|
+
*/
|
|
43
|
+
export interface VersionOptions {
|
|
44
|
+
json?: boolean;
|
|
45
|
+
help?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function parseVersionArgs(args: string[]): VersionOptions {
|
|
49
|
+
const options: VersionOptions = {};
|
|
50
|
+
|
|
51
|
+
for (const arg of args) {
|
|
52
|
+
if (arg === "--json" || arg === "-j") {
|
|
53
|
+
options.json = true;
|
|
54
|
+
} else if (arg === "--help" || arg === "-h") {
|
|
55
|
+
options.help = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return options;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const HELP = `
|
|
63
|
+
Usage: gyrus version [options]
|
|
64
|
+
|
|
65
|
+
Display version and environment information.
|
|
66
|
+
|
|
67
|
+
Options:
|
|
68
|
+
-j, --json Output as JSON
|
|
69
|
+
-h, --help Show this help message
|
|
70
|
+
|
|
71
|
+
Examples:
|
|
72
|
+
gyrus version # Show version info
|
|
73
|
+
gyrus version --json # Output as JSON for scripting
|
|
74
|
+
gyrus -v # Short alias for version
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Execute the version command
|
|
79
|
+
*/
|
|
80
|
+
export async function versionCommand(args: string[]): Promise<void> {
|
|
81
|
+
const options = parseVersionArgs(args);
|
|
82
|
+
|
|
83
|
+
if (options.help) {
|
|
84
|
+
console.log(HELP);
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const info = getVersionInfo();
|
|
89
|
+
|
|
90
|
+
if (options.json) {
|
|
91
|
+
console.log(JSON.stringify(info, null, 2));
|
|
92
|
+
process.exit(0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
console.log(`
|
|
96
|
+
${info.name} v${info.version}
|
|
97
|
+
${info.description}
|
|
98
|
+
|
|
99
|
+
Runtime: ${info.runtime}
|
|
100
|
+
Platform: ${info.platform} ${info.arch}
|
|
101
|
+
Homepage: ${info.homepage}
|
|
102
|
+
`);
|
|
103
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,7 @@ import { doctorCommand } from "./commands/doctor.ts";
|
|
|
11
11
|
import { mcpCommand } from "./commands/mcp.ts";
|
|
12
12
|
import { knowledgeCommand } from "./commands/knowledge.ts";
|
|
13
13
|
import { adrCommand } from "./commands/adr.ts";
|
|
14
|
-
|
|
15
|
-
const VERSION = "0.1.0";
|
|
14
|
+
import { versionCommand, getVersion } from "./commands/version.ts";
|
|
16
15
|
|
|
17
16
|
const HELP = `
|
|
18
17
|
Gyrus - Model-agnostic knowledge management CLI
|
|
@@ -24,6 +23,7 @@ Workspace Commands:
|
|
|
24
23
|
workspaces List all registered workspaces (alias: ws)
|
|
25
24
|
use <name> Set the default workspace
|
|
26
25
|
doctor Run diagnostics
|
|
26
|
+
version Show version and environment info
|
|
27
27
|
|
|
28
28
|
Knowledge Commands:
|
|
29
29
|
knowledge <subcommand> Manage knowledge notes (alias: k, note)
|
|
@@ -67,7 +67,7 @@ Examples:
|
|
|
67
67
|
gyrus mcp # Start MCP server
|
|
68
68
|
gyrus mcp --workspace work # MCP server for specific workspace
|
|
69
69
|
|
|
70
|
-
Learn more: https://github.com/
|
|
70
|
+
Learn more: https://github.com/ewgenius/gyrus
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
73
|
async function main(): Promise<void> {
|
|
@@ -82,7 +82,7 @@ async function main(): Promise<void> {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (command === "-v" || command === "--version") {
|
|
85
|
-
console.log(`gyrus v${
|
|
85
|
+
console.log(`gyrus v${getVersion()}`);
|
|
86
86
|
process.exit(0);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -106,6 +106,10 @@ async function main(): Promise<void> {
|
|
|
106
106
|
await doctorCommand(commandArgs);
|
|
107
107
|
break;
|
|
108
108
|
|
|
109
|
+
case "version":
|
|
110
|
+
await versionCommand(commandArgs);
|
|
111
|
+
break;
|
|
112
|
+
|
|
109
113
|
// Knowledge commands (with aliases)
|
|
110
114
|
case "knowledge":
|
|
111
115
|
case "k":
|