Python SDK and CLI for LimaCharlie. NEW_CLI.md is the CLI design document.
.claude/docs/sdk-docstring-conventions.md is the docstring checklist for
limacharlie/sdk/.
Run the tests the way CI does: pytest tests/unit/ tests/microbenchmarks/.
Three hand-maintained maps describe the command surface. None of them updates itself. Update all of them in the same change:
limacharlie/cli.py—_COMMAND_MODULE_MAP. Maps a top-level command name to its module so the CLI can lazy-load it. Enforced bytests/unit/test_cli_command_map_lint.py.limacharlie/discovery.py—PROFILES. Groups commands by use-case; this is whatlimacharlie help discoverprints. A verb in no profile is invisible to anyone — or any agent — discovering the CLI, and an entry naming a command that no longer exists prints advice that cannot be followed. Enforced bytests/unit/test_discovery.py.doc/cli/. The user-facing command reference.
Reuse an existing profile name where one fits. PROFILES is meant to mirror
the profiles the LimaCharlie MCP server exposes (NEW_CLI.md §1.1), so the
names are a cross-repo contract, not a local choice.
When the lint reports a PROFILES entry that no longer resolves, find the
command's current spelling before touching the entry — most rotted entries were
renamed or moved, not removed. Drop an entry only when the command is genuinely
gone or has become a flag on another command.
Customers back up and restore whole orgs with limacharlie sync pull --all,
often from a scheduled job using an API key per org that holds only the
permissions it needed when it was made. A hive added to _HIVE_FLAG_MAP in
limacharlie/commands/sync.py joins --all in the next release, and so does
any new non-hive resource type that _resolve_sync_flags expands --all to
(like outputs or extensions). From then on, every --all pull with a key
that lacks the read permission for it fails for the whole org until someone
grants the permission. --all-available skips an unreadable hive with a
warning instead, but many jobs still use --all. Customers can only find out
which permission to grant from the changelog, so in the same change:
-
Add a "New permissions" entry to
CHANGELOG.mdunder "Unreleased". Name the hive, the flag, and every permission it takes: the read permission thatsync pullneeds, and the write permissions thatsync pushneeds. Say plainly thatsync pull --allfails with a key that lacks the read permission and that--all-availableskips the hive. Example:### New permissions: `host_posture_rule` hive - `sync pull --all` and `--hive-host-posture-rule` now read the `host_posture_rule` hive, which needs `host_posture.get`. A key without it fails `sync pull --all`; `sync pull --all-available` skips the hive with a warning. Pushing rules needs `host_posture.set` and `sensor.task`.
-
Take the permission names from the hive's definition in the Hive service, not from the hive name. They often differ:
host_posture_rulereads withhost_posture.get, andexternal_adapterwithexternaladapter.get.mtd. Never guess a name. If you can't confirm it, say so in the PR and ask. -
Keep the permission table in
doc/cli/infrastructure.mdup to date in the same change ("Permissions each hive needs"): one row per hive in_HIVE_FLAG_MAP, and a note for any new non-hive section. -
Do the same for any new CLI command or SDK call that needs a permission no earlier release needed. The same rule applies: one changelog line naming the permission.
-
Add the hive to the Go SDK too (
KnownHivesandSyncAll()in go-limacharlie). The Infrastructure extension and Git Sync use that list, and that repo has the same rule.