Skip to main content

Onboarding commands

devvis init

Initialize DevVis in the current project directory.
devvis init <customer-key>
customer-key
string
required
Your DevVis customer key. Find it in the DevVis dashboard under Settings → API Keys.
What it does:
1

Creates .devvis/config.json

Saves the customer key at the project level (not machine-level).
2

Updates .gitignore

Appends .devvis/ to .gitignore, creating the file if it doesn’t exist.
Running devvis init again overwrites the existing key. The .gitignore entry is not duplicated (idempotent).

devvis update-key

Update the customer key for the current project.
devvis update-key <new-customer-key>
Fails with an error if the project has not been initialized with devvis init first.

devvis remove

Remove the DevVis config from the current project.
devvis remove
Deletes .devvis/ from the current directory. Does not affect hooks or other projects. Idempotent.

devvis setup-hooks

Install Claude Code hooks (run once per machine).
devvis setup-hooks
Merges DevVis hooks into ~/.claude/settings.json, preserving any existing third-party hooks. Creates a backup at ~/.claude/settings.devvis-backup.json before modifying. Idempotent — will not duplicate hooks already present. Hooks installed:
EventMatcherWhat it captures
SessionStartSession lifecycle begin
StopSession summary + token usage
PostToolUseExitPlanModePlan approval
PostToolUseTaskCreateTask creation
PostToolUseTaskUpdateTask completion

devvis uninstall

Remove hooks and the binary.
devvis uninstall
Removes DevVis hooks from ~/.claude/settings.json and deletes the binary. Idempotent.

Hook adapter

devvis send-episode

High-level command used by Claude Code hooks. Reads the hook payload from stdin, enriches it with local context, and posts a normalized event to the API.
devvis send-episode --event <event-name> [--customer-key <key>] [--api-url <url>]
--event
string
required
The event name to send. See supported events below.
--customer-key
string
Override the customer key. Defaults to the project-level .devvis/config.json.
--api-url
string
Override the API base URL. Defaults to https://devvis.com.br.
Supported events:
--event valueWhat it captures
session-startSession lifecycle begin; records session ID and working directory
plan-approvedPlan approval via ExitPlanMode; extracts allowed prompts as plan steps
task-createdTask creation; caches subject/description for task-completed correlation
task-completedTask completion; retrieves cached metadata to build a rich event
session-summarySession end; reads the transcript for a summary and sums token usage
send-episode never fails loudly — all errors are logged to ~/.devvis/hooks.log and the process exits with code 0. This ensures Claude Code’s workflow is never blocked by telemetry failures.

Writer commands

Low-level commands for writing directly to the knowledge graph.

devvis writer add-episode

Write an explicit episode.
devvis writer add-episode \
  --name "task_completed:auth-refactor" \
  --body '{"summary":"completed auth refactor","files":["api/auth.py"]}' \
  --group-id "project-alpha" \
  --customer-key <key>
FlagRequiredDescription
--nameYesEpisode name
--bodyNoEpisode body (text or JSON); mutually exclusive with --body-file
--body-fileNoPath to a file containing the episode body
--group-idNoScope/tenant group
--reference-timeNoISO 8601 timestamp
--source-descriptionNoSource label (default: devvisibility-cli)
--customer-keyYesCustomer key (or DEVVIS_CUSTOMER_KEY env var)
--api-urlNoOverride API base URL
If --body and --body-file are both omitted, the body is read from stdin.

devvis writer add-facts

Create an explicit relationship triplet (source → relationship → target).
devvis writer add-facts \
  --source "dev:fabio" \
  --relationship "COMMITTED" \
  --target "commit:abc1234" \
  --description "Fabio committed abc1234 in auth module" \
  --customer-key <key>
FlagRequiredDescription
--sourceYesSource entity name
--relationshipYesRelationship label
--targetYesTarget entity name
--descriptionYesFact description
--group-idNoScope/tenant group
--source-entity-uuidNoExisting source entity UUID
--target-entity-uuidNoExisting target entity UUID
--customer-keyYesCustomer key (or DEVVIS_CUSTOMER_KEY env var)
--api-urlNoOverride API base URL

devvis writer add-entity

Create an entity by writing a synthetic descriptive episode.
devvis writer add-entity \
  --name "Authentication Module" \
  --type "Component" \
  --summary "JWT auth layer for API" \
  --customer-key <key>
FlagRequiredDescription
--nameYesEntity name
--typeNoEntity type label
--summaryNoEntity summary
--group-idNoScope/tenant group
--customer-keyYesCustomer key (or DEVVIS_CUSTOMER_KEY env var)
--api-urlNoOverride API base URL

Configuration

devvis config show              # Show full resolved configuration
devvis config get api-url       # Show configured API URL
devvis config set api-url <url> # Persist API base URL

devvis version

devvis version
# devvis (go) v0.1.0

Authentication

All commands that call the API require a customer key, resolved in this order:
  1. --customer-key flag
  2. DEVVIS_CUSTOMER_KEY environment variable
  3. .devvis/config.json in the project working directory
  4. Error if none of the above is set
For send-episode (called by hooks), the working directory comes from the cwd field in the Claude Code hook payload — so each project automatically uses its own key without extra configuration. The key is sent as the X-DevVis-Customer-Key HTTP header on all requests.

Local files

PathPurpose
<project>/.devvis/config.jsonPer-project customer key. Created by devvis init.
~/.devvis/hooks.logHook execution log. Rotated to the last 1000 lines when it exceeds 80 KB.
~/.devvis/hooks-debug.jsonlRaw hook payloads in JSONL format (debug). Same rotation policy.
~/.devvis/task-cache/<id>.jsonEphemeral task metadata for create→complete correlation. Purged on session end.
~/.claude/settings.jsonGlobal Claude Code settings. devvis setup-hooks adds hooks here.