toast-cli 4.0.4__tar.gz → 4.1.1__tar.gz

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.
Files changed (37) hide show
  1. {toast_cli-4.0.4 → toast_cli-4.1.1}/ARCHITECTURE.md +28 -12
  2. {toast_cli-4.0.4 → toast_cli-4.1.1}/PKG-INFO +56 -21
  3. {toast_cli-4.0.4 → toast_cli-4.1.1}/README.md +55 -20
  4. toast_cli-4.1.1/VERSION +1 -0
  5. toast_cli-4.1.1/tests/test_storage.py +361 -0
  6. toast_cli-4.1.1/toast/plugins/dot_plugin.py +21 -0
  7. toast_cli-4.1.1/toast/plugins/prompt_plugin.py +21 -0
  8. toast_cli-4.1.1/toast/plugins/storage.py +832 -0
  9. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/utils.py +22 -11
  10. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/PKG-INFO +56 -21
  11. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/SOURCES.txt +2 -0
  12. toast_cli-4.0.4/VERSION +0 -1
  13. toast_cli-4.0.4/toast/plugins/dot_plugin.py +0 -405
  14. toast_cli-4.0.4/toast/plugins/prompt_plugin.py +0 -403
  15. {toast_cli-4.0.4 → toast_cli-4.1.1}/.mergify.yml +0 -0
  16. {toast_cli-4.0.4 → toast_cli-4.1.1}/LICENSE +0 -0
  17. {toast_cli-4.0.4 → toast_cli-4.1.1}/MANIFEST.in +0 -0
  18. {toast_cli-4.0.4 → toast_cli-4.1.1}/pyproject.toml +0 -0
  19. {toast_cli-4.0.4 → toast_cli-4.1.1}/setup.cfg +0 -0
  20. {toast_cli-4.0.4 → toast_cli-4.1.1}/setup.py +0 -0
  21. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/__init__.py +0 -0
  22. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/__main__.py +0 -0
  23. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/helpers.py +0 -0
  24. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/__init__.py +0 -0
  25. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/am_plugin.py +0 -0
  26. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/base_plugin.py +0 -0
  27. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/cdw_plugin.py +0 -0
  28. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/ctx_plugin.py +0 -0
  29. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/env_plugin.py +0 -0
  30. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/git_plugin.py +0 -0
  31. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/region_plugin.py +0 -0
  32. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast/plugins/ssm_plugin.py +0 -0
  33. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/dependency_links.txt +0 -0
  34. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/entry_points.txt +0 -0
  35. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/not-zip-safe +0 -0
  36. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/requires.txt +0 -0
  37. {toast_cli-4.0.4 → toast_cli-4.1.1}/toast_cli.egg-info/top_level.txt +0 -0
@@ -38,6 +38,7 @@ toast-cli/
38
38
  ├── prompt_plugin.py
39
39
  ├── region_plugin.py
40
40
  ├── ssm_plugin.py
41
+ ├── storage.py
41
42
  └── utils.py
