feat: add npx claude-session CLI support - #1
Closed
yazins-ai wants to merge 6 commits into
Closed
Conversation
Adds a bin entry and CLI script so the package can be run directly via `npx claude-session`. The CLI auto-builds the frontend on first run if web/dist/ doesn't exist.
npx vite runs from an isolated temp directory that can't resolve the project's dependencies. Install deps first, then use the local node_modules/.bin/vite.
node_modules/.bin/vite doesn't work on Windows. Use
require.resolve('vite/bin/vite.js') which works everywhere.
The focus system (process tree walk, window activation, terminal detection) was entirely Windows-only using PowerShell/WMI/Win32. On macOS: walks process tree via `ps`, identifies terminal apps (Warp, iTerm2, Terminal.app, kitty, etc.), and uses AppleScript `osascript` to activate the window. Also fixes the terminals API and guards the Windows-only startup process discovery.
Owner
|
Changes implemented directly in master (30cb880). Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bin/claude-session.jsCLI entry point so the package can be run vianpx claude-sessionbinandfilesfields topackage.jsonfor proper npm packagingweb/dist/doesn't existPublishing to npm
Once merged, publish with:
If the name
claude-sessionis taken, you can scope it:Then users run:
npx @your-scope/claude-sessionOptional: pre-build on publish
Add a
prepublishOnlyscript so the frontend is always built before publish:Test plan
npm packand inspect tarball includesbin/,src/,web/,session-hook.jsnpx .from the repo root starts the server and builds the frontendnpm publish,npx claude-sessionworks from any directory