{"record":{"id":"6c3b5bca448342b5","repo":"siyuan-note/siyuan","slug":"full-manual-mode-requires-push-or-pull-subcomm","errorCode":null,"errorMessage":"full-manual mode requires 'push' or 'pull' subcommand","messagePattern":"full-manual mode requires 'push' or 'pull' subcommand","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/cli/cmd/sync.go","lineNumber":35,"sourceCode":"package cmd\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/siyuan-note/siyuan/kernel/conf\"\n\t\"github.com/siyuan-note/siyuan/kernel/model\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nvar syncCmd = &cobra.Command{\n\tUse:   \"sync\",\n\tShort: \"Sync data with cloud\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif model.Conf.Sync.Mode == 3 {\n\t\t\treturn fmt.Errorf(\"full-manual mode requires 'push' or 'pull' subcommand\")\n\t\t}\n\n\t\tif dryRun {\n\t\t\tfmt.Println(\"[dry-run] Would sync data with cloud\")\n\t\t\treturn nil\n\t\t}\n\n\t\tmodel.SyncData(true)\n\t\tfmt.Println(\"ok\")\n\t\treturn nil\n\t},\n}\n\nvar syncPushCmd = &cobra.Command{\n\tUse:   \"push\",\n\tShort: \"Upload to cloud\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif dryRun {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/cli/cmd/sync.go#L17-L53","documentation":"The `sync` cobra command refuses to run when the workspace sync mode is set to 3 (full-manual). In full-manual mode automatic `siyuan sync` is disabled by design and the user must explicitly choose a direction via the `sync push` or `sync pull` subcommand, so the plain command returns this error instead of syncing.","triggerScenarios":"Running `siyuan sync` (no subcommand) while `model.Conf.Sync.Mode == 3` in the workspace configuration.","commonSituations":"A user switched sync mode to 'full-manual' in the SiYuan settings UI and then still invokes the generic sync command from scripts or cron jobs that were written when mode was auto/on-demand.","solutions":["Use `siyuan sync push` or `siyuan sync pull` instead of plain `siyuan sync`","Change the sync mode away from full-manual (Conf.Sync.Mode != 3) in the workspace settings if bidirectional sync is desired","Update automation scripts to detect mode 3 and invoke the directional subcommand"],"exampleFix":"// before\nsiyuan sync\n// after\nsiyuan sync push","handlingStrategy":"validation","validationCode":"if [ \"$(siyuan config get sync.mode 2>/dev/null || echo 0)\" = \"3\" ]; then\n  exec siyuan sync push\nfi\nsiyuan sync","typeGuard":null,"tryCatchPattern":"if ! siyuan sync; then\n  echo \"sync failed; if in full-manual mode use: siyuan sync push|pull\" >&2\n  exit 1\nfi","preventionTips":["Read Conf.Sync.Mode before choosing the sync invocation in scripts","Prefer explicit push/pull in automation so mode changes do not break them","Keep sync mode and automation in sync after changing settings in the UI"],"tags":["cli","sync","configuration"],"backgroundTag":"invalid-cli-argument","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}