Add claudelog CLI for terminal usage outside Claude Code#1
Merged
Conversation
Dispatches report/backfill subcommands via child process spawn, avoiding changes to existing script guards. Includes PATH setup instructions in README.
There was a problem hiding this comment.
Pull request overview
This PR adds a unified CLI entry point for the Claude Code timelog plugin, enabling users to run claudelog commands from any terminal without an active Claude Code session. The implementation uses a lightweight dispatcher pattern that spawns child processes to execute existing scripts, preserving their CLI guard patterns.
Changes:
- Add
bin/claudelogdispatcher forreportandbackfillsubcommands - Register CLI entry point in
package.jsonbin field - Add comprehensive test coverage for CLI usage patterns
- Document CLI usage and PATH setup options in README
- Correct license in
package-lock.jsonto match actual Apache-2.0 license
Reviewed changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bin/claudelog | New CLI dispatcher that validates commands and spawns subcommand scripts via execFileSync |
| package.json | Adds bin field mapping claudelog command to bin/claudelog |
| package-lock.json | Updates license from MIT to Apache-2.0 to match LICENSE file |
| test/bin/claudelog.test.mjs | Comprehensive test suite covering help, unknown commands, argument forwarding, and exit codes |
| README.md | Documents CLI usage with examples and two PATH setup approaches (symlink and shell profile) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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/claudelogCLI entry point that dispatchesreportandbackfillsubcommands via child process spawnexecFileSyncto avoid touching CLI guard patternsbinfield topackage.jsonfor npm tooling awarenessTest plan
claudelogwith no args prints usage to stderr, exits 1claudelog --helpandclaudelog helpprint usage to stdout, exit 0claudelog report --helppasses through to report scriptclaudelog backfillruns without error