planflow-plugin 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,32 @@ If not authenticated, display error card:
61
61
  ╰──────────────────────────────────────────────────────────────────────────────╯
62
62
  ```
63
63
 
64
- ## Step 2: Fetch Projects (with Loading)
64
+ ## Step 2: Fetch User's Organizations
65
+
66
+ First, fetch the user's organizations to get the default organization ID:
67
+
68
+ **API Call:**
69
+ ```bash
70
+ curl -s \
71
+ -H "Authorization: Bearer {TOKEN}" \
72
+ "https://api.planflow.tools/organizations"
73
+ ```
74
+
75
+ **Response:**
76
+ ```json
77
+ {
78
+ "success": true,
79
+ "data": {
80
+ "organizations": [
81
+ { "id": "org-uuid", "name": "My Org", "role": "owner" }
82
+ ]
83
+ }
84
+ }
85
+ ```
86
+
87
+ Use the first organization with `owner` role, or fall back to the first organization.
88
+
89
+ ## Step 3: Fetch Projects (with Loading)
65
90
 
66
91
  **Loading Card:**
67
92
 
@@ -79,10 +104,10 @@ If not authenticated, display error card:
79
104
  ```bash
80
105
  curl -s \
81
106
  -H "Authorization: Bearer {TOKEN}" \
82
- "https://api.planflow.tools/projects"
107
+ "https://api.planflow.tools/projects?organizationId={ORG_ID}"
83
108
  ```
84
109
 
85
- ## Step 3: Display Projects Card
110
+ ## Step 4: Display Projects Card
86
111
 
87
112
  ```
88
113
  ╭──────────────────────────────────────────────────────────────────────────────╮
@@ -88,7 +88,81 @@ If not authenticated, display error card:
88
88
  ╰──────────────────────────────────────────────────────────────────────────────╯
89
89
  ```
90
90
 
91
- ## Step 4: Show Creation Card
91
+ ## Step 4: Fetch User's Organizations
92
+
93
+ **API Call:**
94
+ ```bash
95
+ curl -s -X GET \
96
+ -H "Authorization: Bearer {TOKEN}" \
97
+ "https://api.planflow.tools/organizations"
98
+ ```
99
+
100
+ **Response:**
101
+ ```json
102
+ {
103
+ "success": true,
104
+ "data": {
105
+ "organizations": [
106
+ {
107
+ "id": "org-uuid-1",
108
+ "name": "My Company",
109
+ "slug": "my-company",
110
+ "role": "owner"
111
+ },
112
+ {
113
+ "id": "org-uuid-2",
114
+ "name": "Personal",
115
+ "slug": "personal",
116
+ "role": "owner"
117
+ }
118
+ ]
119
+ }
120
+ }
121
+ ```
122
+
123
+ ## Step 5: Select or Create Organization
124
+
125
+ **If user has NO organizations:**
126
+
127
+ Create a "Personal" organization first:
128
+
129
+ ```bash
130
+ curl -s -X POST \
131
+ -H "Content-Type: application/json" \
132
+ -H "Authorization: Bearer {TOKEN}" \
133
+ -d '{"name": "Personal", "slug": "personal"}' \
134
+ "https://api.planflow.tools/organizations"
135
+ ```
136
+
137
+ Then use the returned `organization.id` as `organizationId`.
138
+
139
+ **If user has ONE organization:**
140
+
141
+ Use that organization's `id` as `organizationId` automatically.
142
+
143
+ **If user has MULTIPLE organizations:**
144
+
145
+ Ask user to select which organization to create the project in:
146
+
147
+ ```
148
+ ╭──────────────────────────────────────────────────────────────────────────────╮
149
+ │ ☁️ Select Organization │
150
+ ├──────────────────────────────────────────────────────────────────────────────┤
151
+ │ │
152
+ │ Which organization should this project belong to? │
153
+ │ │
154
+ │ 1. My Company (owner) │
155
+ │ 2. Personal (owner) │
156
+ │ 3. Team Alpha (editor) │
157
+ │ │
158
+ ╰──────────────────────────────────────────────────────────────────────────────╯
159
+ ```
160
+
161
+ Use the `AskUserQuestion` tool to let the user choose.
162
+
163
+ **NOTE:** Only organizations where user has `owner`, `admin`, or `editor` role can be used to create projects. Filter out organizations where user has `viewer` role.
164
+
165
+ ## Step 6: Show Creation Card
92
166
 
93
167
  ```
94
168
  ╭──────────────────────────────────────────────────────────────────────────────╮
@@ -98,6 +172,7 @@ If not authenticated, display error card:
98
172
  │ ⠹ Creating project on cloud... │
99
173
  │ │
100
174
  │ Project name: {projectName} │
175
+ │ Organization: {organizationName} │
101
176
  │ │
102
177
  ╰──────────────────────────────────────────────────────────────────────────────╯
103
178
  ```
@@ -107,11 +182,11 @@ If not authenticated, display error card:
107
182
  curl -s -X POST \
108
183
  -H "Content-Type: application/json" \
109
184
  -H "Authorization: Bearer {TOKEN}" \
110
- -d '{"name": "Project Name"}' \
185
+ -d '{"name": "Project Name", "organizationId": "org-uuid"}' \
111
186
  "https://api.planflow.tools/projects"
112
187
  ```
113
188
 
114
- ## Step 5: Link and Push
189
+ ## Step 7: Link and Push
115
190
 
116
191
  1. Link to new project (save projectId to config)
