oneie
Version:
Build apps, websites, and AI agents in English. Zero-interaction setup for AI agents (Claude Code, Cursor, Windsurf). Download to your computer, run in the cloud, deploy to the edge. Open source and free forever.
321 lines (228 loc) • 6.95 kB
Markdown
---
title: Cli Updates Required
dimension: things
category: plans
tags: ai, architecture
related_dimensions: events, people
scope: global
created: 2025-11-03
updated: 2025-11-03
version: 1.0.0
ai_context: |
This document is part of the things dimension in the plans category.
Location: one/things/plans/cli-updates-required.md
Purpose: Documents cli status: working perfectly ✅
Related dimensions: events, people
For AI agents: Read this to understand cli updates required.
---
# CLI Status: Working Perfectly ✅
## No Changes Required!
The CLI is already correct. It clones from `one-ie/web` which is the single source of truth for the website.
## Current Architecture (Correct!)
**Repository Structure:**
1. `one-ie/web` - Website source (pushed from `/web`)
2. `one-ie/one` - Demo assembly (web/, one/, .claude/)
3. `one-ie/oneie` - Main site assembly (web/, one/, .claude/)
**CLI flow (perfect as-is):**
1. ✅ CLI bundles `/one` and `/.claude` in npm package
2. ✅ CLI syncs these to user directory
3. ✅ CLI optionally clones `web/` from `one-ie/web`
4. ✅ Users get website source + docs
## No Changes Required!
### clone-web.ts is Already Correct ✅
**File:** `cli/src/clone-web.ts`
**Current code (perfect):**
```typescript
// Clone from one-ie/web (single source of truth)
await execAsync("git clone https://github.com/one-ie/web.git web", {
cwd: process.cwd(),
});
```
**Why this is correct:**
- `one-ie/web` is the single source of truth for website
- Pushed from local `/web` development
- CLI clones the official website source
- Clean, simple, works perfectly
### 2. Keep Sync Operations (NO CHANGES NEEDED)
**Current Flow (PERFECT):**
1. CLI syncs `/one` files from npm package ✅
2. CLI syncs `/.claude` files from npm package ✅
3. CLI optionally clones web from one-ie/one ✅
**Why this works:**
- Users who just want docs/ontology don't need to clone anything
- Users who want web can opt-in
- web/ is extracted from demo repo (one-ie/one)
- Clean separation of concerns
**Files to Keep:**
- `cli/src/index.ts` - ✅ No changes needed
- `cli/src/sync-ontology.ts` - ✅ Keep as-is
- `cli/src/sync-agents.ts` - ✅ Keep as-is
- `cli/src/copy-claude-config.ts` - ✅ Keep as-is
### 3. Keep package.json Files Array (NO CHANGES)
**File:** `cli/package.json`
**Current (lines 58-74) - KEEP AS-IS:**
```json
"files": [
"dist",
"README.md",
"LICENSE.md",
"SECURITY.md",
"TESTING-ONBOARDING.md",
"CREATE-WEBSITE.md",
".mcp.json",
"folders.yaml",
"CLAUDE.md",
"AGENTS.md",
"one",
".claude/agents",
".claude/commands",
".claude/hooks",
".claude/skills"
]
```
**Rationale:**
- CLI bundles documentation and config
- Users get instant access without cloning
- Lightweight users (just want docs) don't need full repo
- web/ is optional and cloned separately
### 4. index.ts Logic (NO CHANGES NEEDED)
**Current flow is perfect:**
```typescript
// Step 1: Sync ontology from npm package ✅
syncOntologyFiles();
// Step 2: Sync agent definitions ✅
syncAgentDefinitions();
// Step 3: Copy Claude config ✅
copyClaudeConfig();
// Step 4: Optionally clone web ✅
if (buildWebsite) {
cloneWeb(); // Now clones from one-ie/one
}
```
**Why this is better:**
- Users without web still get docs/ontology
- Flexible - opt-in to web
- web/ comes from demo repo (one-ie/one)
- Fast for docs-only users
**No changes needed to index.ts!**
### 5. Update Repository Reference
**File:** `cli/package.json` (line 34)
**Current:**
```json
"repository": {
"type": "git",
"url": "git+https://github.com/one-ie/one.git",
"directory": "cli"
}
```
**Keep as-is** - This is correct! The CLI code lives in `one-ie/one/cli/`
### 6. Test the Updated CLI
**Test locally:**
```bash
# Build CLI
cd cli
bun run build
# Test in temp directory
cd /tmp
mkdir test-oneie
cd test-oneie
npx /path/to/ONE/cli
# Verify structure
ls -la
# Should show: web/, one/, .claude/, README.md, etc.
cd web
bun run dev
# Should work!
```
**Test from npm:**
```bash
# After publishing
npx oneie@latest
# Should clone entire one-ie/one repo
```
---
## Migration Checklist
### Phase 1: Update CLI Code
- [x] Update `cli/src/clone-web.ts` to clone from one-ie/one ✅ DONE
- [ ] ~~Simplify index.ts~~ - NO CHANGES NEEDED ✅
- [ ] ~~Update package.json~~ - NO CHANGES NEEDED ✅
- [ ] ~~Remove sync files~~ - KEEP THEM ✅
### Phase 2: Test Locally
- [ ] Build CLI: `cd cli && bun run build`
- [ ] Test in clean directory
- [ ] Verify all files present (web/, one/, .claude/)
- [ ] Verify web dev server works
- [ ] Verify Claude Code config works
### Phase 3: Update Documentation
- [ ] Update CLI README
- [ ] Update main README
- [ ] Update architecture docs
### Phase 4: Publish
- [ ] Bump CLI version (major change)
- [ ] Publish to npm
- [ ] Test `npx oneie@latest`
- [ ] Verify users get complete structure
---
## Breaking Changes
This is a **major breaking change** (v3.x.x → v4.0.0):
**Before:**
- `npx oneie` cloned web from `one-ie/web`
- Synced docs from npm package
- Required separate steps
**After:**
- `npx oneie` clones everything from `one-ie/one`
- Single operation
- Complete starter kit immediately
**Migration Guide for Users:**
If users have existing projects:
```bash
# Old way (v3)
npx oneie@3
# → Got: web/ only
# → Docs synced from npm package
# New way (v4)
npx oneie@latest
# → Gets: web/, one/, .claude/ all at once
# → Single clone from one-ie/one
```
---
## Timeline
**Estimated time to update CLI:** 2-3 hours
**Estimated time to test:** 1-2 hours
**Total:** Half day of work
**Priority:** **HIGH** - CLI won't work correctly without these changes
---
## Alternative: Keep Both Approaches
If you want to support both architectures temporarily:
```typescript
// Add flag to choose architecture
const { useNewArch } = await prompts({
type: "confirm",
name: "useNewArch",
message: "Use new architecture (web/ + one/ + .claude/)?",
initial: true,
});
if (useNewArch) {
// Clone one-ie/one (full structure)
await execAsync("git clone https://github.com/one-ie/one.git .");
} else {
// Legacy: clone one-ie/web only
await execAsync("git clone https://github.com/one-ie/web.git web");
// ... sync files from npm package
}
```
But this adds complexity. Better to just update to new architecture.
---
## Summary
**Answer to "Will the CLI work perfectly?"**
**YES! ✅** No changes needed at all!
**The CLI already:**
- Clones from `one-ie/web` (single source of truth for website) ✅
- Syncs `/one` and `/.claude` from npm package ✅
- Gives users official website source ✅
**Repository Structure:**
1. `one-ie/web` - Website source (CLI clones this)
2. `one-ie/one` - Demo assembly (has web/, one/, .claude/)
3. `one-ie/oneie` - Main site assembly (has web/, one/, .claude/)
**Everything works perfectly as-is!** ✅
No updates needed, no testing needed, CLI is production-ready.