Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/add-command/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ A Management API command has none: Meilisearch Cloud does not run locally (`docs
## 6. Manifest, code samples, changeset

- `pnpm gen:manifest`: builds and rewrites `oclif.manifest.json`. The file is committed; CI fails if it differs from the code. The `meili schema` snapshot in `test/contract/__snapshots__/` changes with it: update it on purpose with `pnpm test -u`, and read the diff.
- Code samples, by rule 19 of `CLAUDE.md`: find the cURL samples of the routes of the command in `.code-samples.meilisearch.yaml` of the `meilisearch/documentation` repository. Add one `meili` sample per cURL sample to `.code-samples.meilisearch.yaml` of this repository, under the same key. Copy the shape of the samples already there: the command name, then `--project-url` and `--project-api-key` on one line, then the other flags. Run each new sample against the local Meilisearch before you commit it.
- Code samples, by rule 19 of `CLAUDE.md`: find the cURL samples of the routes of the command in `.code-samples.meilisearch.yaml` of the `meilisearch/documentation` repository. Add one `meili` sample per cURL sample to `.code-samples.meilisearch.yaml` of this repository, under the same key. Copy the shape of the samples already there: the command name, then `--project-url` and `--project-api-key` on one line, then the other flags. A management command has no connection flag, and its key starts with `management_`. Run each new Meilisearch sample against the local Meilisearch before you commit it.
- Changeset: a new command is visible to users of the package, so it needs a line. Write `.changeset/add-<command-with-dashes>.md` by hand, by the rules of `.changeset/README.md`: the interactive `pnpm changeset` cannot be answered by an agent. The line names the command, without its flags: they live in `--help`. It ends with the link to the pull request, added once the pull request is open.

```md
Expand Down
32 changes: 32 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1154,3 +1154,35 @@ rbac_multi_level_1: |-
--index documents \
--q sensitive \
--filter '_foreign(access, (user = "jeremy@meilisearch.com" AND roles IN ["editor", "owner"]) OR (teams IN ["product", "engineering"] AND roles IN ["editor"]))'
management_list_organizations_1: |-
meili organization list
management_get_organization_1: |-
meili organization view --id 1
management_update_organization_1: |-
meili organization update --id 1 --name Acme
management_delete_organization_1: |-
meili organization delete --id 1 --yes
management_list_teams_1: |-
meili team list --organization-id 1
management_create_team_1: |-
meili team add --name 'Search team' --organization-id 1
management_get_team_1: |-
meili team view --id 12
management_update_team_1: |-
meili team update --id 12 --name 'Search team'
management_delete_team_1: |-
meili team delete --id 12 --yes
management_list_projects_1: |-
meili project list --team-id 12
management_create_project_1: |-
meili project add --name my-project --team-id 12 --resource-id 3
management_get_project_1: |-
meili project view --id 343
management_update_project_1: |-
meili project update --id 343 --name my-project
management_delete_project_1: |-
meili project delete --id 343 --yes
management_list_regions_1: |-
meili region list
management_list_resources_1: |-
meili resource list --region-id 1
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Package: `@meilisearch/cli` on npm. Binary: `meili`.
- **An answer.** Ask only with `choose`, `ask` and `askSecret` of `src/lib/terminal.ts`. They send `cli_prompt_answered` and `cli_prompt_aborted`. Give every new question a new, stable `prompt` id, and every option of `choose` a stable `id`. An option that is the user's own data, such as a team, has no `id`: the event then has no `choice`. A renamed id breaks the funnels in PostHog.
- **Never a value.** No flag value, free text, name, URL, key or document. Only names and fixed ids.
- **A new event or property is a contract change.** It goes in the "Analytics" section of `docs/contract/config.md`, with a new ADR.
19. `.code-samples.meilisearch.yaml` holds the `meili` samples of the Meilisearch documentation. The documentation shows each sample next to the cURL sample of the same key, so keep the keys of the documentation. A sample does what its cURL sample does. It runs the command with `--project-url` and `--project-api-key`, on one line after the command name. Only a command that the CLI implements has a sample.
19. `.code-samples.meilisearch.yaml` holds the `meili` samples of the Meilisearch documentation. The documentation shows each sample next to the cURL sample of the same key, so keep the keys of the documentation. A sample does what its cURL sample does. A Meilisearch API command runs with `--project-url` and `--project-api-key`, on one line after the command name. A management command has no connection flag: it uses the session of `meili auth login`. Its key starts with `management_`, like the cURL samples of the Management API reference. Only a command that the CLI implements has a sample.
- **A new command.** Add a sample for every cURL sample of the documentation that the command covers. The cURL samples are in `.code-samples.meilisearch.yaml` of the `meilisearch/documentation` repository.
- **A renamed or removed command or flag.** Update every sample that uses it, in the same pull request. `test/contract/docs.test.ts` fails when a sample uses a command or a flag that does not exist.

Expand Down
Loading