A command-line interface for interacting with the Synkronus API.
Developer note: after OpenAPI spec changes in
../synkronus/openapi/synkronus.yaml, regenerate the Go client withgo generate ./pkg/client.
- Authentication with JWT tokens
- App bundle management (download, upload, version management)
- Data synchronization (push and pull)
- Data export as Parquet ZIP archives
- Configuration management
go install github.com/OpenDataEnsemble/ode/synkronus-cli/cmd/synkronus@latestOr build from source:
git clone https://github.com/OpenDataEnsemble/ode/synkronus-cli.git
cd synkronus-cli
go build -o bin/synk ./cmd/synkronusBy default, the CLI uses a configuration file located at $HOME/.synkronus.yaml.
You can override this in two ways:
- Per-command: pass
--config <path>to read/write a specific config file for that invocation. - Persistent "current" config: use
synk config use <path>to point the CLI at a specific config file for future runs (this writes a pointer file at$HOME/.synkronus_current).
Example configuration file:
api:
url: http://localhost:8080
version: 1.0.0# Create separate config files
synk config init -o ~/.synkronus-dev.yaml
synk config init -o ~/.synkronus-prod.yaml
# Point CLI at dev by default
synk config use ~/.synkronus-dev.yaml
# Point CLI at prod by default
synk config use ~/.synkronus-prod.yaml
# Temporarily override for a single command
synk --config ~/.synkronus-dev.yaml statusThe Synkronus CLI includes built-in support for shell completion in bash, zsh, fish, and PowerShell.
Use synk completion [bash|zsh|fish|powershell] to generate the completion script. In powershell you can load it directly for the current session with:
.\synk.exe completion powershell | Out-String | Invoke-Expression# For the current session:
source <(synk completion bash)
# For persistent use (Linux):
sudo synk completion bash > /etc/bash_completion.d/synk
# For persistent use (macOS):
synk completion bash > /usr/local/etc/bash_completion.d/synk# For the current session:
source <(synk completion zsh)
# For persistent use:
echo "[[ $commands[synk] ]] && synk completion zsh > "${fpath[1]}/_synk"" >> ~/.zshrc# For the current session:
synk completion fish | source
# For persistent use:
synk completion fish > ~/.config/fish/completions/synk.fish# For the current session:
synk completion powershell | Out-String | Invoke-Expression
# For persistent use (add to your PowerShell profile):
Add-Content -Path $PROFILE -Value "# Synkronus CLI Completion"
Add-Content -Path $PROFILE -Value "synk completion powershell | Out-String | Invoke-Expression"# Login to the API
synk login --username your-username
# Check authentication status
synk status
# Logout
synk logout# Get app bundle manifest
synk /app-bundle/download/manifest
# List available app bundle versions
synk app-bundle versions
# Download app bundle files
synk /app-bundle/download --output ./app-bundle
# Download a specific file
synk app-bundle download index.html
# Upload a new app bundle (admin only)
synk app-bundle upload bundle.zip
# Upload without switching the active bundle (stage only), with verbose output
synk app-bundle upload bundle.zip --stage-only --verbose
# Switch to a specific app bundle version (admin only)
synk app-bundle switch 20250507-123456# Pull data from the server
synk sync pull --client-id your-client-id
# Pull with filters
synk sync pull --client-id your-client-id --after-change-id 1234 --schema-types form,submission
# Push data to the server
synk sync push data.json# List users with role, last activity timestamp (UTC), and client count (N/A when absent)
synk user list
# Create, delete, reset password, change own password — see synk user --help# Export all observations as a Parquet ZIP archive
synk data export exports.zip
# Export to a specific directory
synk data export ./backups/observations_parquet.zipGPL-2.0-or-later — see LICENSE in this directory.
The rest of the ODE monorepo may use other licenses (for example MIT at the repository root). This applies to synkronus-cli only.
Planned follow-up: replace the yeqown/go-qrcode/writer/standard (gg /
freetype) stack with a small stdlib qrcode.Writer implementation so this
component can return to a permissive license. See
FOLLOWUP-custom-qrcode-writer.md for a
ticket-ready summary.
Build with: go build -o bin/synk.exe ./cmd/synkronus
Run with: bin/synk.exe
Icon: configured in versioninfo.json and built with goversioninfo goversioninfo -o cmd/synkronus/resource.syso to create a syso file next to main go file.
The Go API client in pkg/client/generated/client.gen.go is generated from:
- Spec:
../synkronus/openapi/synkronus.yaml - Tool:
github.com/oapi-codegen/oapi-codegen/v2(pinned intools.go) - Config:
oapi-codegen.yaml
Use:
go generate ./pkg/clientThen verify:
go test ./...oapi-codegenis open source under Apache-2.0.github.com/oapi-codegen/runtimeis also open source under Apache-2.0.- Apache-2.0 is permissive and compatible with MIT-licensed projects.