# LawrenceCode **Repository Path**: codeAlwaysPass/lawrence-code ## Basic Information - **Project Name**: LawrenceCode - **Description**: AI IDE - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-28 - **Last Updated**: 2026-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LawrenceCode 基于opencode ui实现的ai coding agent,目前支持deepseek、gemeni配置。 ## 快速开始 ```bash bun install # 绑定数据库 参考下面的 bun run dev:cli bun run dev:server ``` ## 在任意目录运行 CLI > 下面两种方式都支持 `-C/--cwd` 指定目标项目目录;不传时默认使用当前目录。 ### 方式 A:打包成可执行文件 ```bash # 构建可执行文件 bun run --cwd packages/cli build:exe sudo cp packages/cli/dist/lawrencecode /usr/local/bin/lawrencecode sudo chmod +x /usr/local/bin/lawrencecode hash -r ``` 使用: ```bash # 在目标项目目录直接运行 cd /path/to/other-project && lawrencecode # 或者从任意目录指定目标项目 lawrencecode -C /path/to/other-project ``` ### 方式 B:开发期 link(全局命令) ```bash # 在本仓库 cd packages/cli bun run build bun link # 在其它项目目录 cd /path/to/other-project bun link @lawrencecode/cli lawrencecode ``` ## 数据库配置 ### 1. 安装 PostgreSQL(macOS + Homebrew) ```bash brew install postgresql@16 # 将 psql 加入 PATH(Apple Silicon 示例) echo 'export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"' >> ~/.zshrc source ~/.zshrc # 启动服务(开机可自动运行) brew services start postgresql@16 ``` ### 2. 初始化项目数据库 ```bash cp .env.example .env # 若尚未配置 bun run db:setup # 创建用户/库 + 同步 Prisma schema bun run db:generate # 修改 schema 后重新生成 client ``` ### 3. 常用命令 | 命令 | 说明 | | -------------------- | ------------------------------------------ | | `bun run db:start` | 启动本机 Postgres 服务(Homebrew) | | `bun run db:stop` | 停止本机 Postgres 服务 | | `bun run db:setup` | 创建 `lawrencecode` 用户与库,并 `db push` | | `bun run db:push` | 将 schema 推送到本地库 | | `bun run db:migrate` | 使用 migration 管理 schema | | `bun run db:studio` | 打开 Prisma Studio | `.env` 中的连接串: ``` DATABASE_URL=postgresql://lawrencecode:lawrencecode@localhost:5432/lawrencecode ```