-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add pull, set, delete, and init subcommands #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2f3bcd8
feat: add pull and set commands with improved env generation
lemtoc bafaee4
refactor: reorganize codebase structure and improve UI messages
lemtoc b3b08d8
feat: add delete subcommand and overwrite confirmation for set
lemtoc bc255ac
docs: update README.md
lemtoc 745a7fc
feat: add init subcommand with JSONC config support
lemtoc d602e5b
chore: add changeset
lemtoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| "e2sm": minor | ||
| --- | ||
|
|
||
| add pull, set, delete, and init subcommands | ||
|
|
||
| - add `pull` command to download secrets and generate .env files | ||
| - add `set` command to upload .env files to AWS Secrets Manager | ||
| - add `delete` command to schedule secret deletion | ||
| - add `init` command to create .e2smrc.jsonc config file | ||
| - add overwrite confirmation for `set` command | ||
| - support JSONC format in config files (comments and trailing commas) | ||
| - reorganize codebase into src/commands/ and src/lib/ directories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/e2sm/assets/schema.json", | ||
| // Secret name (cannot use with template mode) | ||
| // "name": "my-secret-name", | ||
| // Or use template mode: generate secret name as $application/$stage | ||
| // "template": true, | ||
| // "application": "my-app", | ||
| // "stage": "dev", | ||
| // AWS settings | ||
| // "profile": "my-profile", | ||
| // "region": "ap-northeast-1", | ||
| // File paths | ||
| // "input": ".env.local", | ||
| // "output": ".env" | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { deleteCommand } from "./delete"; | ||
|
|
||
| describe("deleteCommand", () => { | ||
| test("has correct name", () => { | ||
| expect(deleteCommand.name).toBe("delete"); | ||
| }); | ||
|
|
||
| test("has description", () => { | ||
| expect(deleteCommand.description).toBeDefined(); | ||
| }); | ||
|
|
||
| test("defines profile flag", () => { | ||
| expect(deleteCommand.args?.profile).toEqual({ | ||
| type: "string", | ||
| short: "p", | ||
| description: "AWS profile to use", | ||
| }); | ||
| }); | ||
|
|
||
| test("defines region flag", () => { | ||
| expect(deleteCommand.args?.region).toEqual({ | ||
| type: "string", | ||
| short: "r", | ||
| description: "AWS region to use (e.g., ap-northeast-1)", | ||
| }); | ||
| }); | ||
|
|
||
| test("defines name flag", () => { | ||
| expect(deleteCommand.args?.name).toEqual({ | ||
| type: "string", | ||
| short: "n", | ||
| description: "Secret name to delete (skip interactive selection)", | ||
| }); | ||
| }); | ||
|
|
||
| test("defines recoveryDays flag", () => { | ||
| expect(deleteCommand.args?.recoveryDays).toEqual({ | ||
| type: "string", | ||
| short: "d", | ||
| toKebab: true, | ||
| description: "Recovery window in days (7-30)", | ||
| }); | ||
| }); | ||
|
|
||
| test("defines force flag", () => { | ||
| expect(deleteCommand.args?.force).toEqual({ | ||
| type: "boolean", | ||
| short: "f", | ||
| description: "Skip confirmation prompt", | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.