| description | macOS Development Environment Setup |
|---|
This guide covers setting up a complete development environment for Netcap on macOS.
If you don't have Homebrew installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install Go 1.21 or later:
brew install goVerify installation:
go versionNetcap uses Protocol Buffers for efficient data serialization. Install the protoc compiler:
brew install protobufVerify installation:
protoc --versionNetcap generates Protocol Buffer code for multiple languages. Install all required plugins:
The gogofaster plugin generates optimized Go code:
go install github.com/gogo/protobuf/protoc-gen-gogofaster@latestVerify installation:
which protoc-gen-gogofaster
# Should output: /Users/USERNAME/go/bin/protoc-gen-gogofasterFor Swift code generation:
brew install swift-protobufVerify installation:
which protoc-gen-swift
# Should output: /opt/homebrew/bin/protoc-gen-swiftFor JavaScript code generation:
npm install -g protoc-gen-jsVerify installation:
which protoc-gen-js
# Should output: /Users/USERNAME/.npm-global/bin/protoc-gen-js (or similar)The following plugins are built into protoc and require no separate installation:
- Python (
--python_out) - Java (
--java_out) - C++ (
--cpp_out) - C# (
--csharp_out)
Run this command to verify all plugins are installed:
echo "✓ protoc: $(protoc --version)"
echo "✓ protoc-gen-gogofaster: $(which protoc-gen-gogofaster)"
echo "✓ protoc-gen-swift: $(which protoc-gen-swift)"
echo "✓ protoc-gen-js: $(which protoc-gen-js)"git clone https://github.com/dreadl0ck/netcap.git
cd netcapNetcap uses the Zeus build system:
go install github.com/dreadl0ck/zeus/cmd/zeus@latestBuild the project:
zeus installOr build manually:
go build -o /usr/local/bin/net github.com/dreadl0ck/netcap/cmdFor development, you typically only need Go code:
zeus gen-proto-devOr manually:
protoc --gogofaster_out=types/. netcap.protoFor a release build with all language bindings:
zeus gen-proto-releaseOr manually:
mkdir -p types/{python,java,swift,cpp,csharp,js}
protoc --gogofaster_out=types/. \
--python_out=types/python \
--java_out=types/java \
--swift_out=types/swift \
--cpp_out=types/cpp \
--csharp_out=types/csharp \
--js_out=types/js \
netcap.protoEnsure your Go binary directory is in your PATH. Add to ~/.zshrc (or ~/.bash_profile):
export PATH="$HOME/go/bin:$PATH"Set the configuration root if needed:
export NC_CONFIG_ROOT="$HOME/.config/netcap"If you get errors like protoc-gen-XXX: program not found or is not executable:
- Ensure the plugin is installed
- Check if it's in your PATH:
echo $PATH
- For Go plugins, ensure
$HOME/go/binis in your PATH - For Homebrew plugins, ensure
/opt/homebrew/binis in your PATH
If you encounter permission errors when installing global npm packages:
# Configure npm to use a different directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to PATH in ~/.zshrc or ~/.bash_profile
export PATH="$HOME/.npm-global/bin:$PATH"
# Reload shell configuration
source ~/.zshrcIf you encounter version mismatch errors, ensure you're using compatible versions:
# Check current versions
protoc --version
go list -m github.com/gogo/protobufInstall additional tools for development:
# Code formatting
go install golang.org/x/tools/cmd/goimports@latest
# Linting
brew install golangci-lint
# Testing utilities
go install github.com/rakyll/gotest@latest
# Profiling
go install github.com/google/pprof@latest- Read the Contributing Guide
- Check the Development Notes
- Review the Testing Guide
- Explore the Architecture Documentation
- Installation Guide - For end-user installation
- Quickstart - Getting started with Netcap
- Configuration - Configuration options
- Troubleshooting - Common issues and solutions