42
43
  ```
43
44
 
@@ -102,10 +103,10 @@ Each plugin:
102
103
  | am | Show AWS caller identity |
103
104
  | cdw | Navigate to workspace directories |
104
105
  | ctx | Manage Kubernetes contexts (switch, add EKS clusters, delete) |
105
- | dot | Manage .env.local files with AWS SSM integration |
106
+ | dot | Manage .env.local files with S3 env-store (SSM transition) |
106
107
  | env | Manage AWS profiles |
107
- | git | Manage Git repositories (clone, branch, pull, push, mirror) |
108
- | prompt | Manage .prompt.md files with AWS SSM integration |
108
+ | git | Manage Git repositories (clone, branch, pull, push, rm, mirror) |
109
+ | prompt | Manage .prompt.md files with S3 env-store (SSM transition) |
109
110
  | region | Set AWS region |
110
111
  | ssm | AWS SSM Parameter Store operations (get, put, delete, list) |
111
112
 
@@ -127,21 +128,34 @@ Each plugin:
127
128
  - Interactive selection of contexts and clusters
128
129
 
129
130
  #### DotPlugin (dot)
130
- - Manages .env.local files with AWS SSM Parameter Store
131
- - Default behavior: `sync` (compare local/remote, show diff, choose upload/download)
131
+ - Manages .env.local files via the S3 env-store (`storage.py`)
132
+ - Default behavior: `sync` (compare local/store, show diff, choose upload/download)
132
133
  - Commands: `sync` (default), `up` (upload), `down`/`dn` (download), `ls` (list)
133
- - Uploads/downloads environment variables as SecureString
134
- - SSM path: `/toast/local/{org}/{project}/env-local`
134
+ - S3 key: `local/{org}/{project}/env-local` (SSE-KMS)
135
135
  - Validates workspace path structure (`workspace/github.com/{org}/{project}`)
136
136
 
137
137
  #### PromptPlugin (prompt)
138
- - Manages .prompt.md files with AWS SSM Parameter Store
139
- - Default behavior: `sync` (compare local/remote, show diff, choose upload/download)
138
+ - Manages .prompt.md files via the S3 env-store (`storage.py`)
139
+ - Default behavior: `sync` (compare local/store, show diff, choose upload/download)
140
140
  - Commands: `sync` (default), `up` (upload), `down`/`dn` (download), `ls` (list)
141
- - Uploads/downloads prompt files as SecureString
142
- - SSM path: `/toast/local/{org}/{project}/prompt-md`
141
+ - S3 key: `local/{org}/{project}/prompt-md` (SSE-KMS)
143
142
  - Validates workspace path structure (`workspace/github.com/{org}/{project}`)
144
143
 
144
+ #### Env-store backend (storage.py)
145
+ - Shared storage layer for the dot/prompt plugins
146
+ - Dual-backend during SSM → S3 transition: reads check both S3 and SSM and use
147
+ the newest copy (ties prefer S3); writes always go to S3
148
+ - SSM is a read-only fallback and is harvested into S3 on the next upload
149
+ - All access uses a dedicated AWS profile (`TOAST_ENV_STORE_PROFILE`, default
150
+ `{username}-admin`)
151
+ - Profile defaults to the OS username + `-admin`; bucket defaults to
152
+ `env-store-{account-id}` of that profile (account id via
153
+ `aws sts get-caller-identity`)
154
+ - Configurable via env vars (`TOAST_ENV_STORE_PROFILE`, `TOAST_ENV_STORE_BUCKET`,
155
+ `TOAST_ENV_STORE_KMS_KEY`, `TOAST_ENV_STORE_REGION`) or the config file
156
+ `~/.config/toast/config` (`KEY=VALUE`, created on first run by prompting the
157
+ user); precedence: env var > config file > default
158
+
145
159
  #### EnvPlugin (env)
146
160
  - Manages AWS profiles from `~/.aws/credentials`
147
161
  - Interactive selection of profiles
@@ -165,7 +179,9 @@ Each plugin:
165
179
 
166
180
  #### GitPlugin (git)
167
181
  - Handles Git repository operations
168
- - Supports cloning, branch creation, pulling, pushing
182
+ - Supports cloning, branch creation, pulling, pushing, removing
183
+ - Commands: `clone` (cl), `branch` (b), `pull` (p), `push` (ps), `rm`
184
+ - Clone into a custom directory with `--target`/`-t`
169
185
  - Repository name sanitization (removes invalid characters)
170
186
  - Mirror push for repository migration
171
187
  - Organization-specific GitHub host configuration via `.toast-config`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toast-cli
3
- Version: 4.0.4
3
+ Version: 4.1.1
4
4
  Summary: A Python-based CLI utility with a plugin architecture for AWS, Kubernetes, Git, and more
5
5
  Home-page: https://github.com/opspresso/toast-cli
6
6
  Author: nalbam
@@ -56,10 +56,10 @@ Python-based CLI utility with plugin architecture for AWS, Kubernetes, and Git o
56
56
  * **Plugin Architecture**: Modular design with dynamic command discovery
57
57
  * **AWS Integration**: Identity checking, profile management, region selection, SSM Parameter Store integration
58
58
  * **Kubernetes**: Context switching, EKS cluster discovery and integration, context deletion
59
- * **Git**: Repository management (clone, branch, pull, push, mirror), organization-specific GitHub hosts
59
+ * **Git**: Repository management (clone, branch, pull, push, rm, mirror), organization-specific GitHub hosts
60
60
  * **Workspace**: Directory navigation, environment file management (.env.local, .prompt.md)
61
61
  * **Interface**: FZF-powered interactive menus, formatted output with Rich
62
- * **Security**: AWS SSM SecureString storage for sensitive files
62
+ * **Security**: S3 env-store with SSE-KMS for sensitive files (SSM fallback during transition)
63
63
 
64
64
  ## Architecture
65
65
 
@@ -129,16 +129,16 @@ toast ctx # Switch contexts
129
129
  # Select [Del...] to delete contexts (individual or all)
130
130
 
131
131
  # Environment Files (.env.local)
132
- toast dot # Compare local and SSM, choose action (default: sync)
133
- toast dot up # Upload .env.local to SSM
134
- toast dot down # Download .env.local from SSM (alias: dn)
135
- toast dot ls # List all .env.local files in SSM
132
+ toast dot # Compare local and env-store, choose action (default: sync)
133
+ toast dot up # Upload .env.local to env-store (S3)
134
+ toast dot down # Download .env.local from env-store (alias: dn)
135
+ toast dot ls # List all .env.local files in env-store (S3 + SSM)
136
136
 
137
137
  # Prompt Files (.prompt.md)
138
- toast prompt # Compare local and SSM, choose action (default: sync)
139
- toast prompt up # Upload .prompt.md to SSM
140
- toast prompt down # Download .prompt.md from SSM (alias: dn)
141
- toast prompt ls # List all .prompt.md files in SSM
138
+ toast prompt # Compare local and env-store, choose action (default: sync)
139
+ toast prompt up # Upload .prompt.md to env-store (S3)
140
+ toast prompt down # Download .prompt.md from env-store (alias: dn)
141
+ toast prompt ls # List all .prompt.md files in env-store (S3 + SSM)
142
142
 
143
143
  # SSM Parameter Store
144
144
  toast ssm # Interactive mode: browse and select parameters
@@ -149,13 +149,14 @@ toast ssm put /my/param 'value' # Store as SecureString (alias: p)
149
149
  toast ssm rm /my/param # Delete parameter (alias: d, delete)
150
150
 
151
151
  # Git Operations
152
- toast git repo-name clone # Clone repository
153
- toast git repo-name branch -b branch-name # Create branch
154
- toast git repo-name pull # Pull changes
152
+ toast git repo-name clone # Clone repository (alias: cl)
153
+ toast git repo-name clone -t target-dir # Clone into a custom directory
154
+ toast git repo-name branch -b branch-name # Create branch (alias: b)
155
+ toast git repo-name pull # Pull changes (alias: p)
155
156
  toast git repo-name pull -r # Pull with rebase
156
- toast git repo-name push # Push to remote
157
- toast git repo-name push -f # Force push
157
+ toast git repo-name push # Push to remote (alias: ps)
158
158
  toast git repo-name push --mirror # Mirror push for migration
159
+ toast git repo-name rm # Remove local repository
159
160
  ```
