This guide covers how to set up your development environment and contribute to cimis-cli.
- Go 1.21 or later
- C compiler (for SQLite support via CGO)
- CIMIS API key (for testing fetches)
Since cimis-tsdb is a private dependency, you'll need to set up the local replace directive:
# 1. Clone both repositories to the same parent directory
mkdir -p ~/projects/cimis
cd ~/projects/cimis
git clone https://github.com/dl-alexandre/cimis-cli.git
git clone https://github.com/dl-alexandre/cimis-tsdb.git
# 2. The go.mod already has the replace directive:
# replace github.com/dl-alexandre/cimis-tsdb => ../../../cimis-tsdb
# This assumes both repos are in the same parent directory
# 3. Build
cd cimis-cli
make build
# 4. Test (requires CIMIS_APP_KEY)
export CIMIS_APP_KEY=your-api-key-here
make testDirectory Structure:
~/projects/cimis/
├── cimis-cli/ # This repository
└── cimis-tsdb/ # Private dependency (sibling directory)
The full CLI with all storage capabilities:
make buildRequirements:
- C compiler (gcc/clang)
- CGO enabled (default)
- Access to cimis-tsdb (via replace directive)
Builds only the API client packages without storage:
make build-pure
# Or manually:
CGO_ENABLED=0 go build ./internal/api/...Limitations:
- Only builds
internal/apipackage - Cannot build full CLI (requires cimis-tsdb storage which uses CGO/SQLite)
- Useful for testing API client logic without database dependencies
Note: The README mentions "pure-Go build retains all CLI functionality" - this refers to a future state where storage might be abstracted. Currently, the pure-Go build only applies to the API client package.
CGO_ENABLED=0 go test ./internal/api/... -vThese tests:
- Use mock HTTP servers (no live API calls)
- Test date parsing, record conversion, QC flags
- Run in CI without CIMIS_APP_KEY
export CIMIS_APP_KEY=your-api-key-here
make testIncludes:
- Unit tests
- Integration tests (make real API calls)
- Database operations
We intentionally keep cimis-tsdb private because:
- Competitive Advantage: The storage/optimization logic is proprietary
- Binary Distribution: Users get functionality via releases without source access
- CI/CD Security: GitHub Actions builds releases with controlled access
Install from releases (Recommended):
# macOS/Linux
brew install dl-alexandre/tap/cimis
# Or download directly
curl -L https://github.com/dl-alexandre/cimis-cli/releases/latest/download/cimis-$(uname -s)-$(uname -m) -o cimis
chmod +x cimisWhy not go install?
The private dependency prevents go install github.com/dl-alexandre/cimis-cli/cmd/cimis@latest from working. This is by design - we want to control distribution through signed binaries rather than source.
You need access to both repositories. Contact the maintainer for cimis-tsdb access, then follow the setup above with the replace directive.
Maintainers only - requires access to private cimis-tsdb:
# 1. Update version in code
# 2. Commit and push
# 3. Tag and push (triggers release workflow)
git tag v0.0.2
git push origin v0.0.2The GitHub Actions workflow:
- Checks out both repos (uses GITHUB_TOKEN for private access)
- Builds for 6 platforms (darwin/linux/windows × arm64/amd64)
- Signs macOS binaries
- Creates GitHub release with checksums
- Updates Homebrew tap
The replace directive expects cimis-tsdb at ../../../cimis-tsdb (two levels up from cimis-cli/go.mod).
Verify your directory structure:
ls ../../../cimis-tsdb/go.mod # Should existIf you cloned to different locations, update the replace path:
# Example: if cimis-tsdb is at ~/work/cimis-tsdb
go mod edit -replace github.com/dl-alexandre/cimis-tsdb=~/work/cimis-tsdbInstall a C compiler:
# macOS
xcode-select --install
# Ubuntu/Debian
sudo apt-get install gcc libsqlite3-dev
# Windows (MinGW)
choco install mingwThe test suite makes real API calls. CIMIS API limits:
- 1000 requests per day per key
- Rate limiting applies
Use -short flag for limited tests:
go test -short ./...- Issues: github.com/dl-alexandre/cimis-cli/issues
- Discussions: Use GitHub Discussions for questions about architecture or design decisions
- Private repo access: Contact maintainer for
cimis-tsdbcontributor access
MIT - See LICENSE file for details.