Skip to content

Commit 04f7fbd

Browse files
committed
chore(conductor): Archive track 'rule management cli'
1 parent 26e8173 commit 04f7fbd

5 files changed

Lines changed: 98 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Track rule_management_cli_20260317 Context
2+
3+
- [Specification](./spec.md)
4+
- [Implementation Plan](./plan.md)
5+
- [Metadata](./metadata.json)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"track_id": "rule_management_cli_20260317",
3+
"type": "feature",
4+
"status": "new",
5+
"created_at": "2026-03-17T12:00:00Z",
6+
"updated_at": "2026-03-17T12:00:00Z",
7+
"description": "rule management cli"
8+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Implementation Plan: Rule Management CLI
2+
3+
## Phase 1: CLI Infrastructure and Registration [checkpoint: 5de1d89]
4+
5+
- [x] Task: Create `RuleCommand` group and register it
6+
- [x] Create `src/enapter/cli/http/api/rule_command.py`
7+
- [x] Register `RuleCommand` in `src/enapter/cli/http/api/rule_engine_command.py`
8+
- [x] Implement registration of sub-commands (placeholders for now)
9+
- [x] Task: Conductor - User Manual Verification 'Phase 1: CLI Infrastructure and Registration' (Protocol in workflow.md)
10+
11+
## Phase 2: Read Operations (List and Get)
12+
13+
- [x] Task: Implement `rule list` command
14+
- [x] Create `src/enapter/cli/http/api/rule_list_command.py`
15+
- [x] Implement command logic and JSON output
16+
- [x] Task: Implement `rule get` command
17+
- [x] Create `src/enapter/cli/http/api/rule_get_command.py`
18+
- [x] Implement command logic and JSON output
19+
- [x] Task: Conductor - User Manual Verification 'Phase 2: Read Operations (List and Get)' (Protocol in workflow.md)
20+
21+
## Phase 3: Create and Delete Operations
22+
23+
- [x] Task: Implement `rule create` command
24+
- [x] Create `src/enapter/cli/http/api/rule_create_command.py`
25+
- [x] Implement command logic (handle `--script-file`, `--runtime-version`, `--exec-interval`, `--disable`)
26+
- [x] Task: Implement `rule delete` command
27+
- [x] Create `src/enapter/cli/http/api/rule_delete_command.py`
28+
- [x] Implement command logic
29+
- [x] Task: Conductor - User Manual Verification 'Phase 3: Create and Delete Operations' (Protocol in workflow.md)
30+
31+
## Phase 4: Update and State Management Operations
32+
33+
- [x] Task: Implement `rule update` (slug) command
34+
- [x] Create `src/enapter/cli/http/api/rule_update_command.py`
35+
- [x] Implement command logic
36+
- [x] Task: Implement `rule update-script` command
37+
- [x] Create `src/enapter/cli/http/api/rule_update_script_command.py`
38+
- [x] Implement command logic (handle `--script-file`, `--runtime-version`, `--exec-interval`)
39+
- [x] Task: Implement `rule enable` and `rule disable` commands
40+
- [x] Create `src/enapter/cli/http/api/rule_enable_command.py` and `src/enapter/cli/http/api/rule_disable_command.py`
41+
- [x] Implement command logic
42+
- [x] Task: Conductor - User Manual Verification 'Phase 4: Update and State Management Operations' (Protocol in workflow.md)
43+
44+
## Phase 5: Finalization and Quality Check [checkpoint: 182fade]
45+
46+
- [x] Task: Final code quality check (linting)
47+
- [x] Task: Verify overall CLI consistency and help messages
48+
- [x] Task: Conductor - User Manual Verification 'Phase 5: Finalization and Quality Check' (Protocol in workflow.md)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Specification: Rule Management CLI
2+
3+
## Overview
4+
This track implements a command-line interface for managing rules within the Enapter HTTP API Rule Engine. These commands will be integrated into the existing `enapter` CLI under the `api rule-engine rule` group.
5+
6+
## Functional Requirements
7+
The CLI will be extended with the following commands under `api rule-engine rule`:
8+
9+
1. **List Rules**: `api rule-engine rule list [--site-id SITE_ID]`
10+
2. **Get Rule**: `api rule-engine rule get RULE_ID [--site-id SITE_ID]`
11+
3. **Create Rule**: `api rule-engine rule create --script-file PATH [--slug SLUG] [--site-id SITE_ID] [--disable] [--runtime-version {V1,V3}] [--exec-interval INTERVAL]`
12+
- Creates a new rule. `slug` is optional (autogenerated if missing). `runtime-version` defaults to V3. `exec-interval` required if V1.
13+
4. **Update Rule**: `api rule-engine rule update RULE_ID --slug NEW_SLUG [--site-id SITE_ID]`
14+
- Updates a rule's slug.
15+
5. **Update Rule Script**: `api rule-engine rule update-script RULE_ID --script-file PATH [--site-id SITE_ID] [--runtime-version {V1,V3}] [--exec-interval INTERVAL]`
16+
- Updates a rule's script code and optionally runtime version/interval.
17+
6. **Enable Rule**: `api rule-engine rule enable RULE_ID [--site-id SITE_ID]`
18+
7. **Disable Rule**: `api rule-engine rule disable RULE_ID [--site-id SITE_ID]`
19+
8. **Delete Rule**: `api rule-engine rule delete RULE_ID [--site-id SITE_ID]`
20+
21+
## Technical Requirements
22+
- **Integration**: Commands will be added to `src/enapter/cli/http/api/`.
23+
- **Command Group**: A new `RuleCommand` class will be created and registered within `RuleEngineCommand`.
24+
- **Output**: All commands should output the resulting Rule object in JSON format.
25+
- **Dependency**: Uses the `enapter.http.api.rule_engine.Client`.
26+
- **Script Handling**: Read script file content from `PATH`.
27+
28+
## Acceptance Criteria
29+
- [ ] Users can perform all CRUD operations on rules via the CLI.
30+
- [ ] Users can upload rule scripts from files.
31+
- [ ] Commands support `--site-id` for multi-site management.
32+
- [ ] Output is provided in JSON format.
33+
- [ ] All new CLI commands are covered by manual verification (automated tests skipped per user request).
34+
35+
## Out of Scope
36+
- Downloading rule scripts to files.
37+
- Management of Rule Engine itself (already exists).

conductor/tracks.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# Project Tracks
22

33
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
4-
5-
---
6-
7-
- [x] **Track: rule management cli**
8-
*Link: [./tracks/rule_management_cli_20260317/](./tracks/rule_management_cli_20260317/)*

0 commit comments

Comments
 (0)