Documentation Index
Fetch the complete documentation index at: https://mintlify.com/antinomyhq/forge/llms.txt
Use this file to discover all available pages before exploring further.
The workspace command group manages semantic code search, allowing you to index directories and perform intelligent queries across your codebase.
Usage
forge workspace [SUBCOMMAND] [OPTIONS]
Subcommands
sync
Synchronize a directory for semantic search by indexing its contents.
forge workspace sync [PATH] [OPTIONS]
Path to the directory to sync. Defaults to current directory.forge workspace sync
forge workspace sync ~/projects/myapp
forge workspace sync /path/to/repo
Number of files to process concurrently.forge workspace sync --batch-size 50
forge workspace sync . --batch-size 200
list
List all indexed workspaces.
forge workspace list [OPTIONS]
Output in machine-readable format.Alias: -pforge workspace list --porcelain
forge workspace list -p
query
Query the workspace using semantic search.
forge workspace query <QUERY> [PATH] [OPTIONS]
Search query.forge workspace query "authentication logic"
forge workspace query "error handling"
Path to the directory to search. Defaults to current directory.forge workspace query "database queries" .
forge workspace query "API endpoints" ~/projects/api
Maximum number of results to return.Alias: -lforge workspace query "tests" -l 20
forge workspace query "config" --limit 5
Number of highest probability tokens to consider (1-1000).forge workspace query "imports" --top-k 100
Describe your intent or goal to filter results for relevance.Alias: -rforge workspace query "http" -r "finding API route handlers"
forge workspace query "test" --use-case "locating integration tests"
Filter results to files starting with this prefix.forge workspace query "utils" --starts-with src/
forge workspace query "config" --starts-with packages/core
Filter results to files ending with this suffix.forge workspace query "tests" --ends-with .test.ts
forge workspace query "types" --ends-with .d.ts
info
Show workspace information for an indexed directory.
forge workspace info [PATH]
Path to the directory to get information for. Defaults to current directory.forge workspace info
forge workspace info ~/projects/myapp
delete
Delete one or more workspaces.
forge workspace delete <WORKSPACE_ID>...
Workspace IDs to delete. Multiple IDs can be specified.forge workspace delete abc123
forge workspace delete abc123 def456 ghi789
status
Show sync status of all files in the workspace.
forge workspace status [PATH] [OPTIONS]
Path to the directory to check status for. Defaults to current directory.forge workspace status
forge workspace status ~/projects/myapp
Output in machine-readable format.Alias: -pforge workspace status --porcelain
forge workspace status . -p
init
Initialize an empty workspace for the provided directory.
forge workspace init [PATH]
Path to the directory to initialize as a workspace. Defaults to current directory.forge workspace init
forge workspace init ~/projects/newapp
Examples
Sync Current Directory
Example output:
Indexing workspace: /home/user/projects/myapp
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
✓ Indexed 1,247 files in 23 seconds
Sync with Custom Batch Size
forge workspace sync ~/projects/large-repo --batch-size 200
List All Workspaces
Example output:
Indexed Workspaces:
ID Path Files Last Synced
abc123 /home/user/projects/myapp 1,247 2024-01-15 10:23
def456 /home/user/projects/api 856 2024-01-14 16:45
ghi789 /home/user/projects/frontend 2,341 2024-01-13 09:12
Query Workspace
forge workspace query "authentication logic" -r "finding login implementation"
Example output:
Search Results:
1. src/auth/login.ts (score: 0.94)
Implementation of user authentication and session management
2. src/middleware/auth.ts (score: 0.87)
Authentication middleware for API routes
3. tests/auth.test.ts (score: 0.82)
Integration tests for authentication flow
Query with Filters
forge workspace query "error handling" \
--limit 5 \
--starts-with src/ \
--ends-with .ts \
-r "finding error handling patterns"
View Workspace Status
Example output:
Workspace Status: /home/user/projects/myapp
Status Files
Indexed 1,247
Modified 3
New 5
Deleted 2
Out of sync files:
M src/auth/login.ts
M src/api/users.ts
M README.md
A src/utils/new-helper.ts
A tests/new-test.test.ts
D old-file.ts
Run 'forge workspace sync' to update the index.
Get Workspace Info
Example output:
Workspace Information:
ID: abc123
Path: /home/user/projects/myapp
Files: 1,247
Total size: 12.4 MB
Last synced: 2024-01-15 10:23
Created: 2024-01-10 14:30
Delete Workspace
forge workspace delete abc123
Example output:
✓ Workspace deleted: abc123
Initialize New Workspace
forge workspace init ~/projects/newapp
Example output:
✓ Workspace initialized: /home/user/projects/newapp
Run 'forge workspace sync' to index files.
Use Cases
Finding Specific Code Patterns
forge workspace query "database migrations" \
-r "locating migration files" \
--ends-with .sql
Locating Test Files
forge workspace query "user authentication" \
-r "finding relevant test files" \
--starts-with tests/ \
--ends-with .test.ts
Exploring New Codebase
forge workspace query "entry point" \
-r "finding main application entry points" \
--limit 3
Machine-Readable Output
forge workspace list --porcelain | jq '.workspaces[] | select(.files > 1000)'
forge workspace status --porcelain
Storage Location
Workspace indexes are stored in:
~/.local/share/forge/workspaces/
- Use
--batch-size to adjust indexing speed based on your system
- Larger batch sizes (200-500) work well for SSDs
- Smaller batch sizes (50-100) may be better for HDDs
- Re-sync periodically to keep the index up to date
forge - AI assistant can use workspace search automatically
forge list workspace - Alternative way to list workspaces
Notes
- Workspaces must be synced before querying
- The
sync command respects .gitignore files
- Semantic search uses AI embeddings for intelligent matching
- Query results are ranked by relevance
- Use
--use-case to improve result relevance
- File filters (
--starts-with, --ends-with) narrow results efficiently