This guide covers everything needed to set up this AI-native development environment from scratch, including local databases, SSL certificates, and common services.
- Initial Installation
- Local Databases
- SSL Certificates
- Local Services
- Development Helpers
- Troubleshooting
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"git clone https://github.com/YOUR_USERNAME/devkit.git ~/devkit
cd ~/devkit# Install from Brewfile
brew bundle --file=Brewfile
# Install Node version manager (nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install Python version manager (uv)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install Rust (if using Rust)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh# Shell configuration
mkdir -p ~/.config/zsh
ln -sf ~/devkit/.zshrc ~/.zshrc
# Zellij
mkdir -p ~/.config/zellij
ln -sf ~/devkit/zellij/config.kdl ~/.config/zellij/config.kdl
ln -sf ~/devkit/zellij/layouts ~/.config/zellij/layouts
# Ghostty
mkdir -p ~/.config/ghostty
ln -sf ~/devkit/.config/ghostty/config ~/.config/ghostty/config
# Git delta (syntax-highlighted diffs)
# Add to your ~/.gitconfig:
git config --global include.path ~/devkit/.config/git/delta.gitconfig
# Shell enhancements (zoxide, fzf+fd, eza aliases)
# Add to your .zshrc:
echo 'source ~/devkit/.config/shell/enhancements.zsh' >> ~/.zshrc
# SSH (if applicable)
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Copy any SSH keys if needed# Create project workspace
mkdir -p ~/projects
mkdir -p ~/.local/bin
mkdir -p ~/.local/etc
# Copy helper scripts
cp ~/devkit/scripts/* ~/.local/bin/
chmod +x ~/.local/bin/*# Check all tools are installed
zellij --version
ghostty --version
lazygit --version
yazi --version
bat --version
rg --version
# Verify new tools
eza --version
fd --version
fzf --version
zoxide --version
delta --version
jq --version
tldr --version
dust --version
# Verify node/python/go
node --version
python --version
go version# Install PostgreSQL
brew install postgresql@15
# Start PostgreSQL service
brew services start postgresql@15
# Verify installation
psql --version# Create a default development database
createdb mydeveloper
createuser devuser -P # Will prompt for password
# Grant permissions
psql -d mydeveloper -c "GRANT ALL PRIVILEGES ON DATABASE mydeveloper TO devuser;"Host: localhost
Port: 5432
User: devuser
Password: (your choice)
Database: mydeveloper
Use Postico 2 (already in Brewfile) to browse databases visually.
open -a Postico\ 2# Install Redis
brew install redis
# Start Redis service
brew services start redis
# Verify installation
redis-cli ping
# Expected output: PONG# Connect to Redis
redis-cli
# In the Redis CLI:
SET testkey "Hello Redis"
GET testkey# Install MongoDB
brew install mongodb-community
# Start MongoDB
brew services start mongodb-community
# Verify connection
mongosh
# In mongosh:
db.adminCommand('ping')For local development, use the provided script:
~/.local/bin/setup-ssl.sh
# Or manually:
mkdir -p ~/.local/etc/ssl
cd ~/.local/etc/ssl
# Generate private key
openssl genrsa -out localhost.key 2048
# Generate certificate (10 years)
openssl req -new -x509 -key localhost.key -out localhost.crt -days 3650 \
-subj "/C=US/ST=State/L=City/O=Dev/CN=localhost"sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.local/etc/ssl/localhost.crt# For Node.js
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync(process.env.HOME + '/.local/etc/ssl/localhost.key'),
cert: fs.readFileSync(process.env.HOME + '/.local/etc/ssl/localhost.crt')
};
https.createServer(options, app).listen(3000);# For Python (Flask)
from flask import Flask
app = Flask(__name__)
if __name__ == '__main__':
app.run(ssl_context=(
os.path.expanduser('~/.local/etc/ssl/localhost.crt'),
os.path.expanduser('~/.local/etc/ssl/localhost.key')
))# Start all services at once
~/.local/bin/start-services.sh
# Or individually:
brew services start postgresql@15
brew services start redis
brew services start docker~/.local/bin/stop-services.sh
# Or individually:
brew services stop postgresql@15
brew services stop redis
brew services stop dockerbrew services listCopy the template and customize:
cp ~/devkit/.env.example ~/.env
source ~/.envExample .env file:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=devuser
DB_PASSWORD=your_password
DB_NAME=mydeveloper
# Redis
REDIS_URL=redis://localhost:6379
# Development
NODE_ENV=development
PYTHON_ENV=development
DEBUG=true
# API Keys (populate as needed)
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GEMINI_API_KEY=
# Local Services
SSL_CERT=$HOME/.local/etc/ssl/localhost.crt
SSL_KEY=$HOME/.local/etc/ssl/localhost.keyAdd to your shell config (.zshrc):
alias db-connect='psql -d mydeveloper -U devuser'
alias db-dump='pg_dump -d mydeveloper -U devuser > ~/backup.sql'
alias db-restore='psql -d mydeveloper -U devuser < ~/backup.sql'
alias redis-cli='redis-cli -h localhost -p 6379'
alias services-status='brew services list'
alias dev-logs='tail -f ~/.local/var/logs/dev.log'Common development ports:
| Service | Port | Start Command |
|---|---|---|
| PostgreSQL | 5432 | brew services start postgresql@15 |
| Redis | 6379 | brew services start redis |
| Node.js App | 3000 | npm run dev |
| Python App | 8000 | python -m uvicorn app:app |
| Docker | 2375 | brew services start docker |
| Local HTTPS | 3443 | node server.js |
lsof -i :3000 # Check if port 3000 is in use
kill -9 <PID> # Kill process if needed# Check if already running
brew services list | grep postgresql
# Restart
brew services restart postgresql@15
# Check logs
tail -f /opt/homebrew/var/log/postgresql@15.log# Verify Redis is running
redis-cli ping
# Check if port 6379 is in use
lsof -i :6379
# Restart
brew services restart redis# Re-add to keychain
sudo security delete-certificate -c "localhost" /Library/Keychains/System.keychain
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.local/etc/ssl/localhost.crt# Reload layout
zellij action new-tab --layout ~/devkit/zellij/layouts/main.kdl
# Reset to default
rm -rf ~/.config/zellij
ln -sf ~/devkit/zellij ~/.config/zellij# Find and kill process
lsof -i :PORT_NUMBER
kill -9 <PID>
# Or use different port in development# Install Python version
uv python install 3.11
# Create virtual environment
uv venv
# Activate
source .venv/bin/activate# Install Node version
nvm install 20
# Use it
nvm use 20
# Verify
node --version# Verify Go installation
go version
# Initialize module
go mod init github.com/yourusername/projectname# Verify .NET installation
dotnet --version
# Create new project
dotnet new console -n MyProject
cd MyProject
dotnet run- Read TOOLS.md — Deep dive into each tool
- Check CHEATSHEET.md — Keyboard shortcuts and workflows
- Review TROUBLESHOOTING.md — Common issues
- Explore AI Agents — See
opencode/aig_agents/for agent configs
Happy hacking! 🚀