A local-first CLI task manager. Tasks are stored in SQLite on your machine and optionally synced across devices via a self-hosted server on GCP.
- mise — manages Go, Rust, Terraform, and task runners
git clone https://github.com/shinyonogi/mainichi.git
cd mainichi
mise install
mise run cli:installThis builds the CLI in release mode and installs it to ~/.cargo/bin/mainichi. Make sure ~/.cargo/bin is in your PATH.
mainichi add "Write docs"
mainichi add "Ship v1" --note "release checklist" --tags work,release --priority high --due 2025-01-31
# Interactive mode (omit title)
mainichi addmainichi ls # active tasks grouped by due date
mainichi ls --all # include completed and deleted tasksmainichi done <ID> # ID prefix shown in ls
mainichi done # interactive pickermainichi rm <ID>
mainichi rm # interactive pickermainichi edit <ID> --title "New title"
mainichi edit <ID> --add-tags urgent --priority high
mainichi edit <ID> --clear-due-date
mainichi edit <ID> # interactive modePriority values: high, medium, low
By default, mainichi works entirely offline — tasks live in SQLite on your machine. If you want to sync across multiple devices, you can self-host the sync server on GCP using the infrastructure in this repo.
- A GCP project with billing enabled
- gcloud CLI installed and authenticated
- Docker
- A GCS bucket for Terraform state (create this manually before running Terraform)
Terraform and other tools are already managed by mise — just run mise install.
gcloud auth login
gcloud config set project your-gcp-project-idcp .env.example .env.localEdit .env.local with your values:
MAINICHI_PROJECT=your-gcp-project-id
MAINICHI_REGION=asia-northeast1 # or your preferred region
MAINICHI_AR_REPO=mainichi
MAINICHI_RUN_SERVICE=mainichi-api
MAINICHI_SERVER_URL= # fill in after deploy (step 4)cd infra/terraform
cp backend.hcl.example backend.hclEdit backend.hcl with your GCS bucket for Terraform state:
bucket = "your-terraform-state-bucket"
prefix = "terraform/state"Then copy and fill in the environment variables:
cp envs/dev/terraform.example.tfvars envs/dev/terraform.tfvarsEdit envs/dev/terraform.tfvars:
project_id = "your-gcp-project-id"
cloud_run_service_name = "mainichi-api"
artifact_registry_repository_name = "mainichi"
cloud_run_invoker_member = "user:your-email@gmail.com"Initialize and apply:
./terraform-init.sh backend.hcl
./terraform.sh plan dev
./terraform.sh apply devThis provisions Cloud Run, Firestore, Artifact Registry, and the necessary service accounts.
From the repo root:
mise run server:deploy:devThis builds the Docker image, pushes it to Artifact Registry, and updates the Cloud Run service.
Get the server URL:
gcloud run services describe mainichi-api \
--region asia-northeast1 \
--format='value(status.url)'Add it to .env.local:
MAINICHI_SERVER_URL=https://mainichi-api-xxxxxxxxxx-xx.a.run.appThen source the file before running sync commands (or add it to your shell profile):
source .env.local
mainichi ping # verify connectivity
mainichi sync # push/pull eventsAuthentication is handled automatically via gcloud auth print-identity-token, so as long as you're logged in with gcloud auth login, no extra setup is needed.