Skip to content

Releases: aiperceivable/apcore-cli-typescript

Release 0.4.0

29 Mar 04:21

Choose a tag to compare

Added

  • Verbose help mode — Built-in apcore options (--input, --yes, --large-input, --format, --sandbox) are now hidden from --help output by default. Pass --help --verbose to display the full option list including built-in options.
  • Universal man page generationbuildProgramManPage() generates a complete roff man page covering all registered commands. configureManHelp() adds --help --man support to any Commander program, enabling downstream projects to get man pages for free.
  • Documentation URL supportsetDocsUrl() sets a base URL for online docs. Per-command help shows Docs: {url}/commands/{name}, man page SEE ALSO includes Full documentation at {url}. No default — disabled when not set.

Changed

  • buildModuleCommand() accepts optional verboseHelp parameter to control built-in option visibility in help.
  • --sandbox is 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., --input now reads "Read JSON input from a file path, or use '-' to read from stdin pipe").

Release 0.3.2

28 Mar 14:00

Choose a tag to compare

Fixed

  • Handle missing package.json for version retrieval in bundled environments (e.g., Bun compile).

Release 0.3.1

28 Mar 12:45

Choose a tag to compare

Changed

  • Update tsup.config.ts entry configuration to use named entries ({ index: "src/index.ts", "bin/apcore-cli": "bin/apcore-cli.ts" }) instead of an array.

Release 0.3.0

27 Mar 10:26

Choose a tag to compare

Added

  • Grouped CLI commands (FE-09)GroupedModuleGroup organizes modules into nested subcommand groups by namespace prefix, enabling apcore-cli <group> <command> invocation.
  • Display overlay helpersgetDisplay() and getCliDisplayFields() resolve alias, description, and tags from metadata["display"].
  • Init command (FE-10)apcore-cli init module <id> scaffolds new modules with --style (decorator/convention/binding), --dir, and --description options.
  • Grouped shell completions — Bash, Zsh, and Fish completions now support two-level group/command completion via _APCORE_GRP.
  • Optional apcore-toolkit integrationDisplayResolver and RegistryWriter via optional apcore-toolkit peer dependency with graceful fallback.
  • Path traversal validation--dir rejects paths containing .. components.

Changed

  • BUILTIN_COMMANDS updated to include init (6 items, sorted).
  • buildModuleCommand accepts optional cmdName parameter for display alias override.
  • APCORE_EXTENSIONS_ROOT environment variable now used as fallback in createCli().
  • APCORE_AUTH_API_KEY added to man page ENVIRONMENT section.
  • Dependency bump: apcore-js >= 0.14.0.

Release 0.2.1

19 Mar 09:29

Choose a tag to compare

Changed

  • Help text truncation limit increased from 200 to 1000 characters (configurable via cli.help_text_max_length config key)
  • extractHelp: added maxLength parameter (default 1000) (schema-parser.ts)
  • schemaToCliOptions: added maxHelpLength parameter (default 1000) (schema-parser.ts)
  • buildModuleCommand: added helpTextMaxLength parameter (default 1000), threaded through to schema parser (main.ts)
  • LazyModuleGroup: constructor accepts helpTextMaxLength (default 1000), passes to buildModuleCommand (cli.ts)

Added

  • cli.help_text_max_length config key (default: 1000) in DEFAULTS (config.ts)
  • APCORE_CLI_HELP_TEXT_MAX_LENGTH environment 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

18 Mar 00:15

Choose a tag to compare

Added

  • Core dispatch pipeline: buildModuleCommand now 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.getCommand now calls buildModuleCommand instead of creating bare Commander commands
  • createCli wired with program name resolution from argv, --extensions-dir and --log-level global options, and log level resolution from APCORE_CLI_LOGGING_LEVEL / APCORE_LOGGING_LEVEL env vars
  • Commander .exitOverride() — custom exit code mapping via exitCodeForError is now active (previously dead code because Commander calls process.exit() internally)
  • src/logger.ts — structured logger utility with setLogLevel, getLogLevel, debug, info, warn, error functions respecting logging.level config
  • setAuditLogger / getAuditLogger — module-level audit logger getter/setter (ported from Python SDK)
  • tests/main.test.ts — 14 new tests covering createCli, Commander exitOverride, buildModuleCommand action execution, and SIGINT handling
  • APCORE_CLI_LOGGING_LEVEL env var support — CLI-specific log level that takes priority over APCORE_LOGGING_LEVEL; 3-tier precedence: --log-level flag > APCORE_CLI_LOGGING_LEVEL > APCORE_LOGGING_LEVEL > WARNING
  • 181 tests total (up from 167)

Changed

  • schemaToCommanderOptions renamed to schemaToCliOptions — framework-agnostic name matching spec canonical form
  • AuditLogger constructor parameter renamed from logPath to path — matches spec and Python SDK
  • ConfigResolver.DEFAULTS keys normalized to snake_case: cli.stdinBufferLimitcli.stdin_buffer_limit, cli.autoApprovecli.auto_approve — matches spec and Python SDK
  • ConfigResolver.DEFAULTS logging.level default changed from "INFO" to "WARNING" — matches updated spec
  • ConfigEncryptor.store / ConfigEncryptor.retrieve now async — required by keytar dynamic import change
  • AuthProvider.getApiKey / AuthProvider.authenticateRequest now async — propagated from ConfigEncryptor async change
  • Version string read from package.json at runtime instead of hardcoded in 3 places
  • readStdin() properly removes event listeners on completion/error — prevents listener accumulation
  • Removed duplicate resolveFormat re-export from main.ts (index.ts already exports from output.ts)

Fixed

  • Commander exit code mapping was dead code: program.parse() calls process.exit() internally; added .exitOverride() so errors throw CommanderError and the catch block in main() can apply exitCodeForError mapping
  • LazyModuleGroup.getCommand bypassed buildModuleCommand: was creating bare new Command(cmdName) instead of building a fully wired command with schema options and execution callback
  • require('keytar') in ESM module: replaced with dynamic await import('keytar') via cached helper; keytar is an optional peer dependency (archived/deprecated)
  • README --stdin json flag: corrected to --input -
  • README missing Features and API Overview sections: added comprehensive sections

Security

  • AuditLogger._hashInput: uses crypto.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)