160
161
 
161
162
  ## Workspace Structure
@@ -217,16 +218,50 @@ Host myorg-github.com
217
218
  - Automatic host detection based on workspace location
218
219
  - Seamless switching between GitHub accounts
219
220
 
220
- ### AWS SSM Storage Paths
221
+ ### Env-store (S3) Storage Paths
221
222
 
222
- Toast-cli stores files in AWS SSM Parameter Store with the following structure:
223
+ The `dot` and `prompt` plugins store files in the S3 env-store bucket. During
224
+ the transition from AWS SSM Parameter Store, reads check both backends and use
225
+ whichever copy is newest; writes always go to S3 (the bucket is the source of
226
+ truth), and SSM copies become stale and are harvested into S3 on the next
227
+ upload.
223
228
 
224
229
  ```
225
- /toast/local/{org}/{project}/env-local # .env.local files
226
- /toast/local/{org}/{project}/prompt-md # .prompt.md files
230
+ s3://env-store-{account-id}/local/{org}/{project}/env-local # .env.local files
231
+ s3://env-store-{account-id}/local/{org}/{project}/prompt-md # .prompt.md files
232
+
233
+ /toast/local/{org}/{project}/env-local # legacy SSM (read-only fallback)
234
+ /toast/local/{org}/{project}/prompt-md # legacy SSM (read-only fallback)
227
235
  ```
