@teamai/cli
v1.1.0
Published
TeamAI CLI for syncing local folders to sandbox
Downloads
418
Maintainers
Readme
TeamAI CLI
Sync local folders to your TeamAI sandbox in real-time.
Installation
npm install -g @teamai/cliQuick Start
# 1. Authenticate
teamai login
# 2. Link current folder to a chat
teamai init --chat <chatId>
# 3. Start syncing
teamai syncCommands
teamai login
Authenticate with TeamAI. Opens browser for OAuth flow.
teamai loginteamai init
Link current folder to a chat sandbox.
teamai init --chat <chatId>
teamai init --chat <chatId> --profile myprojectOptions:
--chat <chatId>- Chat ID to sync to--profile <name>- Profile name (default: "default")
teamai sync
Start syncing files. Watches for local changes and uploads to sandbox.
# Upload only (local → sandbox)
teamai sync
# Bidirectional sync (local ↔ sandbox)
teamai sync --pullOptions:
--pull- Enable bidirectional sync (downloads from sandbox every 30 seconds)--profile <name>- Profile to use (default: "default")--chat <chatId>- Override chat ID
What it does:
- Watches local files for changes
- Uploads only changed files
- Respects
.gitignorepatterns - Auto-ignores:
node_modules,.git,.env,.DS_Store - Handles deletions, conflicts, and network errors
- Keeps you authenticated automatically
Press Ctrl+C to stop.
teamai pull
Download files from sandbox (one-time).
teamai pull
teamai pull --profile myprojectOptions:
--profile <name>- Profile to use (default: "default")--chat <chatId>- Override chat ID
teamai logout
Log out and clear credentials.
teamai logoutFeatures
🔒 Privacy & Security
- Secure authentication with automatic token management
- Isolated access - only your chat's files
- 1-hour token expiry with auto-renewal
- Privacy-first - cannot see other users' files
⚡ Efficient Syncing
- Smart change detection - only syncs modified files
- Resumable uploads for large files
- Automatic retry on network errors
- Fast and efficient - skips unchanged files
🛡️ Safety & Reliability
- Conflict resolution - keeps both versions (renames local to
.conflict) - Deletion tracking - syncs file deletions
- First-sync safe - won't delete untracked files
- Symlink handling - skipped, not followed
📁 File Filtering
.gitignoresupport - respects your ignore patterns- Hardcoded ignores -
node_modules,.git,.env,.DS_Store - Customizable - add patterns to
.gitignore
How It Works
Sync Modes
Upload-only (teamai sync):
- Watches local files
- Uploads changes to sandbox
- Instant in sandbox
Bidirectional (teamai sync --pull):
- Watches local files + polls sandbox every 30 seconds
- Uploads local changes
- Downloads remote changes
- Detects conflicts (keeps both versions)
Download-only (teamai pull):
- One-time download from sandbox
- Useful for syncing to a new machine
Conflict Resolution
When both local and remote files are modified:
- Detect conflict (both changed since last sync)
- Rename local version to
filename.conflict.ext - Download remote version as
filename.ext - No data loss - you can manually merge
Configuration
Configuration is stored in .teamai/config-{profile}.json:
{
"chatId": "chat-id-here",
"workspaceId": "workspace-id-here",
"localPath": "/path/to/folder"
}Credentials are stored in ~/.teamai/credentials.json:
{
"sessionToken": "your-session-token"
}Troubleshooting
Session expired
Error: Session expired. Run `teamai login` again.Solution: Re-authenticate with teamai login
Chat not found
Error: Chat not found or you don't have access.Solution: Verify the chat ID and ensure you have access
Files not syncing
- Check if file matches
.gitignorepatterns - Check if file is in hardcoded ignore list
- Stop sync (
Ctrl+C) and restart
Conflicts appearing
This is normal when both local and remote are modified. The CLI keeps both versions - you can manually merge them.
Requirements
- Node.js >= 18.0.0
- Internet connection
- TeamAI account with chat access
Privacy & Security
What the CLI can access:
✅ Files in your linked folder only ✅ Your chat's sandbox files only ✅ Cannot see other users' chats or files
Token security:
- Tokens expire in 1 hour
- Auto-renewed every 50 minutes
- Scoped to specific chat path only
- Secure, isolated access per chat
Data handling:
- Encrypted file transfer
- Credentials stored locally only
- No access to other users' data
License
MIT
Support
For issues or questions, contact TeamAI support or file an issue in the repository.
