feat: add project export and import functionality

- Implemented `pcli project export` command to export project hierarchy as JSON.
- Added `pcli project import` command to import project data from JSON.
- Created user client to fetch user details for comment attribution.
- Introduced new data structures for export and import processes.
- Ensured name-based references in exports and handled conflicts during imports.
- Added versioning and progress reporting for import operations.
- Updated documentation and specifications for new features.
This commit is contained in:
2026-03-04 19:53:55 +00:00
parent e352fd530f
commit e973b2ce20
49 changed files with 1492 additions and 3303 deletions
+26
View File
@@ -0,0 +1,26 @@
package client
import (
"context"
"encoding/json"
"fmt"
"git.franklin.lab/steve.cliff/pcli/model"
)
func (c *Client) ListUsers(ctx context.Context) ([]model.User, error) {
data, err := c.DoNoBody(ctx, "GET", "/api/users")
if err != nil {
return nil, err
}
var response struct {
Items []model.User `json:"items"`
}
if err := json.Unmarshal(data, &response); err != nil {
return nil, fmt.Errorf("failed to unmarshal users response: %w", err)
}
return response.Items, nil
}