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
5 changes: 5 additions & 0 deletions .changeset/dynamic-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"claude-session-gists": patch
---

Read CLI version from package.json instead of hardcoding it
19 changes: 16 additions & 3 deletions src/bin/cli.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/usr/bin/env node
/**
* @since 0.1.0
*
*
* CLI for exporting Claude Code sessions to GitHub Gists.
*
*
* Usage:
* claude-session-gists list # List available sessions
* claude-session-gists export # Export most recent session
* claude-session-gists export --project foo # Export session from project
* claude-session-gists create # Create GitHub Gist from session
* claude-session-gists create --commit # Create gist and output for git commit
*/
import { readFileSync } from "node:fs"
import { dirname, join } from "node:path"
import { fileURLToPath } from "node:url"
import { Command, Options } from "@effect/cli"
import { NodeContext, NodeRuntime } from "@effect/platform-node"
import * as PlatformCommand from "@effect/platform/Command"
Expand All @@ -30,6 +33,16 @@ import {
type Session
} from "../index.js"

// ============================================================================
// Package Version
// ============================================================================

const __dirname = dirname(fileURLToPath(import.meta.url))
const packageJson = JSON.parse(
readFileSync(join(__dirname, "../../package.json"), "utf-8")
) as { version: string }
const VERSION = packageJson.version

// ============================================================================
// Shared Options
// ============================================================================
Expand Down Expand Up @@ -581,7 +594,7 @@ const mainCommand = Command.make("claude-session-gists").pipe(

const cli = Command.run(mainCommand, {
name: "claude-session-gists",
version: "0.1.1"
version: VERSION
})

// ============================================================================
Expand Down