Initialize Context in the current directory.
context init [options]Options:
| Option | Description |
|---|---|
-f, --force |
Force reinitialization, recreating the index |
Example:
context init
context init --forceIndex the repository. This scans all files, extracts symbols, and builds the import graph.
context index [options]Options:
| Option | Description |
|---|---|
-v, --verbose |
Show detailed output |
Example:
context index
context index --verboseThe index is stored in .context/index.db and is automatically updated when you run context pack.
Create a context pack for a task.
context pack [options]Options:
| Option | Description |
|---|---|
-t, --task <description> |
Task description |
-e, --error <file> |
Error log file path |
--since <duration> |
Filter error log (e.g., 1h, 2h, 30m) |
-d, --diff <ref> |
Git diff reference (e.g., origin/main) |
-f, --file <path> |
Specific file to analyze |
-s, --symbol <name> |
Specific symbol to focus on |
--max-files <number> |
Maximum files to include (default: 25) |
--include <categories> |
Include categories (comma-separated: tests,config,docs) |
--exclude <patterns> |
Exclude patterns (comma-separated) |
--focus <domains> |
Focus on domains (comma-separated: auth,payments,api) |
-v, --verbose |
Verbose output |
Examples:
# Interactive mode with autocomplete
context pack
# Task-based
context pack --task "Fix the checkout payment flow"
# Error-driven
context pack --error storage/logs/laravel.log --since 1h
# Diff-based
context pack --diff origin/main
# File-focused
context pack --file app/Services/StripeService.php --symbol handleWebhook
# Combined
context pack --task "Fix webhook" --diff origin/main --focus paymentsWhen run without arguments in a terminal, context pack enters interactive mode with real-time autocomplete:
context packEnter task (use @ for autocomplete): _
Using @ references:
The @ character triggers autocomplete for files and symbols from your indexed codebase:
| Reference | Description | Example |
|---|---|---|
@filename |
Match files by name | @UserController |
@path/to/ |
Match files by path | @app/Models/User.php |
@symbolName |
Match symbols (classes, methods) | @handlePayment |
@ucon |
Match acronyms (case-insensitive, 3+ chars) | @UserController |
@ucont |
Match acronyms with prefixes | @UserController |
Keyboard controls:
| Key | Action |
|---|---|
Tab |
Accept highlighted suggestion |
Up/Down |
Navigate suggestions |
Enter |
Submit task |
Ctrl+C |
Cancel |
Examples:
Fix validation in @UserController createUser method
Refactor @PaymentService to use @StripeClient
Bug in @app/Models/User.php when saving
Files and symbols referenced with @ are automatically prioritized in the discovery results.
See Getting Started - Interactive Mode for a detailed guide.
List all context packs.
context list [options]
context ls [options]Options:
| Option | Description |
|---|---|
-n, --limit <number> |
Number of packs to show |
Example:
context list
context ls
context list --limit 10Output:
Context Packs
DATE TIME TASK FILES
---------- -------- ---------------------------------------- -----
2026-02-02 14:30:22 fix-payment-webhook-handler 12
2026-02-02 10:15:00 add-user-validation 8
2026-02-01 16:45:30 refactor-auth-service 15
Open a context pack in your file manager or editor.
context open [pack] [options]Arguments:
| Argument | Description |
|---|---|
pack |
Pack slug or prefix (optional, opens most recent if not specified) |
Options:
| Option | Description |
|---|---|
-f, --file <name> |
Open a specific file (e.g., PACK.md) |
Example:
# Open most recent pack
context open
# Open specific pack by full slug
context open 20260202-143022-fix-payment-webhook
# Open specific pack by prefix
context open 20260202-143022
# Open specific file from most recent pack
context open --file PACK.md
# Open specific file from specific pack
context open 20260202-143022-fix-payment-webhook --file PACK.mdManage domain definitions for task analysis. Domains help Context understand the conceptual areas of your codebase.
List all active domains.
context domains list [options]Options:
| Option | Description |
|---|---|
-a, --all |
Show all domains including disabled |
-v, --verbose |
Show keywords for each domain |
Example:
context domains list
context domains list --all --verboseAdd a custom domain.
context domains add <name> --keywords <keywords> [options]Options:
| Option | Description |
|---|---|
-k, --keywords <keywords> |
Comma-separated keywords (required) |
-d, --description <description> |
Domain description |
Example:
context domains add billing --keywords "invoice,subscription,payment,charge" --description "Billing and subscriptions"Remove a custom domain or disable a built-in domain.
context domains remove <name>Example:
context domains remove billingRe-enable a previously disabled domain.
context domains enable <name>Example:
context domains enable auth