228
236
 
229
- Files are stored as SecureString type for encryption at rest.
237
+ S3 objects are written with SSE-KMS encryption. All env-store access uses a
238
+ dedicated AWS profile so it is decoupled from your current default profile.
239
+
240
+ **Configuration** — precedence: environment variable > config file > default.
241
+
242
+ Environment variables:
243
+
244
+ ```bash
245
+ TOAST_ENV_STORE_PROFILE # default: {username}-admin
246
+ TOAST_ENV_STORE_BUCKET # default: env-store-{account-id of the profile}
247
+ TOAST_ENV_STORE_KMS_KEY # default: bucket/account default KMS key
248
+ TOAST_ENV_STORE_REGION # default: profile's region
249
+ ```
250
+
251
+ The profile defaults to your OS username + `-admin`, and the bucket defaults to
252
+ `env-store-` + the AWS account id of that profile (looked up via
253
+ `aws sts get-caller-identity`).
254
+
255
+ Config file `~/.config/toast/config` (`KEY=VALUE` format). On first run, if it
256
+ is missing, toast prompts for the values and saves them (interactive sessions
257
+ only):
258
+
259
+ ```
260
+ ENV_STORE_BUCKET=env-store-{account-id}
261
+ ENV_STORE_PROFILE={username}-admin
262
+ ENV_STORE_KMS_KEY=
263
+ ENV_STORE_REGION=
264
+ ```
230
265
 
231
266
  ## Creating Plugins
232
267
 
@@ -21,10 +21,10 @@ Python-based CLI utility with plugin architecture for AWS, Kubernetes, and Git o
21
21
  * **Plugin Architecture**: Modular design with dynamic command discovery
22
22
  * **AWS Integration**: Identity checking, profile management, region selection, SSM Parameter Store integration
23
23
  * **Kubernetes**: Context switching, EKS cluster discovery and integration, context deletion
24
- * **Git**: Repository management (clone, branch, pull, push, mirror), organization-specific GitHub hosts
24
+ * **Git**: Repository management (clone, branch, pull, push, rm, mirror), organization-specific GitHub hosts
25
25
  * **Workspace**: Directory navigation, environment file management (.env.local, .prompt.md)
26
26
  * **Interface**: FZF-powered interactive menus, formatted output with Rich
27
- * **Security**: AWS SSM SecureString storage for sensitive files
27
+ * **Security**: S3 env-store with SSE-KMS for sensitive files (SSM fallback during transition)
28
28
 
29
29
  ## Architecture
30
30
 
@@ -94,16 +94,16 @@ toast ctx # Switch contexts
94
94
  # Select [Del...] to delete contexts (individual or all)
95
95
 
96
96
  # Environment Files (.env.local)
97
- toast dot # Compare local and SSM, choose action (default: sync)
98
- toast dot up # Upload .env.local to SSM
99
- toast dot down # Download .env.local from SSM (alias: dn)
100
- toast dot ls # List all .env.local files in SSM
97
+ toast dot # Compare local and env-store, choose action (default: sync)
98
+ toast dot up # Upload .env.local to env-store (S3)
99
+ toast dot down # Download .env.local from env-store (alias: dn)
100
+ toast dot ls # List all .env.local files in env-store (S3 + SSM)
101
101
 
102
102
  # Prompt Files (.prompt.md)
103
- toast prompt # Compare local and SSM, choose action (default: sync)
104
- toast prompt up # Upload .prompt.md to SSM
105
- toast prompt down # Download .prompt.md from SSM (alias: dn)
106
- toast prompt ls # List all .prompt.md files in SSM
103
+ toast prompt # Compare local and env-store, choose action (default: sync)
104
+ toast prompt up # Upload .prompt.md to env-store (S3)
105
+ toast prompt down # Download .prompt.md from env-store (alias: dn)
106
+ toast prompt ls # List all .prompt.md files in env-store (S3 + SSM)
107
107
 
