kolay-cli
v1.0.0
Published
Official CLI for KolayOcean deployment platform
Maintainers
Readme
Kolay CLI
🌊 The official command-line interface for KolayOcean deployment platform.
Installation
npm install -g kolay-cliOr run directly with npx:
npx kolay-cli --helpQuick Start
# Login to your account
kolay auth login
# Create a new project
kolay projects create
# Deploy your project
kolay deploy my-project --wait
# View deployment logs
kolay logs <deployment-id> --follow
# Add a custom domain
kolay domains add my-project example.comVS Code Integration
The Kolay CLI is perfect for VS Code development workflows. You can use it directly from the integrated terminal:
Setup in VS Code
Install the CLI:
npm install -g kolay-cliLogin from VS Code terminal:
kolay auth loginCreate a project from your current workspace:
# The CLI will auto-detect your package.json settings kolay projects createDeploy with one command:
kolay deploy --wait
VS Code Terminal Commands
Use these commands directly in your VS Code integrated terminal:
# Quick deployment from current project
kolay deploy --wait
# View real-time logs
kolay logs <deployment-id> --follow
# Manage environment variables
kolay env set my-project NODE_ENV production
kolay env set my-project --file .env
# Check project status
kolay projects status
# View all projects
kolay projects listTips for VS Code Users
- The CLI automatically detects your
package.jsonand suggests build commands - Use
kolay deploy --waitto see deployment progress in your terminal - Set up VS Code tasks to automate deployments
- Use the integrated terminal for seamless workflow
Commands
Authentication
kolay auth login # Login to your account
kolay auth logout # Logout
kolay auth whoami # Show current user
kolay auth register # Create new account
kolay auth keys list # List API keys
kolay auth keys create # Create API keyProjects
kolay projects list # List your projects
kolay projects create # Create a new project
kolay projects deploy [name] # Deploy a project
kolay projects status [name] # Show project status
kolay projects delete [name] # Delete a project
# Quick deploy alias
kolay deploy [project] --wait # Deploy and wait for completionDomains
kolay domains list [project] # List domains
kolay domains add <project> <domain> # Add custom domain
kolay domains remove <project> <domain> # Remove domainLogs
kolay logs <deployment-id> # View deployment logs
kolay logs <deployment-id> --follow # Follow log output
kolay logs <deployment-id> --lines 50 # Show last 50 lines
kolay logs <deployment-id> --level error # Filter by levelEnvironment Variables
kolay env list [project] # List environment variables
kolay env set <project> <key> [value] # Set variable
kolay env set <project> --file .env # Load from file
kolay env remove <project> <key> # Remove variableConfiguration
kolay config list # Show current config
kolay config set <key> <value> # Set config value
kolay config get <key> # Get config value
kolay config reset # Reset to defaultsConfiguration
The CLI stores configuration in ~/.kolay/config.json.
Environment Variables
You can override settings with environment variables:
KOLAY_API_URL- Override API URLKOLAY_AUTH_URL- Override Auth API URLKOLAY_TOKEN- Use specific API token
API URLs
Default URLs:
- API:
http://localhost:3000/api - Auth:
http://localhost:4300/api/auth
Production URLs:
- API:
https://api.kolayocean.com - Auth:
https://auth.kolayocean.com/api/auth
Project Detection
When creating projects, the CLI automatically detects:
- Project name from
package.json - Build command from
package.jsonscripts - Framework-specific defaults
Authentication
Login with Email/Password
kolay auth login
# Enter email and password interactivelyAPI Keys
For CI/CD and automation:
# Create an API key
kolay auth keys create --name "CI/CD Pipeline"
# Use API key
export KOLAY_TOKEN=ko_your_api_key_here
kolay projects listSession Management
- Access tokens expire in 1 hour
- Refresh tokens are automatically handled
- Sessions are stored securely in config file
Examples
Deploy a Next.js App
# Login
kolay auth login
# Create project (auto-detects Next.js)
cd my-nextjs-app
kolay projects create
# Deploy with environment variables
kolay env set my-nextjs-app NEXT_PUBLIC_API_URL https://api.example.com
kolay deploy my-nextjs-app --wait
# Add custom domain
kolay domains add my-nextjs-app myapp.example.comCI/CD Integration
# In your CI/CD pipeline
export KOLAY_TOKEN=${{ secrets.KOLAY_TOKEN }}
# Deploy on push to main
kolay deploy my-project --wait
# Check deployment status
if [ $? -eq 0 ]; then
echo "Deployment successful!"
else
echo "Deployment failed"
kolay logs $(kolay projects status my-project --format json | jq -r '.latest_deployment_id')
exit 1
fiLoad Environment Variables
# Create .env file
cat > .env << EOF
API_KEY=secret123
DATABASE_URL=postgres://localhost/myapp
REDIS_URL=redis://localhost:6379
EOF
# Load into project
kolay env set my-project --file .envGlobal Options
--api-url <url> Override API URL
--auth-url <url> Override Auth API URL
--token <token> Use specific API token
--help Show help
--version Show versionTroubleshooting
Common Issues
Authentication Errors
# Clear config and re-login
kolay config reset
kolay auth loginNetwork Errors
# Check API URLs
kolay config list
# Use custom URLs
kolay --api-url https://api.kolayocean.com projects listPermission Errors
# Check token permissions
kolay auth whoami
# Create new API key
kolay auth keys create --name "New Key"Debug Mode
# Enable verbose logging
DEBUG=kolay:* kolay projects deploy my-projectContributing
The CLI is built with TypeScript and Commander.js.
Development Setup
git clone https://github.com/kolaylabs/kolayocean-cli
cd kolayocean-cli
npm install
npm run devBuilding
npm run build
npm pack
npm install -g kolay-cli-1.0.0.tgzLicense
MIT License - see LICENSE for details.
Support
- 📚 Documentation
- 🐛 Issues
- 💬 Discord
