Skip to main content

Commands

workscribe init

Set up Workscribe and install or update shell hooks.
Safe to re-run at any time — installs missing hooks, updates outdated ones, and skips everything already up to date. What it does:
  • Creates ~/.workscribe/ with owner-only permissions
  • Initialises the SQLite database
  • Installs or updates the shell hook in ~/.zshrc or ~/.bashrc
  • Detects installed AI coding tools (Claude Code, Aider, etc.) and offers to install a session capture hook for each — opt-in, defaults to no
  • Prompts you to choose an AI provider and enter your API key
Shell hook updates: When a new version of Workscribe ships with an updated hook, re-running workscribe init detects the change and prompts you to update. Your rc file is backed up before any modification.

workscribe summary

Generate an AI work summary for today or a specific date.
Slack setup:
  1. Go to api.slack.com/apps → Create New App → From scratch
  2. Name your app, select your workspace, and click Create App
  3. In the left sidebar under Features, click Incoming Webhooks
  4. Toggle Activate Incoming Webhooks to On
  5. Click Add New Webhook to Workspace, choose a channel, and click Allow
  6. Copy the webhook URL and configure workscribe:
Works on all Slack plans including free. No admin role required — any workspace member can create an app. Then run workscribe summary --slack to post. The summary is automatically formatted for Slack — headings are bolded and bullets are converted to •. Your OS username is prepended to the message so recipients know who sent it in shared channels. Output format:
Each session gets its own heading. The heading is always generated from your captured data — project name, branch, and duration — not from the AI. Caching:
  • Daily summaries are cached per session in the database
  • Cached summaries are preserved when new events arrive — only new or unsummarised sessions call the AI
  • Weekly summaries are cached in ~/.workscribe/weekly-cache/<YYYY-WW>.md
  • Use --fresh to force regeneration of all sessions for the day

workscribe week

Generate an AI weekly digest covering Monday through today.
The natural pre-standup ritual for Monday morning or end-of-week reporting. Output is markdown grouped by day, with each session summarised under its project and branch. Caching: Results are cached in ~/.workscribe/weekly-cache/<YYYY-WW>.md. Running workscribe week a second time in the same week returns the cached digest instantly. Use --fresh to force regeneration. Slack: Configure your webhook first:
Then run workscribe week --slack to post. See workscribe summary for full Slack setup instructions.

workscribe sessions

List detected work sessions for a date.
Sessions are computed by grouping events with idle gaps greater than session.idleTimeout (default 30 minutes) and splitting across different repositories.

workscribe events

List raw captured events for a date.
Events are colour-coded by category:

workscribe note

Attach a free-text annotation to the current session.
The note is stored as an event in the database, timestamped now, and associated with the current git repo and branch. It groups into whatever session covers its timestamp when sessions are rebuilt. Where notes appear:
  • workscribe sessions — displayed indented under the matching session
  • workscribe summary and workscribe week — injected into the AI prompt before the event list so the model reads your context first, and uses it to explain the why behind the work
Removing a note: Notes are events. Use workscribe undo to remove the most recently added note.

workscribe undo

Remove the last N captured events.
Notes:
  • Removes events from the database only — does not modify any exported markdown files
  • Automatically invalidates sessions for affected dates so they rebuild on next access
  • Running undo twice is safe — the second call removes the next N events

workscribe clear

Delete all captured events for a date.
Notes:
  • Shows a category summary before asking for confirmation
  • Automatically invalidates cached sessions for the date
  • Use --dry-run to see what would be removed before committing

workscribe export

Generate a summary and save it as a markdown file.

workscribe context

Surface the last session for the current repo — at the moment you need it, not at end of day.
Without --file: shows the most recent session for the current git repo — date, duration, branch, event count, and the AI-generated summary if one exists. With --file: narrows to the most recent session that included a code_edit event for that path. This is what powers the VS Code extension’s status bar “last worked on” indicator — surfacing “3 days ago” when you switch to a file you haven’t touched recently. Neovim and other editor integrations aren’t built yet. If no summary exists for the session, the default text output includes the command to generate one:
--json output shape, intended for IDE integrations that need to render this themselves rather than parse formatted text:
Prints the bare JSON value null (not an object) when no matching session exists.

workscribe status

Show capture status and event counts.
Output includes:
  • Whether capture is active or paused
  • Number of events captured today and total
  • Last captured event
  • Configured AI provider and model
  • Pending security alerts count (if any)

workscribe alerts

Show and manage security alerts raised when Workscribe detects a possible credential in an AI tool prompt.
When credentials are detected in a prompt sent to an AI tool (e.g. Claude Code), Workscribe:
  1. Stores the alert in the local database.
  2. Writes a signal file to ~/.workscribe/alerts.pending.
  3. Displays a one-line warning before your next shell prompt.
  4. Injects a systemMessage into Claude’s context for that turn.
The clear subcommand marks all alerts as dismissed and removes the signal file.

workscribe pause / resume

Pause and resume capture.
When paused, the shell hook still fires but events are silently discarded. Useful when sharing your screen or running sensitive commands you don’t want journaled.

workscribe uninstall

Remove shell hooks and optionally delete all Workscribe data.
What it does:
  • Detects and removes the Workscribe hook block from ~/.zshrc, ~/.bashrc, and ~/.bash_profile
  • Prompts whether to delete ~/.workscribe/ (database, config, exports) — defaults to no
  • Prints the command to remove the CLI itself (npm uninstall -g @workscribe/cli)
After running: The hook is removed from your rc file but remains active in your current shell session. Either restart your terminal or run:
If you’ve already removed the binary and still see _workscribe_precmd errors, remove the hook block manually:
  1. Open ~/.zshrc (or ~/.bashrc)
  2. Delete everything between # workscribe:hook:start and # workscribe:hook:end (inclusive)
  3. Run source ~/.zshrc or restart your terminal

workscribe _capture (IDE integration)

Internal command called by shell hooks and IDE plugins. Not intended for direct use. IDE integrations call this to record a file-save or debug event without going through the shell:
Deduplication: code_edit events for the same file within 30 seconds are dropped. This absorbs rapid auto-saves without creating duplicate records.

workscribe config

View and update configuration.
Examples:
Sensitive value masking: workscribe config get and workscribe config mask API keys, tokens, and webhook URLs — showing only the first four characters and the total length:
This confirms a value is set without exposing it in your terminal history. See Configuration for the full config reference.