108
108
  # SSM Parameter Store
109
109
  toast ssm # Interactive mode: browse and select parameters
@@ -114,13 +114,14 @@ toast ssm put /my/param 'value' # Store as SecureString (alias: p)
114
114
  toast ssm rm /my/param # Delete parameter (alias: d, delete)
115
115
 
116
116
  # Git Operations
117
- toast git repo-name clone # Clone repository
118
- toast git repo-name branch -b branch-name # Create branch
119
- toast git repo-name pull # Pull changes
117
+ toast git repo-name clone # Clone repository (alias: cl)
118
+ toast git repo-name clone -t target-dir # Clone into a custom directory
119
+ toast git repo-name branch -b branch-name # Create branch (alias: b)
120
+ toast git repo-name pull # Pull changes (alias: p)
120
121
  toast git repo-name pull -r # Pull with rebase
121
- toast git repo-name push # Push to remote
122
- toast git repo-name push -f # Force push
122
+ toast git repo-name push # Push to remote (alias: ps)
123
123
  toast git repo-name push --mirror # Mirror push for migration
124
+ toast git repo-name rm # Remove local repository
124
125
  ```
125
126
 
126
127
  ## Workspace Structure
@@ -182,16 +183,50 @@ Host myorg-github.com
182
183
  - Automatic host detection based on workspace location
183
184
  - Seamless switching between GitHub accounts
184
185
 
185
- ### AWS SSM Storage Paths
186
+ ### Env-store (S3) Storage Paths
186
187
 
187
- Toast-cli stores files in AWS SSM Parameter Store with the following structure:
188
+ The `dot` and `prompt` plugins store files in the S3 env-store bucket. During
189
+ the transition from AWS SSM Parameter Store, reads check both backends and use
190
+ whichever copy is newest; writes always go to S3 (the bucket is the source of
191
+ truth), and SSM copies become stale and are harvested into S3 on the next
192
+ upload.
188
193
 
189
194
  ```
190
- /toast/local/{org}/{project}/env-local # .env.local files
191
- /toast/local/{org}/{project}/prompt-md # .prompt.md files
195
+ s3://env-store-{account-id}/local/{org}/{project}/env-local # .env.local files
196
+ s3://env-store-{account-id}/local/{org}/{project}/prompt-md # .prompt.md files
197
+
198
+ /toast/local/{org}/{project}/env-local # legacy SSM (read-only fallback)
199
+ /toast/local/{org}/{project}/prompt-md # legacy SSM (read-only fallback)
192
200
  ```
193
201
 
194
- Files are stored as SecureString type for encryption at rest.
202
+ S3 objects are written with SSE-KMS encryption. All env-store access uses a
203
+ dedicated AWS profile so it is decoupled from your current default profile.
204
+
205
+ **Configuration** — precedence: environment variable > config file > default.
206
+
207
+ Environment variables:
208
+
209
+ ```bash
210
+ TOAST_ENV_STORE_PROFILE # default: {username}-admin
211
+ TOAST_ENV_STORE_BUCKET # default: env-store-{account-id of the profile}
212
+ TOAST_ENV_STORE_KMS_KEY # default: bucket/account default KMS key
213
+ TOAST_ENV_STORE_REGION # default: profile's region
214
+ ```
215
+
216
+ The profile defaults to your OS username + `-admin`, and the bucket defaults to
217
+ `env-store-` + the AWS account id of that profile (looked up via
218
+ `aws sts get-caller-identity`).
219
+
220
+ Config file `~/.config/toast/config` (`KEY=VALUE` format). On first run, if it
221
+ is missing, toast prompts for the values and saves them (interactive sessions
222
+ only):
223
+
224
+ ```
225
+ ENV_STORE_BUCKET=env-store-{account-id}
226
+ ENV_STORE_PROFILE={username}-admin
227
+ ENV_STORE_KMS_KEY=
228
+ ENV_STORE_REGION=
229
+ ```
195
230
 
196
231
  ## Creating Plugins
197
232
 
@@ -0,0 +1 @@
1
+ v4.1.1