grepai-workspaces by yoanbernabeu/grepai-skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-workspaces此技能涵盖使用 GrepAI 工作空间来管理多个相关项目,并拥有统一的搜索索引。
工作空间允许您:
grepai workspace create my-workspace
输出:
✅ Workspace 'my-workspace' created
Location: ~/.grepai/workspaces/my-workspace/
Next: Add projects with 'grepai workspace add'
# 添加第一个项目
grepai workspace add my-workspace /path/to/frontend
# 添加更多项目
grepai workspace add my-workspace /path/to/backend
grepai workspace add my-workspace /path/to/shared-lib
输出:
✅ Added '/path/to/frontend' to workspace 'my-workspace'
Projects in workspace:
1. frontend (/path/to/frontend)
Run 'grepai watch --workspace my-workspace' to index all projects.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
grepai workspace list
输出:
📁 Workspaces
1. my-workspace
- Projects: 3
- Status: Not indexed
2. work-projects
- Projects: 5
- Status: Indexed (updated 2h ago)
grepai workspace show my-workspace
输出:
📁 Workspace: my-workspace
Projects:
1. frontend
Path: /path/to/frontend
Files: 450
Last indexed: 2025-01-28 10:30
2. backend
Path: /path/to/backend
Files: 320
Last indexed: 2025-01-28 10:30
3. shared-lib
Path: /path/to/shared-lib
Files: 85
Last indexed: 2025-01-28 10:30
Total: 855 files, 4,200 chunks
# 为工作空间中的所有项目建立索引
grepai watch --workspace my-workspace
输出:
🔍 Indexing workspace 'my-workspace'
[1/3] frontend...
Found 450 files, 2,100 chunks
[2/3] backend...
Found 320 files, 1,500 chunks
[3/3] shared-lib...
Found 85 files, 600 chunks
Total: 855 files, 4,200 chunks indexed
Watching for changes...
grepai watch --workspace my-workspace --background
grepai search --workspace my-workspace "user authentication"
结果包含项目上下文:
Score: 0.89 | [backend] src/auth/middleware.go:15-45
──────────────────────────────────────────
func AuthMiddleware() ...
Score: 0.85 | [frontend] src/hooks/useAuth.ts:10-30
──────────────────────────────────────────
export function useAuth() ...
Score: 0.78 | [shared-lib] src/types/auth.ts:5-25
──────────────────────────────────────────
export interface AuthState ...
grepai search --workspace my-workspace --project frontend "form validation"
仅搜索 frontend 项目。
grepai workspace status my-workspace
输出:
📊 Workspace Status: my-workspace
Projects: 3
Total files: 855
Total chunks: 4,200
Index size: 45 MB
Per-project breakdown:
┌─────────────┬───────┬────────┬──────────┐
│ Project │ Files │ Chunks │ Updated │
├─────────────┼───────┼────────┼──────────┤
│ frontend │ 450 │ 2,100 │ 2h ago │
│ backend │ 320 │ 1,500 │ 2h ago │
│ shared-lib │ 85 │ 600 │ 2h ago │
└─────────────┴───────┴────────┴──────────┘
Daemon: Running (PID 12345)
grepai workspace remove my-workspace /path/to/old-project
grepai workspace delete my-workspace
此操作会移除工作空间配置,但不会删除项目文件。
工作空间将配置存储在 ~/.grepai/workspaces/<name>/ 目录下:
~/.grepai/workspaces/my-workspace/
├── workspace.yaml # 工作空间配置
├── index.gob # 合并的索引
└── symbols.gob # 合并的符号
name: my-workspace
created: 2025-01-28T10:00:00Z
projects:
- name: frontend
path: /path/to/frontend
- name: backend
path: /path/to/backend
- name: shared-lib
path: /path/to/shared-lib
# 可选:为每个工作空间覆盖全局配置
embedder:
provider: ollama
model: nomic-embed-text
ignore:
- node_modules
- dist
与 MCP 服务器一起使用工作空间:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve", "--workspace", "my-workspace"]
}
}
}
# 完整的单体仓库
grepai workspace create monorepo
grepai workspace add monorepo /path/to/monorepo/apps/web
grepai workspace add monorepo /path/to/monorepo/apps/mobile
grepai workspace add monorepo /path/to/monorepo/packages/ui
grepai workspace add monorepo /path/to/monorepo/packages/core
# 相关的微服务
grepai workspace create services
grepai workspace add services /path/to/user-service
grepai workspace add services /path/to/order-service
grepai workspace add services /path/to/payment-service
grepai workspace add services /path/to/notification-service
# 全栈
grepai workspace create fullstack
grepai workspace add fullstack /path/to/frontend
grepai workspace add fullstack /path/to/backend
grepai workspace add fullstack /path/to/shared-types
grepai search --workspace services "REST API endpoint handler"
grepai search --workspace fullstack "User interface definition"
# 谁调用了共享的认证库?
grepai trace callers --workspace fullstack "validateToken"
ecommerce-stack 而不是 ws1grepai watch --workspace❌ 问题: 找不到工作空间
✅ 解决方案: 检查工作空间是否存在:grepai workspace list
❌ 问题: 项目路径已更改 ✅ 解决方案: 移除旧路径,添加新路径:
grepai workspace remove my-workspace /old/path
grepai workspace add my-workspace /new/path
❌ 问题: 搜索返回混合结果
✅ 解决方案: 使用 --project 标志进行过滤:
grepai search --workspace ws --project backend "query"
工作空间概览:
📁 Workspace: my-workspace
Configuration:
- Location: ~/.grepai/workspaces/my-workspace/
- Created: 2025-01-28
Projects (3):
┌─────────────┬──────────────────────────┬───────┐
│ Name │ Path │ Files │
├─────────────┼──────────────────────────┼───────┤
│ frontend │ /path/to/frontend │ 450 │
│ backend │ /path/to/backend │ 320 │
│ shared-lib │ /path/to/shared-lib │ 85 │
└─────────────┴──────────────────────────┴───────┘
Commands:
- Index: grepai watch --workspace my-workspace
- Search: grepai search --workspace my-workspace "query"
- Status: grepai workspace status my-workspace
每周安装次数
248
代码仓库
GitHub 星标数
15
首次出现
2026年1月28日
安全审计
安装于
opencode198
codex193
gemini-cli178
github-copilot177
kimi-cli165
amp163
This skill covers using GrepAI workspaces to manage multiple related projects with a unified search index.
Workspaces allow you to:
grepai workspace create my-workspace
Output:
✅ Workspace 'my-workspace' created
Location: ~/.grepai/workspaces/my-workspace/
Next: Add projects with 'grepai workspace add'
# Add first project
grepai workspace add my-workspace /path/to/frontend
# Add more projects
grepai workspace add my-workspace /path/to/backend
grepai workspace add my-workspace /path/to/shared-lib
Output:
✅ Added '/path/to/frontend' to workspace 'my-workspace'
Projects in workspace:
1. frontend (/path/to/frontend)
Run 'grepai watch --workspace my-workspace' to index all projects.
grepai workspace list
Output:
📁 Workspaces
1. my-workspace
- Projects: 3
- Status: Not indexed
2. work-projects
- Projects: 5
- Status: Indexed (updated 2h ago)
grepai workspace show my-workspace
Output:
📁 Workspace: my-workspace
Projects:
1. frontend
Path: /path/to/frontend
Files: 450
Last indexed: 2025-01-28 10:30
2. backend
Path: /path/to/backend
Files: 320
Last indexed: 2025-01-28 10:30
3. shared-lib
Path: /path/to/shared-lib
Files: 85
Last indexed: 2025-01-28 10:30
Total: 855 files, 4,200 chunks
# Index all projects in workspace
grepai watch --workspace my-workspace
Output:
🔍 Indexing workspace 'my-workspace'
[1/3] frontend...
Found 450 files, 2,100 chunks
[2/3] backend...
Found 320 files, 1,500 chunks
[3/3] shared-lib...
Found 85 files, 600 chunks
Total: 855 files, 4,200 chunks indexed
Watching for changes...
grepai watch --workspace my-workspace --background
grepai search --workspace my-workspace "user authentication"
Results include project context:
Score: 0.89 | [backend] src/auth/middleware.go:15-45
──────────────────────────────────────────
func AuthMiddleware() ...
Score: 0.85 | [frontend] src/hooks/useAuth.ts:10-30
──────────────────────────────────────────
export function useAuth() ...
Score: 0.78 | [shared-lib] src/types/auth.ts:5-25
──────────────────────────────────────────
export interface AuthState ...
grepai search --workspace my-workspace --project frontend "form validation"
Only searches the frontend project.
grepai workspace status my-workspace
Output:
📊 Workspace Status: my-workspace
Projects: 3
Total files: 855
Total chunks: 4,200
Index size: 45 MB
Per-project breakdown:
┌─────────────┬───────┬────────┬──────────┐
│ Project │ Files │ Chunks │ Updated │
├─────────────┼───────┼────────┼──────────┤
│ frontend │ 450 │ 2,100 │ 2h ago │
│ backend │ 320 │ 1,500 │ 2h ago │
│ shared-lib │ 85 │ 600 │ 2h ago │
└─────────────┴───────┴────────┴──────────┘
Daemon: Running (PID 12345)
grepai workspace remove my-workspace /path/to/old-project
grepai workspace delete my-workspace
This removes the workspace configuration but NOT the project files.
Workspaces store config in ~/.grepai/workspaces/<name>/:
~/.grepai/workspaces/my-workspace/
├── workspace.yaml # Workspace config
├── index.gob # Combined index
└── symbols.gob # Combined symbols
name: my-workspace
created: 2025-01-28T10:00:00Z
projects:
- name: frontend
path: /path/to/frontend
- name: backend
path: /path/to/backend
- name: shared-lib
path: /path/to/shared-lib
# Optional: override global config per workspace
embedder:
provider: ollama
model: nomic-embed-text
ignore:
- node_modules
- dist
Use workspaces with MCP servers:
{
"mcpServers": {
"grepai": {
"command": "grepai",
"args": ["mcp-serve", "--workspace", "my-workspace"]
}
}
}
# Full monorepo
grepai workspace create monorepo
grepai workspace add monorepo /path/to/monorepo/apps/web
grepai workspace add monorepo /path/to/monorepo/apps/mobile
grepai workspace add monorepo /path/to/monorepo/packages/ui
grepai workspace add monorepo /path/to/monorepo/packages/core
# Related microservices
grepai workspace create services
grepai workspace add services /path/to/user-service
grepai workspace add services /path/to/order-service
grepai workspace add services /path/to/payment-service
grepai workspace add services /path/to/notification-service
# Full stack
grepai workspace create fullstack
grepai workspace add fullstack /path/to/frontend
grepai workspace add fullstack /path/to/backend
grepai workspace add fullstack /path/to/shared-types
grepai search --workspace services "REST API endpoint handler"
grepai search --workspace fullstack "User interface definition"
# What calls the shared auth library?
grepai trace callers --workspace fullstack "validateToken"
ecommerce-stack not ws1grepai watch --workspace❌ Problem: Workspace not found ✅ Solution: Check workspace exists: grepai workspace list
❌ Problem: Project paths changed ✅ Solution: Remove old path, add new path:
grepai workspace remove my-workspace /old/path
grepai workspace add my-workspace /new/path
❌ Problem: Search returns mixed results ✅ Solution: Use --project flag to filter:
grepai search --workspace ws --project backend "query"
Workspace overview:
📁 Workspace: my-workspace
Configuration:
- Location: ~/.grepai/workspaces/my-workspace/
- Created: 2025-01-28
Projects (3):
┌─────────────┬──────────────────────────┬───────┐
│ Name │ Path │ Files │
├─────────────┼──────────────────────────┼───────┤
│ frontend │ /path/to/frontend │ 450 │
│ backend │ /path/to/backend │ 320 │
│ shared-lib │ /path/to/shared-lib │ 85 │
└─────────────┴──────────────────────────┴───────┘
Commands:
- Index: grepai watch --workspace my-workspace
- Search: grepai search --workspace my-workspace "query"
- Status: grepai workspace status my-workspace
Weekly Installs
248
Repository
GitHub Stars
15
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode198
codex193
gemini-cli178
github-copilot177
kimi-cli165
amp163
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装