vimcolorschemes/worker
May 16, 2026 ยท View on GitHub
The worker is a CLI used to import and manage the data for vimcolorschemes.
Getting started
Requirements:
- golang
- A Turso database URL (or a local libSQL/SQLite file URL)
Set up the environment variables
Update the values in .env to your needs.
You can start from .env.example (and .env.docker.example for Docker, .env.deploy.example for deploys).
TIP: Read the comments on the dotenv file.
The .env is automatically picked up by CLI when it runs.
Database (Turso/libSQL)
The worker uses the libsql driver, so it supports both local and remote Turso setups.
Local database example:
export DATABASE_URL=file:./data/vimcolorschemes.db
export DATABASE_AUTH_TOKEN=
Remote Turso example:
export DATABASE_URL=libsql://your-database.turso.io
export DATABASE_AUTH_TOKEN=your-turso-auth-token
Optional remote replica mode with a local sync file:
export DATABASE_URL='libsql://your-database.turso.io?syncUrl=file%3A.%2Fdata%2Freplica.db'
export DATABASE_AUTH_TOKEN=your-turso-auth-token
Github queries
Since Github's API has a quite short rate limit for unauthenticated calls (60 for core API calls). I highly recommend setting up authentication (5000 calls for core API calls) to avoid wait times when you reach the limit.
To do that, you first need to create your personal access token with permissions to read public repositories. Follow instructions on how to do that here.
Run a job
To run a job, use the bin/start script:
bin/start <job>
import
Import repositories into the database
bin/start import
Import only a specific repository using the --repo option.
bin/start import --repo morhetz/gruvbox
update
Fetch the necessary data for the repositories
bin/start update
Force a full update of all the repositories by using the --force option.
bin/start update --force
Update only a specific repository using the --repo option.
bin/start update --repo morhetz/gruvbox
generate
Generate color data for color scheme previews
bin/start generate
Force a full generation of all the repositories by using the --force option.
bin/start generate --force
Generate preview data for only a specific repository using the --repo option.
bin/start generate --repo morhetz/gruvbox
publish
Trigger the frontend deploy webhook after the latest import, update, and generate reports for today all succeeded.
bin/start publish
Run tests
bin/test
go test flags can be used:
bin/test --cover
Lint
golangci-lint is configured to run using bin/lint.
Format code
go fmt can be easily used on all code using bin/format.
Infrastructure and deployment
Infrastructure runtime, deployment flow, and Terraform setup are documented in infra/README.md.