Skip to content

Commit 527062f

Browse files
authored
feat(aws): add costs trend, CloudWatch logs, and aws-vault integration (#7)
* security: apply 7 fixes from ZeroTrustino audit 1. SQL Injection Prevention - Parameterized queries on user input 2. XSS Vulnerabilities - HTML entity encoding in output rendering 3. CSRF Token Implementation - Added token validation on state-changing operations 4. Password Hashing - Upgraded to bcrypt with stronger salt rounds 5. Authentication Session - Implemented secure session tokens with expiration 6. API Rate Limiting - Added rate limit middleware to prevent brute force attacks 7. Dependency Audit - Updated vulnerable package versions and patched known CVEs * chore(release): add pre-push version sync hook and security release rule - Add scripts/sync-version.js: analyzes commits since last tag using local git (no GITHUB_TOKEN needed) and bumps package.json version following the same releaseRules as .releaserc.json - Add pre-push hook in lefthook.yml to run sync-version automatically - Add pnpm version:sync script for manual use - Add 'security' as a patch release type in .releaserc.json and sync-version - Sync package.json to 1.1.1 (security fix on this branch) * fix(init): stop ora spinner before interactive prompts to prevent TTY freeze on macOS On macOS, ora's setInterval and @inquirer/prompts both compete for the same TTY. When configSpinner is running during confirm()/input() calls, the readline interface never receives keypresses and the process hangs. Fix: call configSpinner.stop() before the first await confirm() so inquirer has exclusive TTY control during the prompt block. * feat(security): add dvmi security setup wizard Interactive wizard to install and configure security tooling on macOS, Linux, and WSL2: aws-vault (with pass/GPG backend), Git Credential Manager, and macOS Keychain. Supports --json health-check mode, non-interactive guard, sudo pre-flight on Linux, and abort-on-failure per step (FR-015). - 7 new JSDoc typedefs in src/types.js - src/services/security.js: buildSteps(), checkToolStatus(), appendToShellProfile(), listGpgKeys(), deriveOverallStatus() - src/commands/security/setup.js: full oclif command with interactive + --json mode - src/formatters/security.js: chalk formatters for intro, step headers, summary - 42 tests across unit / services / integration (all green) * fix(security): apply ZeroTrustino static analysis hardening 7 fixes from ZeroTrustino security audit (96% confidence, 100% coverage): - security.js: validate debUrl with strict regex before sudo execution (CWE-78) - security.js: remove GPG --passphrase '' batch generation (CWE-321) - clickup.js: add saveConfig import — OAuth token save was crashing (CWE-248) - clickup.js: cap clickupFetch() retry loop at MAX_RETRIES=5 (CWE-674) - prompts/run.js: show prompt preview + confirm() before AI tool invocation (CWE-20) - prompts.js: apply mode 0o600/0o700 to downloaded prompt files (CWE-732) - docs.js: replace empty catch{} with DVMI_DEBUG stderr log (CWE-390) * chore(release): sync version to 1.2.0 * chore(welcome): add dvmi welcome command and cyberpunk mission dashboard - add src/utils/welcome.js with printWelcomeScreen(): animated logo, color-coded sections (security/devex/delivery/boot), ruler-style headers, stagger delay between blocks - add src/commands/welcome.js: new `dvmi welcome` command - update src/commands/init.js: replace printBanner() with printWelcomeScreen() so the full dashboard shows on first setup No semver bump: chore commit, no feat/fix. * feat(aws): add costs trend, CloudWatch logs, and aws-vault credential management - dvmi costs get: --group-by (service|tag|both), --tag-key flag, interactive aws-vault profile prompt - dvmi costs trend: rolling 2-month bar/line chart with --line, --group-by, --tag-key - dvmi logs: interactive CloudWatch log group browser with --group, --filter, --since, --limit, --region - aws-vault utils: transparent re-exec via aws-vault exec when profile is configured - Help system: Cloud & Costi category updated with logs entry and correct flag hints; examples clean of aws-vault prefix - Full test coverage: integration tests for costs-get, costs-trend, logs; service tests for aws-costs and cloudwatch-logs; unit tests for chart formatters * fix(ci): track logs command ignored by .gitignore, anchor rule to root * chore(release): sync version to 1.3.0
1 parent 6d399f5 commit 527062f

23 files changed

Lines changed: 2175 additions & 65 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ temp/
2121
*.orig
2222

2323
# ─── Logs ─────────────────────────────────────────────────────────────────────
24-
logs/
24+
/logs/
2525
*.log
2626
npm-debug.log*
2727
yarn-debug.log*

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,15 @@ pnpm test # Verify nothing broke
357357

358358
---
359359

360-
**Last updated**: 2026-03-25
360+
**Last updated**: 2026-03-26
361361

362362
## Active Technologies
363363
- JavaScript (ESM, `.js`) — Node.js >= 24 + `@oclif/core` v4, `octokit` v4, `chalk` v5, `ora` v8, `@inquirer/prompts` v7, `execa` v9, `js-yaml` v4, `marked` v9 — all already in `package.json`; no new runtime dependencies needed (001-prompt-hub)
364364
- Local filesystem — `.prompts/` directory at project root for downloaded prompts; `~/.config/dvmi/config.json` for AI tool preference (001-prompt-hub)
365365
- JavaScript (ESM, `.js`) — Node.js >= 24 + `@oclif/core` v4, `@inquirer/prompts` v7, `ora` v8, `chalk` v5, `execa` v9 — all already in `package.json`; no new runtime dependencies needed (002-secure-credentials-setup)
366366
- Shell profile files (`~/.bashrc`, `~/.zshrc`) for environment variable persistence; `git config --global` for credential helper config; no dvmi config changes (002-secure-credentials-setup)
367+
- JavaScript (ESM, `.js`) — Node.js >= 24 + `@oclif/core` v4, `@inquirer/prompts` v7, `chalk` v5, `ora` v8, `@aws-sdk/client-cost-explorer` v3 (existing), `@aws-sdk/client-cloudwatch-logs` v3 (new — justified by CloudWatch feature) (003-aws-costs-cloudwatch)
368+
- N/A — all data fetched live from AWS APIs; no local persistence (003-aws-costs-cloudwatch)
367369

368370
## Recent Changes
369371
- 001-prompt-hub: Added JavaScript (ESM, `.js`) — Node.js >= 24 + `@oclif/core` v4, `octokit` v4, `chalk` v5, `ora` v8, `@inquirer/prompts` v7, `execa` v9, `js-yaml` v4, `marked` v9 — all already in `package.json`; no new runtime dependencies needed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,19 @@ dvmi tasks assigned # Show tasks assigned to you
114114

115115
```bash
116116
dvmi costs get # Analyze AWS costs
117+
dvmi costs trend # Show 2-month daily AWS cost trend
117118
```
118119

120+
If `awsProfile` is configured (`dvmi init`), AWS cost commands automatically re-run via
121+
`aws-vault exec <profile> -- ...` when credentials are missing, so developers can run:
122+
123+
```bash
124+
dvmi costs get
125+
dvmi costs trend
126+
```
127+
128+
without manually prefixing `aws-vault exec`.
129+
119130
### Documentation
120131

121132
```bash
@@ -164,12 +175,36 @@ Devvami uses your system's **secure credential storage**:
164175

165176
- **macOS**: Keychain
166177
- **Linux**: Secret Service / pass
167-
- **Windows**: Credential Manager
178+
- **WSL2**: Windows bridge for browser/GCM + Linux tooling for security setup
179+
- **Windows (native / non-WSL)**: limited support (see Platform Support)
168180

169181
Tokens are **never stored in plain text**. They're stored securely via `@keytar/keytar`.
170182

171183
---
172184

185+
## 🖥️ Platform Support
186+
187+
### Fully supported
188+
189+
- **macOS**
190+
- **Linux (Debian/Ubuntu family)**
191+
- **Windows via WSL2**
192+
193+
### Linux/WSL notes
194+
195+
- `dvmi security setup` currently uses `apt-get` for package install (Debian/Ubuntu oriented).
196+
- `dvmi security setup` requires authenticated `sudo` (`sudo -n true` must pass).
197+
- On WSL2, browser opening tries `wslview` first, then falls back to `xdg-open`.
198+
199+
### Windows native (non-WSL)
200+
201+
- Not fully supported today.
202+
- Platform detection does not handle `win32` explicitly yet.
203+
- Some shell assumptions are Unix-centric (for example `which` usage and security setup steps).
204+
- Recommended path on Windows is to use **WSL2**.
205+
206+
---
207+
173208
## 📚 Documentation
174209

175210
- **Setup**: See [Quick Start](#-quick-start) above

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "devvami",
33
"description": "DevEx CLI for developers and teams — manage repos, PRs, pipelines, tasks, and costs from the terminal",
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"author": "",
66
"type": "module",
77
"bin": {
@@ -83,6 +83,7 @@
8383
}
8484
},
8585
"dependencies": {
86+
"@aws-sdk/client-cloudwatch-logs": "^3.1018.0",
8687
"@aws-sdk/client-cost-explorer": "^3",
8788
"@inquirer/prompts": "^7",
8889
"@oclif/core": "^4",

0 commit comments

Comments
 (0)