117
192
  2. Push current plan
@@ -132,7 +207,7 @@ curl -s -X POST \
132
207
  ╰──────────────────────────────────────────────────────────────────────────────╯
133
208
  ```
134
209
 
135
- ## Step 6: Show Success Card
210
+ ## Step 8: Show Success Card
136
211
 
137
212
  ```
138
213
  ╭──────────────────────────────────────────────────────────────────────────────╮
@@ -18,10 +18,11 @@ Send an invitation to add a new team member to the linked cloud project with inv
18
18
 
19
19
  | Role | Permissions |
20
20
  |------|-------------|
21
- | `admin` | Full access, can manage team members |
22
21
  | `editor` | Can edit tasks and plan (default) |
23
22
  | `viewer` | Read-only access |
24
23
 
24
+ **Note:** Project-level invitations support `editor` and `viewer` roles. The `owner` role is automatically assigned to the project creator. For organization-level team management with `admin` role, use `/team` command.
25
+
25
26
  ## Step 0: Load Configuration
26
27
 
27
28
  ```javascript
@@ -53,14 +54,13 @@ const t = JSON.parse(readFile(`locales/${language}.json`))
53
54
  │ │
54
55
  │ ── Available Roles ───────────────────────────────────────────────────── │
55
56
  │ │
56
- │ admin - Full access, can manage team members │
57
57
  │ editor - Can edit tasks and plan (default) │
58
58
  │ viewer - Read-only access │
59
59
  │ │
60
60
  │ ── Examples ──────────────────────────────────────────────────────────── │
61
61
  │ │
62
62
  │ /pfTeamInvite alice@company.com │
63
- │ /pfTeamInvite bob@company.com admin
63
+ │ /pfTeamInvite bob@company.com viewer
64
64
  │ │
65
65
  ╰──────────────────────────────────────────────────────────────────────────────╯
66
66
  ```
@@ -141,7 +141,7 @@ const t = JSON.parse(readFile(`locales/${language}.json`))
141
141
  │ alice@company.com is already part of this project. │
142
142
  │ │
143
143
  │ 💡 To change their role: │
144
- │ • /pfTeamRole alice@company.com admin
144
+ │ • /pfTeamRole alice@company.com editor
145
145
  │ │
146
146
  ╰──────────────────────────────────────────────────────────────────────────────╯
147
147
  ```
@@ -155,7 +155,7 @@ const t = JSON.parse(readFile(`locales/${language}.json`))
155
155
  │ │
156
156
  │ You don't have permission to invite team members. │
157
157
  │ │
158
- │ Only project owners and admins can send invitations.
158
+ │ Only project owners can send invitations.
159
159
  │ │
160
160
  ╰──────────────────────────────────────────────────────────────────────────────╯
161
161
  ```
@@ -12,17 +12,18 @@ Change the role of an existing team member in the linked cloud project with role
12
12
  ```bash
13
13
  /pfTeamRole <email> <role> # Change member's role
14
14
  /pfTeamRole bob@company.com viewer
15
- /pfTeamRole alice@company.com admin
15
+ /pfTeamRole alice@company.com editor
16
16
  ```
17
17
 
18
18
  ## Available Roles
19
19
 
20
20
  | Role | Permissions |
21
21
  |------|-------------|
22
- | `admin` | Full access, can manage team members |
23
22
  | `editor` | Can edit tasks and plan |
24
23
  | `viewer` | Read-only access |
25
24
 
25
+ **Note:** The `owner` role cannot be changed via this command. For organization-level roles (including `admin`), use `/team` command.
26
+
26
27
  ## Step 0: Load Configuration
27
28
 
28
29
  ```javascript
@@ -42,14 +43,13 @@ Change the role of an existing team member in the linked cloud project with role
42
43
  │ │
43
44
  │ ── Available Roles ───────────────────────────────────────────────────── │
44
45
  │ │
45
- │ admin - Full access, can manage team members │
46
46
  │ editor - Can edit tasks and plan │
47
47
  │ viewer - Read-only access │
48
48
  │ │
49
49
  │ ── Examples ──────────────────────────────────────────────────────────── │
50
50
  │ │
51
51
  │ /pfTeamRole bob@company.com viewer │
52
- │ /pfTeamRole alice@company.com admin
52
+ │ /pfTeamRole alice@company.com editor
53
53
  │ │
54
54
  ╰──────────────────────────────────────────────────────────────────────────────╯
55
55
  ```
@@ -95,7 +95,7 @@ Change the role of an existing team member in the linked cloud project with role
95
95
  │ │
96
96
  │ You cannot change your own role. │
97
97
  │ │
98
- │ Ask another admin or the project owner to change your role.
98
+ │ Ask the project owner to change your role.
99
99
  │ │
100
100
  ╰──────────────────────────────────────────────────────────────────────────────╯
101
101
  ```
@@ -139,7 +139,7 @@ Change the role of an existing team member in the linked cloud project with role
139
139
  │ │
140
140
  │ Invalid role: superadmin │
141
141
  │ │
142
- │ Valid roles: admin, editor, viewer
142
+ │ Valid roles: editor, viewer
143
143
  │ │
144
144
  ╰──────────────────────────────────────────────────────────────────────────────╯
145
145
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "planflow-plugin",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "PlanFlow CLI plugin for Claude Code - slash commands for project planning",
5
5
  "author": "PlanFlow <hello@planflow.tools>",
6
6
  "license": "MIT",