@@ -18,6 +18,46 @@ import { log } from "./log";
1818import { pluralize } from "./util" ;
1919import { buildUserAgent } from "./user-agent" ;
2020
21+ declare const CLI_VERSION : string ;
22+
23+ if ( process . argv . includes ( "--version" ) || process . argv . includes ( "-v" ) ) {
24+ console . log ( CLI_VERSION ) ;
25+ process . exit ( 0 ) ;
26+ }
27+
28+ if ( process . argv . includes ( "--help" ) || process . argv . includes ( "-h" ) ) {
29+ console . log ( `Linear Release CLI v${ CLI_VERSION }
30+
31+ Integrate CI/CD pipelines with Linear releases.
32+
33+ Usage: linear-release <command> [options]
34+
35+ Commands:
36+ sync Create or update a release by scanning commits (default)
37+ complete Mark the current release as complete
38+ update Update the deployment stage of a release
39+
40+ Options:
41+ --name=<name> Custom release name (sync only)
42+ --version=<version> Release version identifier
43+ --stage=<stage> Deployment stage (required for update)
44+ --include-paths=<paths> Filter commits by file paths (comma-separated globs)
45+ -v, --version Show version number
46+ -h, --help Show this help message
47+
48+ Environment:
49+ LINEAR_ACCESS_KEY Pipeline access key (required)
50+
51+ Examples:
52+ linear-release sync
53+ linear-release sync --name="Release 1.2.0" --version="1.2.0"
54+ linear-release complete
55+ linear-release update --stage=production
56+ linear-release sync --include-paths="apps/web/**,packages/**"
57+ ` ) ;
58+ process . exit ( 0 ) ;
59+ }
60+
2161const accessKey : string = process . env . LINEAR_ACCESS_KEY || "" ;
2262const command : string = process . argv [ 2 ] || "sync" ;
2363
0 commit comments