$npx -y skills add halo-dev/cli --skill halo-cli-contentUse when managing Halo posts, single pages, categories, or tags from the terminal. This includes listing, creating, updating, deleting, exporting, importing, or any content management operation for Halo CMS. Trigger this skill whenever the user mentions Halo posts, pages, categor
| 1 | # Halo CLI Content |
| 2 | |
| 3 | Use this skill for `halo post` and `halo single-page`. |
| 4 | |
| 5 | If auth may not be ready, check `halo auth current` first or load `halo-cli-auth`. |
| 6 | |
| 7 | ## Commands |
| 8 | |
| 9 | ```bash |
| 10 | halo post --help |
| 11 | halo single-page --help |
| 12 | ``` |
| 13 | |
| 14 | Post workflows: |
| 15 | |
| 16 | - `list` |
| 17 | - `get <name>` |
| 18 | - `open <name>` |
| 19 | - `create` |
| 20 | - `update <name>` |
| 21 | - `delete <name>` |
| 22 | - `export-json <name>` |
| 23 | - `import-json` |
| 24 | - `category` (subcommand) |
| 25 | - `tag` (subcommand) |
| 26 | |
| 27 | Single-page workflows: |
| 28 | |
| 29 | - `list` |
| 30 | - `get <name>` |
| 31 | - `open <name>` |
| 32 | - `create` |
| 33 | - `update <name>` |
| 34 | - `delete <name>` |
| 35 | - `export-json <name>` |
| 36 | - `import-json` |
| 37 | |
| 38 | ## Posts |
| 39 | |
| 40 | List and inspect: |
| 41 | |
| 42 | ```bash |
| 43 | halo post list |
| 44 | halo post list --keyword halo --publish-phase PUBLISHED |
| 45 | halo post list --category Technology --page 1 --size 20 |
| 46 | halo post get my-post --json |
| 47 | ``` |
| 48 | |
| 49 | Create: |
| 50 | |
| 51 | ```bash |
| 52 | halo post create --title "Hello Halo" --content "# Hello Halo" --publish true |
| 53 | halo post create --title "Hello Halo" --content "<h1>Hello Halo</h1>" --raw-type html |
| 54 | halo post create \ |
| 55 | --title "Release Notes" \ |
| 56 | --content "Release notes content" \ |
| 57 | --slug "release-notes" \ |
| 58 | --excerpt "A brief summary" \ |
| 59 | --categories News,CLI \ |
| 60 | --tags Halo,Release \ |
| 61 | --cover "https://example.com/cover.png" \ |
| 62 | --visible PUBLIC \ |
| 63 | --allow-comment true \ |
| 64 | --pinned false \ |
| 65 | --priority 100 \ |
| 66 | --publish true |
| 67 | ``` |
| 68 | |
| 69 | Update: |
| 70 | |
| 71 | ```bash |
| 72 | halo post update my-post --title "Updated title" |
| 73 | halo post update my-post --content "Updated content" --publish true |
| 74 | halo post update my-post --new-name my-post-renamed |
| 75 | halo post update my-post --slug "new-slug" --excerpt "Updated excerpt" --cover "" |
| 76 | halo post update my-post --allow-comment false --priority 0 |
| 77 | ``` |
| 78 | |
| 79 | Taxonomy-aware create/update: |
| 80 | |
| 81 | ```bash |
| 82 | halo post create \ |
| 83 | --title "Release Notes" \ |
| 84 | --content "Release notes content" \ |
| 85 | --categories News,CLI \ |
| 86 | --tags Halo,Release |
| 87 | ``` |
| 88 | |
| 89 | JSON round-trip: |
| 90 | |
| 91 | ```bash |
| 92 | halo post export-json my-post --output ./post.json |
| 93 | halo post import-json --file ./post.json --force |
| 94 | ``` |
| 95 | |
| 96 | `import-json` payload example (for creating a new post): |
| 97 | |
| 98 | ```json |
| 99 | { |
| 100 | "post": { |
| 101 | "apiVersion": "content.halo.run/v1alpha1", |
| 102 | "kind": "Post", |
| 103 | "metadata": { |
| 104 | "name": "56c6d867-9683-4927-ba94-388fedf87443" |
| 105 | }, |
| 106 | "spec": { |
| 107 | "title": "Sample Post", |
| 108 | "slug": "sample-post", |
| 109 | "template": "", |
| 110 | "cover": "", |
| 111 | "deleted": false, |
| 112 | "publish": false, |
| 113 | "pinned": false, |
| 114 | "allowComment": true, |
| 115 | "visible": "PUBLIC", |
| 116 | "priority": 0, |
| 117 | "excerpt": { "autoGenerate": true, "raw": "" }, |
| 118 | "categories": ["category-xxx"], |
| 119 | "tags": ["tag-xxx"], |
| 120 | "htmlMetas": [] |
| 121 | } |
| 122 | }, |
| 123 | "content": { |
| 124 | "raw": "# Hello World\n\nThis is a sample post content in **Markdown**.\n", |
| 125 | "content": "<h1 id=\"hello-world\">Hello World</h1>\n<p>This is a sample post content in <strong>Markdown</strong>.</p>\n", |
| 126 | "rawType": "markdown" |
| 127 | } |
| 128 | } |
| 129 | ``` |
| 130 | |
| 131 | Content fields: |
| 132 | |
| 133 | - `rawType`: source format, supports `markdown` or `html`. |
| 134 | - `raw`: the source content. Use Markdown text when `rawType` is `markdown`; use HTML text when `rawType` is `html`. |
| 135 | - `content`: the rendered result. Use HTML text when `rawType` is `markdown` (converted from Markdown); use HTML text when `rawType` is `html`. |
| 136 | |
| 137 | - `baseSnapshot`, `headSnapshot`, `releaseSnapshot` and `owner` must be left empty (do not construct manually). |
| 138 | - `categories` and `tags` values are the `metadata.name` of existing categories/tags in the system. Query them first with `halo post category list` and `halo post tag list`; create any missing ones before importing. |
| 139 | |
| 140 | Markdown round-trip: |
| 141 | |
| 142 | ```bash |
| 143 | halo post export-markdown my-post |
| 144 | halo post export-markdown my-post --output ./post.md |
| 145 | halo post import-markdown --file ./post.md --force |
| 146 | ``` |
| 147 | |
| 148 | Rules: |
| 149 | |
| 150 | - `--raw-type` defaults to `markdown`, so `--content` is rendered as Markdown unless you set `--raw-type html`. |
| 151 | - Prefer `--content` for direct inline updates, or use `import-markdown` for Markdown files. |
| 152 | - `open` only works for published content; with `--json` it returns the URL. |
| 153 | - Import payload must contain `post.metadata.name`. |
| 154 | - Import payload must contain `content.raw` or `content.content`. |
| 155 | |
| 156 | ## Post Categories |
| 157 | |
| 158 | Manage post categories: |
| 159 | |
| 160 | ```bash |
| 161 | halo post category list |
| 162 | halo post category list --keyword Technology |
| 163 | halo post category get category-abc123 |
| 164 | halo post category create --display-name "Technology" --slug "tech" |
| 165 | halo post category create --display-name "News" --description "Lat |