Skip to content

Commit a4b4e89

Browse files
efoutsclaude
andcommitted
fix: resolve script execution issue for npx and global install, bump to 0.1.8
The root issue was the import.meta.url execution check not working with npm bin symlinks. Changes: - Replace complex execution detection with simple main() call - This ensures the script runs in all contexts: direct execution, npm bin, npx - Short bin name 'ccstatus' works with npx -p syntax - Both global install and npx now produce correct output ✅ Working: echo '...' | ccstatus ✅ Working: echo '...' | npx ./package.tgz ✅ Ready for: echo '...' | npx -p @this-dot/claude-code-context-status-line ccstatus 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 999ef50 commit a4b4e89

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@this-dot/claude-code-context-status-line",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "Custom Claude Code status line to restore context window visibility for AWS Bedrock users by displaying token usage.",
55
"type": "module",
66
"main": "src/context-status.js",

src/context-status.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,6 @@ function safeParseInt(value) {
160160
// Export the main API
161161
export { main, getTotalTokens, getTranscriptPathAndModel, formatStatusLine };
162162

163-
if (import.meta.url === `file://${process.argv[1]}`) {
164-
main();
165-
}
163+
// Always run main when this file is executed as a script
164+
// This works for both direct execution and npm bin symlinks
165+
main();
5.08 KB
Binary file not shown.
5.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)