Commit 6bef7b0
authored
Improvements (#35)
* updated errors with error codes
* made improvements to allow the disabling of the spinner animation
* implemented changes to improve the codebase and upgrade packages
* improved file reading and writing
* updated jsdocs
* removed unused code
* improved the cardKey handling
* removed duplicate logic
* added error codes to the readme
* Cleaned up error handling
* added tests and other small improvements
* added testing to readme
* improved command help text
* improved the output formats
* added yaml outtput
* improved error handling on required values
* added file validation
* further improvements
* allowed normalised filenames
* piping
* added history
* added autocomplete
* added unix error codes
* added command categories
* Added improved command descriptions
* added validation
* added aliases
* added standard confirmations for all destructive commands
* added config profiles and atomic writes
* Added rate limiting support
* added support for large file uploads
* corrected tests after the large upload changes
* added generate docs command
* updated the dependencies
* removed unused md files
* Added initial improvements identified from CLIG
* added suport for temp dir
* added the ability to customize the editor used
* improved handling of terminals not supporting emojis
* improved the security posture on keys
* corrected lit errors
* improved the AI instruction sets
* added an example CI_CD file
* added coderabbit improvements
* copilot suggestions
* coderabbit improvements
* further improvements from coderabbit
* corrected errors
* Improve spinner lifecycle and CLI error handling.
Ensure spinners always clear cleanly across commands, normalize Investec API failures into CliError messages, and tighten table rendering/verbose behavior for cleaner terminal output.
Made-with: Cursor
* Add phased CLI improvement plan document.
Capture prioritized workstreams for spinner/error hardening, command refactoring, utils modularization, and integration testing.
Made-with: Cursor
* Add utility baseline tests and PB auth error normalization.
Cover debug/spinner/error helper behavior in unit tests and normalize Programmable Banking auth failures to consistent CliError output.
Made-with: Cursor
* Add shared spinner wrapper and migrate core list commands.
Introduce withSpinner() for standardized spinner lifecycle handling and refactor accounts/cards commands to use it for cleaner control flow and guaranteed cleanup.
Made-with: Cursor
* Migrate balances and transactions to shared spinner wrapper.
Use withSpinner() for consistent spinner lifecycle handling and cleaner command flow in balance and transaction fetch commands.
Made-with: Cursor
* Migrate remaining list commands to withSpinner wrapper.
Apply shared spinner lifecycle handling to beneficiaries, countries, currencies, and merchants commands for consistent cleanup and reduced boilerplate.
Made-with: Cursor
* Migrate write commands to withSpinner lifecycle wrapper.
Apply shared spinner handling to fetch/logs/upload/env/published/publish commands and tighten guarded writes for strict type safety.
Made-with: Cursor
* Migrate remaining spinner-heavy commands to withSpinner.
Refactor deploy, disable, toggle, run, and ai commands to use shared spinner lifecycle management for consistent cleanup and simpler control flow.
Made-with: Cursor
* Add outcome-aware spinner helper for command status flows.
Introduce withSpinnerOutcome() and migrate transfer/upload-env to shared success-fail spinner handling instead of manual start/succeed/fail blocks.
Made-with: Cursor
* Add shared list-output runner and migrate accounts/cards.
Introduce runListCommand() to centralize empty/list output behavior and refactor accounts/cards commands plus tests to use the shared helper.
Made-with: Cursor
* Migrate remaining list commands to shared list runner.
Refactor beneficiaries, countries, currencies, and merchants commands to use runListCommand for consistent list output behavior and reduced duplication.
Made-with: Cursor
* Add shared write runner and migrate fetch/logs commands.
Introduce runWriteCommand() for common file write progress/success output and refactor fetch/logs plus tests to use the new abstraction.
Made-with: Cursor
* Migrate env and published commands to shared write runner.
Use runWriteCommand() for consistent write progress and final size output when saving env variables and published code.
Made-with: Cursor
* Add shared read-upload runner and migrate upload/publish.
Introduce runReadUploadCommand() to unify read-and-upload spinner flow and refactor upload and publish commands plus tests to use the helper.
Made-with: Cursor
* Migrate balances and transactions to shared list runner.
Use runListCommand() for transaction and balance output flow and update tests to assert list-runner integration.
Made-with: Cursor
* Standardize env-list output and expand shared-runner tests.
Route env-list structured output through runListCommand and add direct utility coverage for list/read-upload/outcome runners plus command coverage for env-list.
Made-with: Cursor
* Begin Phase 3 utils extraction with runtime and API error modules.
Move runtime flag helpers and Investec error normalization into dedicated utility modules while preserving existing imports through utils.ts re-exports.
Made-with: Cursor
* Extract terminal, spinner, output, and runner helpers from utils.
Split terminal detection, spinner lifecycle, output formatting, and command runner utilities into dedicated modules while keeping utils.ts as a compatibility re-export surface.
Made-with: Cursor
* Extract API initialization and credential validation utilities.
Move Card/PB API initialization and credential validation logic into dedicated modules and keep utils.ts as a compatibility export surface.
Made-with: Cursor
* Extract command history utilities into dedicated module.
Move history path/read/log logic and entry typing into utils/history.ts while preserving existing imports through utils.ts re-exports.
Made-with: Cursor
* Extract update-check and version notification utilities.
Move npm version lookup, update cache handling, and notification rendering into utils/update.ts while preserving public access via utils.ts re-exports.
Made-with: Cursor
* Extract credentials and profile storage into dedicated module.
Move credentials IO, atomic writes, and profile management into utils/credentials-store.ts and update history/update modules to import atomic writes directly from the new module.
Made-with: Cursor
* Extract retry and rate-limit handling into dedicated module.
Move rate-limit detection, formatting, and exponential-backoff retry logic into utils/retry.ts while preserving existing imports through utils.ts re-exports.
Made-with: Cursor
* Extract file path and permission validation utilities.
Move path normalization, extension validation, and read/write permission checks into utils/file-validation.ts while preserving existing imports via utils.ts re-exports.
Made-with: Cursor
* Extract core input validation helpers into dedicated module.
Move account and amount validation logic into utils/input-validation.ts while preserving existing usage via utils.ts re-exports.
Made-with: Cursor
* Extract security and CLI error orchestration utilities.
Move environment secret warning logic and CLI error handling/context wrappers into dedicated modules while keeping utils.ts as the compatibility export surface.
Made-with: Cursor
* Extract interaction and editor helper utilities.
Move paging, temp/module path helpers, editor launching, and destructive-operation confirmation into utils/interaction.ts while keeping utils.ts compatibility re-exports.
Made-with: Cursor
* Add --no-spinner compatibility and deprecate legacy spinner flag.
Support --no-spinner by normalizing it to existing spinner-disable behavior, emit a deprecation warning for --spinner/-s, and include the new flag in generated command docs/completion metadata.
Made-with: Cursor
* Harden spinner flag compatibility with targeted normalization tests.
Extract spinner flag normalization into a dedicated utility for testability and add tests covering --no-spinner mapping plus deprecation detection for legacy --spinner/-s usage.
Made-with: Cursor
* Add integration safety-net tests for core command flows.
Introduce command-level integration coverage for accounts/cards piped output and deploy/fetch spinner cleanup on errors to catch regressions in terminal-mode behavior.
Made-with: Cursor
* Apply lint-driven cleanup and stabilize recent refactor outputs.
Run project-wide Biome fixes, resolve remaining lint blockers in publish/upload/output helpers, and align formatting/import order updates across affected command, utility, config, and template files.
Made-with: Cursor
* Expand utility test coverage for extracted modules.
Add focused tests for security, file validation, interaction, and retry utilities to improve regression detection after the utils modularization work.
Made-with: Cursor
* Harden credentials loading, output safety, and history redaction.
Fix JSON credentials-file import handling for ESM and relative paths, tighten write-permission validation behavior, route update notices to stderr, and add focused regression tests for credentials loading, file permissions, update output, and history sanitization.
Made-with: Cursor
* Improve CI stability and extend destructive command test coverage.
Suppress update notifications for machine-readable output modes, replace environment-specific file paths in utility tests with portable temp files, and add focused pay/transfer command tests for confirmation and prompt-driven flows.
Made-with: Cursor
* Harden release automation and add snap distribution pipeline.
This improves CI/release safety with tighter workflow permissions and concurrency, adds packaged binary smoke testing, and automates Snap build/publish with documented credential setup for GitHub Actions.
Made-with: Cursor
* Apply lint-driven formatting cleanup across utils and tests.
This normalizes import ordering and line wrapping in utility and test modules to keep style output consistent after recent refactors.
Made-with: Cursor
* Expand command coverage for run and upload-env flows.
Add focused tests for run command environment parsing and missing-env handling, plus upload-env success/error scenarios and default card key behavior to reduce regression risk in high-impact command paths.
Made-with: Cursor
* Broaden command test coverage across reference data, writes, and tooling.
Add tests for simulate, register, config/profile flows, enable/disable, env/published/logs output paths, countries/currencies/merchants/beneficiaries, new project scaffolding, and docs generation to reduce regression risk in high-impact CLI paths.
Made-with: Cursor
* Fix CI TypeScript errors and add Husky pre-push verification.
Harden loadCredentialsFile JSON import typing for tsc, use NodeJS.ErrnoException for write permission checks, add husky with pre-push running verify:ci, and wire prepare script so installs configure git hooks.
Made-with: Cursor
* Load credentials JSON without dynamic import; add PERMISSION_DENIED error code.
Read credentials files with readFile and JSON.parse to avoid Vitest/Vite dynamic-import URL warnings, support optional default-wrapped JSON, and map EACCES/EPERM to E4017 with correct exit handling and CLI tips.
Made-with: Cursor
* chore: align Node.js to 22+ (engines, CI, docs)
- Set engines.node to >=22.0.0 in package.json and lockfile
- Run CI and release workflows on Node 22.x
- Update README, .cursorrules, and Copilot instructions
Made-with: Cursor
* test: Phase 1 output and Investec error coverage
- Add printTable/formatOutput tests (narrow terminal, NO_COLOR, piped JSON)
- Add normalizeInvestecError unit tests at utils/investec-errors
- Extend resolveSpinnerState cases (TTY on, DEBUG disables spinner)
- Biome import order fixes in existing command tests
Made-with: Cursor
* Fix pkg smoke test by bundling cli-table3 without createRequire.
createRequire(import.meta.url) fails in the esbuild CJS bundle inside pkg because import.meta.url is undefined there, which broke CI packaging-smoke when running --version.
Made-with: Cursor
* Target Node 24 for standalone binaries and esbuild bundle.
pkg scripts, package.json pkg.targets, pkg.config.json, and release/snap/CI packaging workflows now use node24-* targets; esbuild uses node24. Release and snap jobs use Node 24.x when building binaries.
Made-with: Cursor
* Require Node 24 and drop Node 22 from CI.
CI matrix and npm publish use Node 24.x only; engines and @types/node align with >=24. Documentation and Cursor rules updated accordingly.
Made-with: Cursor
* Use snap base core24 for the ipb snap.
Moves the snap runtime from Ubuntu 22.04 (core22) to Ubuntu 24.04 (core24).
Made-with: Cursor
* refactor: shared spinner lifecycle for pay/simulate/auth flows
- pay: isStdoutPiped-aware title, withSpinner around payMultiple + withRetry
- simulate: addApiCredentialOptions, SimulateCommandOptions, withSpinner for cloud execute
- register/login/bank: addSpinnerVerboseOptions and withSpinner for HTTP calls
- login: getSafeText for token saved message
- test: integration-safety mocks terminal isStdoutPiped; piped/TTY and spinner cases
- test: pay stubs isStdoutPiped and createSpinner for stable output
Made-with: Cursor
* refactor: run command uses resolveSpinnerState and addSpinnerVerboseOptions
- Respect --spinner/--no-spinner, verbose, and piped stdout for local emulator
- Skip title box when stdout is piped; getSafeText on spinner labels
- Shell completion lists --spinner for run/r
Made-with: Cursor
* refactor: ai and new commands use shared spinner lifecycle
- ai: resolveSpinnerState, withSpinner around generateCode and file writes
- ai: skip title when piped; static utils imports; getSafeText on success lines
- new: addSpinnerVerboseOptions, withSpinner for rm+cp when forcing overwrite
- index: wrap ai/new with addSpinnerVerboseOptions; completion adds --spinner
- test: new stubs isStdoutPiped, createSpinner, withSpinner
Made-with: Cursor
* refactor: config and docs use shared spinner lifecycle
- config: runWithConfigSpinner for deleteProfile, writeProfile, writeCredentialsFile
- docs: addSpinnerVerboseOptions, piped-aware title, withSpinner for gen+write
- docsCommand accepts DocsCommandOptions (verbose, spinner)
- test: config/docs utils mocks for isStdoutPiped, createSpinner, withSpinner
Made-with: Cursor
* fix(completion): include docs command in bash/zsh generators
- Add docs to completion command list (was missing)
- Add docs-specific --output hint (globals still append shared flags)
Made-with: Cursor
* feat(completion): bash tab completion for config profile subcommands
- After config|cfg, complete profile, edit, and credential/global flags
- After "config profile", complete list, ls, set, show, delete, rm
- Zsh script unchanged (still offers config flags only)
Made-with: Cursor
* feat(cli): offline tapes, update-skip env, and Phase A tests
- Add IPB_MOCK_APIS so mock PB/Card APIs work without DEBUG verbose output
- Add IPB_NO_UPDATE_CHECK to skip npm version checks (tapes and offline runs)
- Wire npm run tapes to fixture creds, strict shell, mock APIs, no update fetch
- Document env vars in env list; export isMockApisEnabled and isUpdateCheckDisabled
Tests: credentials file ESM-style default unwrap; update banner gated for
piped/json/yaml/--output; stderr-only showUpdateNotification; mock/spinner cases.
Refresh VHS-generated assets under assets/ for the new tape environment.
Made-with: Cursor
* feat(cli): disable AI/auth commands; unify config profile helpers
- Hide ai, bank, register, login; they throw E4018 (COMMAND_DISABLED) for scripts
- Add config-subcommands module for profile list/set/show/delete and config edit
- Wire ipb config profile * and config edit to shared helpers; set.ts uses same paths
- Drop generateCommand/bankCommand from cmds barrel export; update completion and help
- Document OPENAI_API_KEY/SANDBOX_KEY as reserved while AI/login are disabled
Tests: config-subcommands suite; extend config tests; add logs/published tests;
remove register command tests. Regenerate GENERATED_README.md.
Made-with: Cursor
* docs: align README and generated docs with disabled AI/auth commands
- README: replace AI/Bank how-tos with disabled-command note; fix TOC; refresh testing/env sections
- Remove stale TEST_SUGGESTIONS.md; add IMPROVEMENT_PLAN maintenance note
- Skip hidden commands in docs generator (isCommandHidden); test coverage
- Regenerate GENERATED_README.md via filtered command list
Made-with: Cursor
* docs: replace improvement plan with current status summary
Archive original phases as completed; add summary table, definition-of-done
notes, and optional follow-ups instead of an outdated task backlog.
Made-with: Cursor
* revert(tapes): restore DEBUG-only script; drop fixtures; refresh assets
- scripts/tapes.sh: export DEBUG=true again (no fixtures, IPB_MOCK_APIS, or strict bash)
- Remove tapes/fixtures credentials; adjust IPB_MOCK_APIS env-list wording
- Update VHS-generated GIFs under assets/ after re-recording with system ipb
Made-with: Cursor
* chore(scripts): remove empty placeholder scripts
Drop unused zero-byte advanced-fix-tests, fix-spinner-mock, fix-tests,
test-accounts, and verify-process-emitter files.
Made-with: Cursor
* docs(readme): remove AI, register/login, and sandbox key references
Made-with: Cursor1 parent 53132d3 commit 6bef7b0
153 files changed
Lines changed: 17853 additions & 2796 deletions
File tree
- .cursor/rules
- .github
- workflows
- .husky
- Formula
- assets
- scripts
- snap
- src
- cmds
- utils
- templates
- default
- petro
- test
- __mocks__
- cmds
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
0 commit comments