<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>CLI on Margrop Blog</title>
    <link>https://blog.margrop.net/en/tag/cli/</link>
    <description>Recent content in CLI on Margrop Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Thu, 02 Jul 2026 19:30:00 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/en/tag/cli/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Docker Container Crash Loop After v3.7.0? You&#39;re Missing One Word: serve</title>
      <link>https://blog.margrop.net/en/post/siyuan-v370-docker-restart-loop-fix/</link>
      <pubDate>Thu, 02 Jul 2026 19:30:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/siyuan-v370-docker-restart-loop-fix/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;After upgrading Siyuan (SiYuan Note) from v3.6.x to v3.7.0, the Docker container entered an infinite restart loop. &lt;code&gt;docker logs&lt;/code&gt; showed &lt;code&gt;Error: unknown flag: --accessAuthCode&lt;/code&gt;. The root cause: v3.7.0 introduced a CLI subcommand architecture. The old top-level flags now require a &lt;code&gt;serve&lt;/code&gt; subcommand. The fix is adding one word — &lt;code&gt;&#39;serve&#39;&lt;/code&gt; — to the beginning of the &lt;code&gt;command&lt;/code&gt; array in docker-compose.yml. Seven characters. From crash loop to running.&lt;/p&gt;&#xA;&lt;p&gt;This article covers the complete troubleshooting process, one-command fix scripts for Windows 11, Ubuntu 26.04, and macOS 26, plus both manual and AI Agent approaches. All scripts use only Docker CLI and SSH — no third-party services required.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>Windows Finally Gets Native Linux Commands: Microsoft Coreutils Replaces WSL, Cygwin, and Git Bash</title>
      <link>https://blog.margrop.net/en/post/windows-native-linux-commands-microsoft-coreutils/</link>
      <pubDate>Sat, 27 Jun 2026 08:00:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/windows-native-linux-commands-microsoft-coreutils/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Let me ask you something:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Have you ever tried to &lt;code&gt;grep&lt;/code&gt; a log file in Windows Terminal, only to be told that &lt;code&gt;grep&lt;/code&gt; is not a recognized command? Tried to use &lt;code&gt;find&lt;/code&gt; to locate files, only to discover that Windows&amp;rsquo; &lt;code&gt;find&lt;/code&gt; is a completely different beast from Linux&amp;rsquo;s &lt;code&gt;find&lt;/code&gt;? Written a cross-platform script that works perfectly on Linux, then falls apart the moment it touches Windows?&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s not your fault. It&amp;rsquo;s the &amp;ldquo;Berlin Wall&amp;rdquo; between Windows and Linux command lines.&lt;/p&gt;&#xA;&lt;p&gt;The good news? Microsoft just tore that wall down. In late 2025, Microsoft open-sourced &lt;strong&gt;coreutils&lt;/strong&gt; on GitHub — a native Windows port of the essential Linux command set. No WSL. No Cygwin. No Git Bash. Just one &lt;code&gt;winget install&lt;/code&gt; command, and your Windows terminal suddenly speaks fluent &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, and &lt;code&gt;awk&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>Moving Bedtime Out of the Living Room: Letting macOS launchd Disable Your Kids&#39; Synology Accounts at 22:00 and Quietly Re-enable Them at 08:00</title>
      <link>https://blog.margrop.net/en/post/synology-mykid-curfew-launchd/</link>
      <pubDate>Sun, 14 Jun 2026 08:20:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/synology-mykid-curfew-launchd/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Short version&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Synology DSM has a &amp;ldquo;disable this account&amp;rdquo; checkbox in the Control Panel, but it does not run on a schedule. With macOS&amp;rsquo;s built-in &lt;code&gt;launchd&lt;/code&gt; and a 50-line bash script, you can flip the &lt;code&gt;expired&lt;/code&gt; flag on two local accounts at 22:00 every night and flip it back at 08:00. The script does a before-query, a change, an after-query, and &lt;code&gt;exit 1&lt;/code&gt; the moment the after state does not match expectations. &lt;code&gt;launchd&lt;/code&gt; writes stdout and stderr to dedicated log files. The interesting part is that the word &amp;ldquo;parent&amp;rdquo; quietly leaves the conversation: you no longer have to remind anyone to go to bed, the machine does it for you, on time, every day.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This post is not a comprehensive &amp;ldquo;family NAS management&amp;rdquo; guide. It is about one specific thing: turning a manual button click that depends on human memory into a system-level event that just happens on time.&lt;/p&gt;&#xA;&lt;p&gt;If you only want the picture, the overview diagram in Section 2 is the whole article in one frame.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Lights out at 22:00, lights on at 08:00&#34; src=&#34;https://blog.margrop.net/post-images/synology-mykid-curfew-launchd/05-curfew-overview.svg&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stop Dragging Files Around: BaiduPCS-Go CLI and Agent Workflows for Baidu Netdisk</title>
      <link>https://blog.margrop.net/en/post/baidupcs-go-cli-agent-guide/</link>
      <pubDate>Sat, 16 May 2026 10:06:01 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/baidupcs-go-cli-agent-guide/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Bottom line first&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you only download one or two files from Baidu Netdisk once in a while, the web UI and official desktop client are fine. Once you start doing batch downloads, remote server pulls, archive uploads, directory audits, or Agent-assisted workflows with Codex, Claude, OpenClaw, HermesAgent, or similar tools, the graphical UI becomes friction. &lt;code&gt;BaiduPCS-Go&lt;/code&gt; is useful not because it is a magic speed booster, but because it turns Baidu Netdisk into something scripts, terminals, and Agents can operate. This article walks through installation checks, BDUSS/STOKEN login, everyday commands, configuration, safety rules, and practical Agent integration.&lt;/p&gt;&#xA;&lt;p&gt;All accounts, cookies, paths, tasks, and settings in this article are sanitized examples. They do not contain real BDUSS, STOKEN, cookies, private directories, internal addresses, or business information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>Codex 0.130 Removed /approvals? The Fix Is to Move Permissions to Startup Flags</title>
      <link>https://blog.margrop.net/en/post/codex-130-approval-flags/</link>
      <pubDate>Tue, 12 May 2026 18:50:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/codex-130-approval-flags/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;The short version&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you upgraded to Codex 0.130.0 and noticed that the old &lt;code&gt;/approvals&lt;/code&gt; habit no longer works, the practical fix is not to downgrade. Move the permission policy to launch time. Use &lt;code&gt;--ask-for-approval&lt;/code&gt; to control when Codex asks, &lt;code&gt;--sandbox&lt;/code&gt; to control what commands can touch, and reserve &lt;code&gt;--dangerously-bypass-approvals-and-sandbox&lt;/code&gt; for environments that are already isolated outside Codex. The long flag can also be written directly as &lt;code&gt;--yolo&lt;/code&gt;, which is easier to remember, easier to type, and more consistent with command habits from tools such as Gemini.&lt;/p&gt;&#xA;&lt;p&gt;In other words, stop treating approval mode as an in-session toggle. Treat it as part of the way you start the agent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This article only discusses public Codex CLI flags and generic workflows. It does not include real hostnames, internal addresses, usernames, tokens, private paths, or project names. Commands use placeholders such as &lt;code&gt;&amp;lt;PROJECT&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;TASK&amp;gt;&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Integrating Synology Operations as an OpenClaw / HermesAgent Skill: From One Sentence to Auditable NAS Automation</title>
      <link>https://blog.margrop.net/en/post/openclaw-hermesagent-synology-skill/</link>
      <pubDate>Tue, 05 May 2026 12:20:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/openclaw-hermesagent-synology-skill/</guid>
      <description>&lt;p&gt;I have already written two Synology CLI references on this blog:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.margrop.net/en/post/synology-ssh-commands/&#34;&gt;Synology SSH Commands Cheatsheet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.margrop.net/en/post/synology-diskstation-cli-administration-guide/&#34;&gt;Synology NAS CLI Administration Guide&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Those posts answer the question: “What commands can a human run on a Synology NAS?” This article answers a different question: if I already use OpenClaw / HermesAgent, how can I turn those commands into an operations Skill so that I can ask the agent, in one sentence, to inspect the NAS, summarize evidence, prepare a maintenance plan, and execute approved commands only when the risk is acceptable?&lt;/p&gt;&#xA;&lt;p&gt;The short answer is: yes, but the Skill must not become an unrestricted root shell. The right design is:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make Synology SSH access controlled, testable, and revocable.&lt;/li&gt;&#xA;&lt;li&gt;Put common Synology CLI operations into a Skill, together with command categories, risk levels, and output rules.&lt;/li&gt;&#xA;&lt;li&gt;Allow read-only diagnostics by default.&lt;/li&gt;&#xA;&lt;li&gt;Require explicit approval for service restarts, permission changes, user changes, network changes, deletion, and storage operations.&lt;/li&gt;&#xA;&lt;li&gt;Preserve commands, output, and reasoning so each operation remains auditable.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If you only want the big picture, the diagram below summarizes the whole article.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;OpenClaw / HermesAgent Synology Skill overview&#34; src=&#34;https://blog.margrop.net/post-images/openclaw-hermesagent-synology-skill/01-overview-handdrawn.svg&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Transfer] Synology NAS CLI Administration Guide</title>
      <link>https://blog.margrop.net/en/post/synology-diskstation-cli-administration-guide/</link>
      <pubDate>Thu, 30 Apr 2026 18:20:04 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/synology-diskstation-cli-administration-guide/</guid>
      <description>&lt;p&gt;This guide contains command tools that allow your applications to make use of the resources on Synology DiskStation and also includes a list of Synology Error Numbers for reference.&lt;/p&gt;</description>
    </item>
    <item>
      <title>[Transfer] Synology DiskStation Administration CLI Guide: Reading Notes and Command Cheatsheet</title>
      <link>https://blog.margrop.net/en/post/zhuan-synology-diskstation-administration-cli-guide/</link>
      <pubDate>Thu, 30 Apr 2026 18:14:05 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/zhuan-synology-diskstation-administration-cli-guide/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Short version&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Synology&amp;rsquo;s official CLI administration guide is not a beginner manual for the DSM web interface. It is a compact reference for scripting, automation, and system integration. The useful parts cover local users, local groups, shared folders, network configuration, service management, Windows workgroup or ADS domain settings, and DSM error numbers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This post is an English reading note and command cheatsheet based on Synology&amp;rsquo;s official PDF, &lt;em&gt;CLI Administrator Guide for Synology NAS&lt;/em&gt;. Because the original PDF is a copyrighted Synology document, this post does not reproduce or translate the full document verbatim. Instead, it reorganizes the material into a bilingual blog-friendly guide for quick reading and daily operations. For exact wording, parameter definitions, version-specific behavior, and legal notices, use the official PDF linked at the end.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Debugging Chinese Text Turning into Underscores in tmux &#43; opencode: The Real Culprit Was client_utf8=0</title>
      <link>https://blog.margrop.net/en/post/tmux-opencode-chinese-underscore-fix/</link>
      <pubDate>Tue, 28 Apr 2026 18:40:00 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/tmux-opencode-chinese-underscore-fix/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Short version&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This was not an opencode Chinese rendering bug, and it was not a broken terminal font. The tmux client had been detected as not supporting UTF-8. The decisive evidence was &lt;code&gt;tmux display-message -p &#39;client_utf8=#{client_utf8}&#39;&lt;/code&gt;, which returned &lt;code&gt;client_utf8=0&lt;/code&gt;. In that state, tmux replaces non-ASCII output with underscores, so every Chinese character inside the opencode TUI appeared as &lt;code&gt;_&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This post documents a small but very typical terminal debugging session. On the same Mac, running &lt;code&gt;opencode&lt;/code&gt; directly displayed Chinese text correctly. But after starting a tmux session first and then running &lt;code&gt;opencode&lt;/code&gt;, all Chinese text became underscores.&lt;/p&gt;&#xA;&lt;p&gt;This kind of problem is easy to misdiagnose. The first instinct is often to blame the font, the terminal emulator, the opencode version, a color theme, Nerd Font configuration, Unicode width handling, or a bug in the TUI framework. In this case, however, the key question was much narrower: &lt;strong&gt;does the current tmux client believe it can write UTF-8 back to the outer terminal?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;To avoid exposing private environment details, all examples below are generalized. They do not include real hostnames, private addresses, session names, credentials, usernames, or project paths. The only things preserved are the technical facts needed to understand the failure and the fix.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
