Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(projects): add new module in util package for getting project details

Mahyar Mirrashedd0c9f1ca5321
diff --git a/cli/packages/util/projects.go b/cli/packages/util/projects.go
new file mode 100644
index 0000000000..c88e88fe73
--- /dev/null
+++ b/cli/packages/util/projects.go
@@ -0,0 +1,19 @@
+package util
+
+import (
+ "github.com/Infisical/infisical-merge/packages/api"
+ "github.com/go-resty/resty/v2"
+)
+
+func GetProjectDetails(accessToken string, workspaceId string) (api.Project, error) {
+ httpClient := resty.New()
+ httpClient.SetAuthToken(accessToken).
+ SetHeader("Accept", "application/json")
+
+ res, err := api.CallGetProjectById(httpClient, workspaceId)
+ if err != nil {
+ return api.Project{}, err
+ }
+
+ return res, nil
+}