How useshape/shape works
Shape is a desktop coding agent built with a React/Next.js frontend and a Tauri/Rust runtime. The user opens a project into the agent workspace, where chat, editing, preview, terminal, and Git tools support coding tasks; the frontend also exposes onboarding, settings, and a standalone Git manager. The README additionally highlights model choice and plugin integrations. Several capabilities are represented by tree paths but their runtime wiring was not sampled, so those links are marked unverified rather than asserted as calls.
Main entry points: client-layout.tsx Client shell · layout.tsx Agent workspace · mod.rs Agent runtime · commands.ts Backend bridge
Components 21
App workflow
- Client shell
app/client-layout.tsx - Project host
components/layout/main.tsx - Git manager route
app/git/page.tsx - Settings
features/settings/ui/settings.tsx
Coding workspace
- Agent workspace
features/agent/layout.tsx - Code editor
features/editor/ui/main/editor.tsx - Workspace views
features/agent/workspace/index.tsx - Preview panel
features/preview/ui/preview-panel.tsx - Terminal
features/terminal/ui/terminal.tsx - Git manager
features/git/ui/manager/git-manager.tsx
Agent capabilities
- Chat session
features/chat/lib/use-chat-session.ts - Chat stream
features/chat/lib/chat-stream-store.tsx - Agent runtime
src-tauri/src/agent/mod.rs - Model routing
src-tauri/src/agent/model_router.rs
Desktop platform
- Backend bridge
lib/backend/commands.ts - Tauri runtime
src-tauri/src/lib.rs
Account integrations
- MCP integrations
src-tauri/src/mcp/client.rs - Plugin support
lib/plugins/api.ts - Account services
lib/cloud/store.ts
Other components
- User
- Shape API
Connections 22
- User → Client shell: opens app
- Client shell → Project host: renders
app/client-layout.tsx - Project host → Agent workspace: renders
components/layout/main.tsx - Project host → Backend bridge: uses commands
components/layout/main.tsx - User → Git manager route: opens Git
- Git manager route → Git manager: renders
app/git/page.tsx - Agent workspace → Chat session: hosts chat
- Chat session → Chat stream: updates stream
- Agent workspace → Workspace views: hosts views
- Workspace views → Code editor: shows editor
- Workspace views → Preview panel: shows preview
- Agent workspace → Terminal: hosts terminal
- Git manager → Backend bridge: uses project state
features/git/ui/manager/git-manager.tsx - Backend bridge → Tauri runtime: invokes desktop commands
- Tauri runtime → Agent runtime: registers runtime
src-tauri/src/lib.rs - Agent runtime → Model routing: routes models
- Agent runtime → MCP integrations: uses MCP
- Agent runtime → Plugin support: uses plugins
- Client shell → Settings: hosts settings
- Client shell → Account services: initializes account store
app/client-layout.tsx - Account services → Shape API: calls account API
lib/cloud/store.ts - Account services → Backend bridge: persists tokens
lib/cloud/store.ts