Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linear-release",
"version": "0.1.0",
"version": "0.2.0",
"private": true,
"description": "CLI tool to integrate CI/CD pipelines with Linear releases",
"homepage": "https://github.com/linear/linear-release",
Expand Down
40 changes: 40 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,46 @@ import { log } from "./log";
import { pluralize } from "./util";
import { buildUserAgent } from "./user-agent";

declare const CLI_VERSION: string;

if (process.argv.includes("--version") || process.argv.includes("-v")) {
console.log(CLI_VERSION);
process.exit(0);
}

if (process.argv.includes("--help") || process.argv.includes("-h")) {
console.log(`Linear Release CLI v${CLI_VERSION}

Integrate CI/CD pipelines with Linear releases.

Usage: linear-release <command> [options]

Commands:
sync Create or update a release by scanning commits (default)
complete Mark the current release as complete
update Update the deployment stage of a release

Options:
--name=<name> Custom release name (sync only)
--version=<version> Release version identifier
--stage=<stage> Deployment stage (required for update)
--include-paths=<paths> Filter commits by file paths (comma-separated globs)
-v, --version Show version number
-h, --help Show this help message

Environment:
LINEAR_ACCESS_KEY Pipeline access key (required)

Examples:
linear-release sync
linear-release sync --name="Release 1.2.0" --version="1.2.0"
linear-release complete
linear-release update --stage=production
linear-release sync --include-paths="apps/web/**,packages/**"
`);
process.exit(0);
}

const accessKey: string = process.env.LINEAR_ACCESS_KEY || "";
const command: string = process.argv[2] || "sync";

Expand Down