Releases: aiperceivable/apcore-cli-typescript
Releases · aiperceivable/apcore-cli-typescript
Release 0.4.0
Added
- Verbose help mode — Built-in apcore options (
--input,--yes,--large-input,--format,--sandbox) are now hidden from--helpoutput by default. Pass--help --verboseto display the full option list including built-in options. - Universal man page generation —
buildProgramManPage()generates a complete roff man page covering all registered commands.configureManHelp()adds--help --mansupport to any Commander program, enabling downstream projects to get man pages for free. - Documentation URL support —
setDocsUrl()sets a base URL for online docs. Per-command help showsDocs: {url}/commands/{name}, man page SEE ALSO includesFull documentation at {url}. No default — disabled when not set.
Changed
buildModuleCommand()accepts optionalverboseHelpparameter to control built-in option visibility in help.--sandboxis now always hidden from help (not yet implemented). Only four built-in options (--input,--yes,--large-input,--format) toggle with--verbose.- Improved built-in option descriptions for clarity (e.g.,
--inputnow reads "Read JSON input from a file path, or use '-' to read from stdin pipe").
Release 0.3.2
Fixed
- Handle missing
package.jsonfor version retrieval in bundled environments (e.g., Bun compile).
Release 0.3.1
Changed
- Update
tsup.config.tsentry configuration to use named entries ({ index: "src/index.ts", "bin/apcore-cli": "bin/apcore-cli.ts" }) instead of an array.
Release 0.3.0
Added
- Grouped CLI commands (FE-09) —
GroupedModuleGrouporganizes modules into nested subcommand groups by namespace prefix, enablingapcore-cli <group> <command>invocation. - Display overlay helpers —
getDisplay()andgetCliDisplayFields()resolve alias, description, and tags frommetadata["display"]. - Init command (FE-10) —
apcore-cli init module <id>scaffolds new modules with--style(decorator/convention/binding),--dir, and--descriptionoptions. - Grouped shell completions — Bash, Zsh, and Fish completions now support two-level group/command completion via
_APCORE_GRP. - Optional apcore-toolkit integration —
DisplayResolverandRegistryWritervia optionalapcore-toolkitpeer dependency with graceful fallback. - Path traversal validation —
--dirrejects paths containing..components.
Changed
BUILTIN_COMMANDSupdated to includeinit(6 items, sorted).buildModuleCommandaccepts optionalcmdNameparameter for display alias override.APCORE_EXTENSIONS_ROOTenvironment variable now used as fallback increateCli().APCORE_AUTH_API_KEYadded to man page ENVIRONMENT section.- Dependency bump:
apcore-js >= 0.14.0.
Release 0.2.1
Changed
- Help text truncation limit increased from 200 to 1000 characters (configurable via
cli.help_text_max_lengthconfig key) extractHelp: addedmaxLengthparameter (default 1000) (schema-parser.ts)schemaToCliOptions: addedmaxHelpLengthparameter (default 1000) (schema-parser.ts)buildModuleCommand: addedhelpTextMaxLengthparameter (default 1000), threaded through to schema parser (main.ts)LazyModuleGroup: constructor acceptshelpTextMaxLength(default 1000), passes tobuildModuleCommand(cli.ts)
Added
cli.help_text_max_lengthconfig key (default: 1000) inDEFAULTS(config.ts)APCORE_CLI_HELP_TEXT_MAX_LENGTHenvironment variable support- Test: "truncates help text at 1000 chars (default)"
- Test: "does not truncate text within default limit"
- Test: "truncates at custom maxLength"
- 183 tests (up from 181)
Release 0.2.0
Added
- Core dispatch pipeline:
buildModuleCommandnow fully wires schema resolution, built-in options (--input,--yes,--large-input,--format,--sandbox), input collection, approval gate, sandbox execution, audit logging, and output formatting LazyModuleGroup.getCommandnow callsbuildModuleCommandinstead of creating bare Commander commandscreateCliwired with program name resolution fromargv,--extensions-dirand--log-levelglobal options, and log level resolution fromAPCORE_CLI_LOGGING_LEVEL/APCORE_LOGGING_LEVELenv vars- Commander
.exitOverride()— custom exit code mapping viaexitCodeForErroris now active (previously dead code because Commander callsprocess.exit()internally) src/logger.ts— structured logger utility withsetLogLevel,getLogLevel,debug,info,warn,errorfunctions respectinglogging.levelconfigsetAuditLogger/getAuditLogger— module-level audit logger getter/setter (ported from Python SDK)tests/main.test.ts— 14 new tests coveringcreateCli, Commander exitOverride,buildModuleCommandaction execution, and SIGINT handlingAPCORE_CLI_LOGGING_LEVELenv var support — CLI-specific log level that takes priority overAPCORE_LOGGING_LEVEL; 3-tier precedence:--log-levelflag >APCORE_CLI_LOGGING_LEVEL>APCORE_LOGGING_LEVEL>WARNING- 181 tests total (up from 167)
Changed
schemaToCommanderOptionsrenamed toschemaToCliOptions— framework-agnostic name matching spec canonical formAuditLoggerconstructor parameter renamed fromlogPathtopath— matches spec and Python SDKConfigResolver.DEFAULTSkeys normalized to snake_case:cli.stdinBufferLimit→cli.stdin_buffer_limit,cli.autoApprove→cli.auto_approve— matches spec and Python SDKConfigResolver.DEFAULTSlogging.leveldefault changed from"INFO"to"WARNING"— matches updated specConfigEncryptor.store/ConfigEncryptor.retrievenow async — required by keytar dynamic import changeAuthProvider.getApiKey/AuthProvider.authenticateRequestnow async — propagated from ConfigEncryptor async change- Version string read from
package.jsonat runtime instead of hardcoded in 3 places readStdin()properly removes event listeners on completion/error — prevents listener accumulation- Removed duplicate
resolveFormatre-export frommain.ts(index.ts already exports from output.ts)
Fixed
- Commander exit code mapping was dead code:
program.parse()callsprocess.exit()internally; added.exitOverride()so errors throwCommanderErrorand the catch block inmain()can applyexitCodeForErrormapping LazyModuleGroup.getCommandbypassedbuildModuleCommand: was creating barenew Command(cmdName)instead of building a fully wired command with schema options and execution callbackrequire('keytar')in ESM module: replaced with dynamicawait import('keytar')via cached helper; keytar is an optional peer dependency (archived/deprecated)- README
--stdin jsonflag: corrected to--input - - README missing Features and API Overview sections: added comprehensive sections
Security
AuditLogger._hashInput: usescrypto.randomBytes(16)per-invocation salt before SHA-256 hashing, preventing cross-invocation input correlation- Added security comment on AES key derivation fallback (best-effort when OS keyring unavailable — key derived from hostname + username)