Contributing
Thank you for considering contributing to snips.sh! We welcome contributions from anyone, whether it’s a bug report, a feature request, code improvements, or documentation updates.
Issues and Questions
Please use Issues to report bugs and feature enhancements. For any questions, discussions or general feedback, please use the Discussions.
Local Development
To get started, you’ll need to have Go installed.
AI-powered file type detection is provided by magika-go, which embeds the model and ONNX runtime at build time. No additional setup is required.
To run locally:
script/run
There are some nice defaults for local development. To see all the available configuration options, run:
script/run -usage
Taking a look at the database.md and self-hosting.md documents may be useful too.
If you are working on the web UI, I recommend installing air so the application recompiles when the files change. Otherwise, the assets won’t update while the binary is running.
Scripts
This repository follows scripts-to-rule-them-all, here’s a brief description of each:
script/build: builds the snips.sh binary, supports cross-compilation via CC and TARGETARCH environment variables
script/env: sets CGO/linker flags for ONNX runtime, source this file before building (e.g., source script/env)
script/lint: locally installs golangci-lint and runs the linter
script/migrator: wrapper for goose to manage database migrations (see database.md)
script/mocks: generates mock interfaces using mockery for testing
script/record-tape: runs vhs on docs/tapes/ to generate gifs for readme
script/run: runs the application locally with proper environment runtime configuration
script/ssh-tmp: helper to run ssh with a new (temporary) public key, useful for testing new user access
script/test: runs go tests with gotestsum
script/vendor-onnxruntime: downloads and installs the ONNX runtime for the current platform