Local Development Guide
Daily Enterprise development is three commands:
Local Development Guide
Daily Enterprise development is three commands:
bash
1cd enterprise2bash scripts/bootstrap.sh # 首次 / 环境变更3bash scripts/start-dev.sh # 每天开工(需已有 PG)4# 或5bash scripts/start-dev-with-infra.sh # 连同 Docker PG/Redis
Service URLs
| Service | URL |
|---|---|
| Portal | http://localhost:3000 |
| Admin | http://localhost:3001 |
| Gateway | http://localhost:8088/healthz |
Default login
| Side | Account | Password env |
|---|---|---|
| Admin | owner@agenticx.local | ADMIN_CONSOLE_LOGIN_PASSWORD |
| Portal | owner@agenticx.local | AUTH_DEV_OWNER_PASSWORD |
staff@agenticx.local is not in the default seed; create it from the admin console.
bootstrap.sh options
bash
1bash scripts/bootstrap.sh # local(推荐)2bash scripts/bootstrap.sh --mode=server # 非交互,env 必须齐全3bash scripts/bootstrap.sh --reset-db # 销毁 PG 卷重建4bash scripts/bootstrap.sh --skip-docker # 使用外部 PG
What it does: preflight → .env.local → docker PG/Redis → migrate + seed → legacy runtime import → JWT PEM.
start-dev.sh options
bash
1bash scripts/start-dev.sh2bash scripts/start-dev.sh --all # 含 customers/*3bash scripts/start-dev.sh --ui=stream # 纯日志,Ctrl+C 一次退出
- Auto-expands
AUTH_JWT_*_KEY_FILEPEM AGX_AUTO_DB_MIGRATE=1: auto-migrate only against a localhost DB- Ctrl+C cleans up gateway + Next child processes
Connect real models
Recommended: Admin → Platform config → Model services → Add Provider → Probe → Save → Assign user-visible models.
Alternative: append DEEPSEEK_API_KEY=sk-... to .env.local
OIDC SSO
- Set
NEXT_PUBLIC_SSO_PROVIDERSand theSSO_*env vars - See runbooks/sso-oidc-setup.md
- Self-check:
pnpm sso:oidc-smoke
Run pnpm without the scripts
bash
1cd enterprise2set -a; source .env.local; set +a3export AUTH_JWT_PRIVATE_KEY="$(cat "$AUTH_JWT_PRIVATE_KEY_FILE")"4export AUTH_JWT_PUBLIC_KEY="$(cat "$AUTH_JWT_PUBLIC_KEY_FILE")"5pnpm install6pnpm exec turbo run dev \7 --filter=@agenticx/app-web-portal \8 --filter=@agenticx/app-admin-console9# gateway 需另开终端 go run ./apps/gateway/cmd/gateway
Common maintenance
bash
1pnpm migrate:legacy-runtime # JSON → PG2bash scripts/reset-dev-data.sh # 清聊天/用量(见 scripts/README)3pnpm typecheck # 全 monorepo 类型检查4pnpm --filter @agenticx/app-admin-console test # 单 app 测试
Script details
Related docs
Made-with: Damon Li