Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The 1Code Desktop application uses a tRPC API for internal communication between the Electron main process and renderer process. This API is not exposed externally but powers all desktop functionality.This API is for internal use and extension development only. It is not a public API and may change without notice.
Architecture
The Desktop API uses tRPC for type-safe communication:- Main Process: Electron main process runs the tRPC server
- Renderer Process: React app acts as the tRPC client
- Transport: IPC (Inter-Process Communication) via Electron
API Routers
The Desktop API is organized into routers by domain:Projects
Manage project folders and git repositories
Chats
Create and manage chat sessions and workspaces
Agents
Interact with Claude and Codex agents
Usage Example
From the renderer process:Type Safety
All Desktop API methods are fully type-safe with TypeScript:Error Handling
The Desktop API uses standard tRPC error handling:Database Schema
The Desktop API stores data in a local SQLite database using Drizzle ORM:- projects - Project folders and git info
- chats - Chat sessions (workspaces)
- subChats - Individual conversation threads within a chat
- anthropicAccounts - Claude Code OAuth accounts
- claudeCodeCredentials - Legacy Claude authentication
Source Code
The Desktop API implementation is located in the source code:Next Steps
Projects API
Project management methods
Chats API
Chat and workspace methods
Agents API
Claude and Codex streaming