name: code-editor description: Local code editor integration using code-server (VS Code in browser). Use for editing files without consuming AI tokens. Provides open, edit, diff, and search commands that interface with the local VS Code instance.
Code Editor (VS Code Server) ๐ป
Edit files locally without consuming AI tokens. VS Code running on the server.
Access
Open in browser:
http://YOUR-SERVER-IP:8080
Password: orel895-barber-app-2024
Or use CLI:
Commands
Open File
python3 {baseDir}/scripts/editor.py open src/main.ts
python3 {baseDir}/scripts/editor.py open src/main.ts --line 42
Search in Files
python3 {baseDir}/scripts/editor.py search "TODO"
python3 {baseDir}/scripts/editor.py search "function.*main" --regex
Quick Edit
python3 {baseDir}/scripts/editor.py edit src/file.ts --line 10 --text "console.log('test');"
Compare Files
python3 {baseDir}/scripts/editor.py diff file1.ts file2.ts
Start/Stop Server
python3 {baseDir}/scripts/editor.py start # Start code-server
python3 {baseDir}/scripts/editor.py stop # Stop code-server
python3 {baseDir}/scripts/editor.py status # Check status
Why Use This?
| Task | AI Tokens | Code Editor |
|---|---|---|
| Edit file | โ Burns tokens | โ Free |
| Search code | โ Burns tokens | โ Free |
| Format code | โ Burns tokens | โ Free |
| Refactor | โ Sometimes needed | โ Manual |
| Complex changes | โ AI better | โ ๏ธ Human needed |
Workflow
Token-Efficient Development:
- Use code-editor for simple edits, searches, formatting
- Use AI only for complex logic, debugging, architecture
- Save tokens for Expo, GitHub API calls, notifications
Example Session:
# Open project in editor
editor.py open .
# Search for something
editor.py search "oldFunctionName"
# Quick fix
editor.py edit src/utils.ts --line 23 --text "const newName = () => {}"
# Complex refactor - use AI
antigravity.py refactor src/utils.ts --target "Convert to async"
Integration
With Terminal
terminal.py run "editor.py open package.json"
With Git
# Edit, then commit
editor.py edit src/feature.ts --line 10 --text "// Fixed"
gitcycle.py full -m "Fix typo"
Configuration
{
"code-editor": {
"port": 8080,
"password": "your-password",
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
}
Best Practices
- Simple edits โ Use code-editor (free)
- Complex logic โ Use AI (worth the tokens)
- Formatting โ Use code-editor (Prettier extension)
- Debugging โ Use AI (better understanding)
- Bulk find/replace โ Use code-editor
Access URL
Local: http://localhost:8080 Remote: http://YOUR-SERVER-IP:8080
Password: orel895-barber-app-2024