Skip to content

Commit ad4d641

Browse files
committed
feat: update shell completion for new commands
- Add completion support for post category subcommands (list, get, create, update, delete) - Add completion support for post tag subcommands (list, get, create, update, delete) - Add --comment flag completion for comment reply list
1 parent 5639d1a commit ad4d641

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed

skills/halo-cli-content/SKILL.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Post workflows:
3535
- `delete <name>`
3636
- `export-json <name>`
3737
- `import-json`
38+
- `category` (subcommand)
39+
- `tag` (subcommand)
3840

3941
Single-page workflows:
4042

@@ -100,6 +102,33 @@ Rules:
100102
- Import payload must contain `post.metadata.name`.
101103
- Import payload must contain `content.raw` or `content.content`.
102104

105+
## Post Categories
106+
107+
Manage post categories:
108+
109+
```bash
110+
halo post category list
111+
halo post category list --keyword Technology
112+
halo post category get category-abc123
113+
halo post category create --display-name "Technology" --slug "tech"
114+
halo post category create --display-name "News" --description "Latest news" --priority 100
115+
halo post category update category-abc123 --display-name "Tech News"
116+
halo post category delete category-abc123 --force
117+
```
118+
119+
## Post Tags
120+
121+
Manage post tags:
122+
123+
```bash
124+
halo post tag list
125+
halo post tag list --keyword Halo
126+
halo post tag get tag-abc123
127+
halo post tag create --display-name "Halo" --slug "halo" --color "#1890ff"
128+
halo post tag update tag-abc123 --display-name "Halo CMS"
129+
halo post tag delete tag-abc123 --force
130+
```
131+
103132
## Single Pages
104133

105134
List and inspect:

skills/halo-cli-moderation-notifications/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ Useful filters for `comment list`:
5252
Common flows:
5353

5454
```bash
55-
halo comment reply list comment-abc123
55+
halo comment reply list
56+
halo comment reply list --comment comment-abc123
5657
halo comment reply get reply-abc123
5758
halo comment reply approve reply-abc123
5859
halo comment reply delete reply-abc123 --force

src/utils/completion.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,48 @@ const COMPLETION_TREE: CompletionNode = {
9696
"import-markdown": {
9797
flags: [...FORCE_FLAGS, "--file"],
9898
},
99+
category: {
100+
flags: HELP_FLAGS,
101+
subcommands: {
102+
list: { flags: [...PROFILE_JSON_FLAGS, "--page", "--size", "--keyword", "--sort"] },
103+
get: { flags: PROFILE_JSON_FLAGS },
104+
create: {
105+
flags: [
106+
...PROFILE_JSON_FLAGS,
107+
"--display-name",
108+
"--slug",
109+
"--description",
110+
"--cover",
111+
"--priority",
112+
],
113+
},
114+
update: {
115+
flags: [
116+
...PROFILE_JSON_FLAGS,
117+
"--display-name",
118+
"--slug",
119+
"--description",
120+
"--cover",
121+
"--priority",
122+
],
123+
},
124+
delete: { flags: FORCE_FLAGS },
125+
},
126+
},
127+
tag: {
128+
flags: HELP_FLAGS,
129+
subcommands: {
130+
list: { flags: [...PROFILE_JSON_FLAGS, "--page", "--size", "--keyword", "--sort"] },
131+
get: { flags: PROFILE_JSON_FLAGS },
132+
create: {
133+
flags: [...PROFILE_JSON_FLAGS, "--display-name", "--slug", "--color", "--cover"],
134+
},
135+
update: {
136+
flags: [...PROFILE_JSON_FLAGS, "--display-name", "--slug", "--color", "--cover"],
137+
},
138+
delete: { flags: FORCE_FLAGS },
139+
},
140+
},
99141
},
100142
},
101143
"single-page": {
@@ -205,7 +247,7 @@ const COMPLETION_TREE: CompletionNode = {
205247
reply: {
206248
flags: HELP_FLAGS,
207249
subcommands: {
208-
list: { flags: PROFILE_JSON_FLAGS },
250+
list: { flags: [...PROFILE_JSON_FLAGS, "--comment", "--page", "--size"] },
209251
get: { flags: PROFILE_JSON_FLAGS },
210252
approve: { flags: PROFILE_JSON_FLAGS },
211253
delete: { flags: FORCE_FLAGS },

0 commit comments

Comments
 (0)