deno-cliffy

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...

MIT License

Stars
870
Committers
38

Bot releases are hidden (Show)

deno-cliffy -

Published by c4spar over 2 years ago

Features

  • command: add support to show additional information in help text (#300) (e32f826)
  • command: add support for enum's in EnumType (#316) (d71071e)
  • prompt: add support for path completion and dynamic suggestions (#306) (0be6da7)

Bug Fixes

  • command: only first missing required variadic option throws an error (#331) (cf487de)
  • command: integer argument with value 0 is ignored (#329) (11b824c)
  • prompt: checkbox and select prompt fails with only one disabled option (#328) (683f260)
  • table: chinese characters are not aligned correctly (#330) (e31b680)

Performance Improvements

  • table: improve performance for tables without col and row span (#327) (29bcfd6)

Code Refactoring

  • command: change return type of action handler to unknown (#315) (04e6917)

Chore

  • add funding (ebafd0e)
  • ci: use denoland/setup-deno in lint workflow (#332) (63b47d0)
  • command: add script to update all test fixtures (#301) (89cc617)
  • fmt: fmt readme (#305) (8c63fd8)
  • fmt: fmt changelog (6d51275)
  • upgrade: deno/std0.130.0 (#333) (336f0a1)

Documentation Updates

  • prompt: add info for required --unstable flag (beca790)
deno-cliffy -

Published by c4spar almost 3 years ago

Code Refactoring

  • command: preparation for the new typescript option --useUnknownInCatchVariables (#294) (864e915)

Chore

  • upgrade: deno/std v0.113.0 (#295) (8d1664a)
deno-cliffy -

Published by c4spar almost 3 years ago

Features

  • command: add value option for env vars (#290) (e5b2b2b)

Bug Fixes

  • command: help text shows always long description for env vars (#289) (6201e28)
  • command: fix description column definition in help text (#286) (bf727fb)
  • command: highlight command usage in help text (#288) (7181724)

Chore

  • upgrade: deno/std v0.112.0 (#291) (750d70d)

BREAKING CHANGES

  • command: execute command action after option action is called (#285) (9170a65)

    Prior to v0.20.0, when an option action was executed, the command action was not executed. Since v0.20.0, this has changed. The command action is now executed by default. Only standalone options do not execute the command actions (for more informations see the docs).

deno-cliffy -

Published by c4spar about 3 years ago

Features

  • command: add noExit method (#282, #275) (bc0c5bb, ab38cc7)
  • command: show long help with --help option (#281) (e577f5a)
  • command: add usage method (#280) (a32755d)

Bug Fixes

  • prompt: key symbols in prompt info are hardcoded (#274) (a6138b2)

Documentation Updates

  • fix typos (#279) (d802a15)
  • command: fix incorrectly import module (#276) (6674ea3)
  • command: fix import path (#271) (57e7434)
deno-cliffy -

Published by c4spar about 3 years ago

Features

  • command: support import map in upgrade command (#265) (b400131)
  • command: add support for required env vars (#261) (ee69526)
  • command: make parsed environment variables available via command options (#263) (102161e)
  • command: add prefix to environment variable options (#268) (44c80c8)
await new Command<void>()
  .env<{ outputFile?: string }>(
    "CC_OUTPUT_FILE=<value:string>",
    "The output file.",
    { prefix: "CC_" },
  )
  .option<{ outputFile?: string }>(
    "--output-file <value:string>",
    "The output file.",
  )
  .action((options) => console.log(options.outputFile))
  .parse();
$ CC_OUTPUT_FILE=foo.txt deno run example.ts
foo.txt
$ CC_OUTPUT_FILE=foo.txt deno run example.ts --output-file bar.txt
bar.txt

Bug Fixes

  • command: output of --version should end with a new line (#256) (8107875)

Code Refactoring

  • command: refactor executable sub-commands (#259) (a13c79f)
  • command: remove extra new line from getHelp() and completion generator methods (#257) (99ccc2a)
  • table: use console.log to render output (#258) (4f05fad)

Chore

  • ci: update release workflow (65ba62a, 1c6dc9d)
  • ci: add codecov config (#267) (c54627a)
  • codecov: upgrade to codecov/codecov-action@v2 (#266) (18c023c)
  • upgrade: deno/std v0.104.0 (#270) (15af5bf)

Documentation Updates

  • update readme's (#269) (83644f9)
  • command: update docs for environment variables (f4cee28, 9d025fc)
  • command: fix incorrectly import module in example (#262) (3e62ad6)
  • command: update docs for executable sub commands (0b2f3d1)
deno-cliffy -

Published by c4spar about 3 years ago

Bug Fixes

  • command,flags: equals sign not supported in option value (#253) (b074cb3)
  • command,flags: values starting with '-' not supported (#251) (ab598bf)
  • command,flags: required option value with default value is not required (#249) (0d3f8fa)
  • flags: allow collecting options by default if no flags are set (#252) (24e3f46)

Chore

  • ci: add --jobs flag to speed up deno test's (#250) (ce794cf)
  • upgrade: deno/std v0.103.0 (#254) (ad65b8e)
deno-cliffy -

Published by c4spar over 3 years ago

Features

  • prompt: add prefix option (#233) (a4943cb)

Bug Fixes

  • command: external commands not working on windows (#224) (84ac5be)
  • command: remove v prefix from version in generated help text (#231) (f882abd)
  • command,flags: don't normalize arguments if stopEarly is enabled (#246) (2ea4938)
  • prompt: use exit code 130 for ctrl+c (#242) (2c014d7)

Code Refactoring

  • command: export github upgrade provider in upgrade/mod.ts (#232) (39a8075)
  • prompt: replace deprecated Deno.copy with copy method from std/io (#243) (f95b317)

Chore

  • ci: use denoland/setup-deno action (#219) (d93ad7d)
  • ci: use latest deno version in release action (36c1c07)
  • ci: upgrade eggs to v0.3.8 (1efd809)
  • egg: add keypress module to egg.yaml (fee6ed4)
  • upgrade: deno/std v0.101.0 (#244) (534094b)

Documentation Updates

  • ansi: fix functional example command (#235) (f3103b9)
  • command: fix type of args in stopEarly example (#240) (b909bc6)
deno-cliffy -

Published by c4spar over 3 years ago

Features

  • command: add colors option to help options (#213) (eed2e90)
  • table: add align option (#212) (9e10c9e)

Bug Fixes

  • prompt: unicode characters are not displayed properly on windows (#216) (fb6a22e)

Code Refactoring

  • flags: show better error message if an option occurs to many times (#215) (8b0dfcb)

Documentation Updates

  • docs: add keypress module to cliffy.io (15fe4e0)

Chore

  • update .gitignore (8053930)
  • ci: remove deno 1.4.0 tests (#218) (f0e2ba8)
  • upgrade: deno/std v0.99.0 (#217) (578cbda)
  • upgrade: upgrade dev deps (#210) (d10f20d)
deno-cliffy -

Published by c4spar over 3 years ago

Bug Fixes

Documentation Updates

  • changelog: fix commit links (8d8601f)
deno-cliffy -

Published by c4spar over 3 years ago

BREAKING CHANGES

  • keycode: refactor keycode module (#186) (4ac2719)

    Before:

    const key: KeyEvent = KeyCode.parse(
      "\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H",
    );
    

    After:

    const key: KeyCode = parse("\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H");
    

Features

  • command: add exitCode option to ValidationError (#201) (d4c0f12)

    throw new ValidationError("Some validation error", { exitCode: 2 });
    
  • command: add enum type (#197) (36289a2)

    cmd.type("log-level", new EnumType(["debug", "info", 0, 1]))
      .option("-L, --log-level <level:log-level>");
    
  • command: improve support for generic custom types (#191) (59b1a93)

    const color = new EnumType(["red", "blue", "yellow"]);
    cmd.type("color", color)
      // you can pass the type
      .option<{ color: typeof color }>("-c, --color <name:color>");
    
  • command: add upgrade command (#203) (348f743)

    // single registry with default options
    cmd.command(
      "upgrade",
      new UpgradeCommand({
        provider: new DenoLandProvider(),
      }),
    );
    
    // multi registry with custom options
    cmd.command(
      "upgrade",
      new UpgradeCommand({
        main: "cli.ts",
        args: ["--allow-net", "--unstable"],
        provider: [
          new DenoLandProvider({ name: "cliffy" }),
          new NestLandProvider({ name: "cliffy" }),
          new GithubProvider({ repository: "c4spar/deno-cliffy" }),
        ],
      }),
    );
    
  • command: add values method to types to show possible values in help text (#202) (143eb1b, 045c56e)

  • command: allow numbers for completions (#195) (f30b3af)

  • command,flags: add integer type (#190) (2cc7e57)

    cmd.option("-a, --amount <amount:integer>");
    
  • keycode: add code property to parse result (#182) (366683f)

  • keypress: add keypress module (#187) (5acf5db)

    // promise
    const event: KeyPressEvent = await keypress();
    
    // events
    keypress().addEventListener((event: KeyPressEvent) => {
      console.log("event:", event);
      if (event.ctrlKey && event.key === "c") {
        keypress().dispose();
      }
    });
    
    // async iterator
    for await (const event: KeyPressEvent of keypress()) {
      console.log("event:", event);
      if (event.ctrlKey && event.key === "c") {
        break;
      }
    }
    
  • prompt: add id option to automatically save suggestions to local storage (#204) (28f25bd)

    await Input.prompt({
      message: "Enter your name",
      id: "<local-storage-key>",
    });
    

Bug Fixes

  • command,flags: value handler not called for default value if option is not defined on commandline (ef3df5e)
  • keycode: fix esc key and sequence property for escaped keys (b9eb39b)
  • table: fix getBody and hasHeaderBorder methods (2d65cc8)

Code Refactoring

  • command: add CompleteHandlerResult type (#200) (ade3c3d)
  • command: remove unnecessary dependency (#199) (b26f07c)
  • flags: refactor number type (#196) (9b57f54)
  • flags: refactor error message for boolean and number types (#189) (2a19c34)
  • keycode: refactor special key handling (7aaaec4)
  • prompt: enable raw mode only if stdin is a tty (#183) (83c644a)

Chore

Unit/Integration Tests

  • flags: fix value tests (5ec86e8)
  • prompt: add integration tests (#172) (0031490)
  • table: add more tests (3dd6315)

Documentation Updates

  • command,flags: add integer type to readme (6aec3db)
  • command: fix typo (a965ea3)
  • command: describe getHelp and showHelp (0e674c8)
  • command: documentation fixes (6442ae7)
deno-cliffy -

Published by c4spar over 3 years ago

Features

Bug Fixes

  • ansi: make getCursorPosition options optional (#164) (2e7c35d)
  • command: fix typo in completions command help (#175) (c9f110a)
  • command: fix shell completion of default types (#168) (e976378)
  • command: command alias not working (#167) (45fc678)

Chore

  • fix lint errors (#176) (ebccd05)
  • ci: add release workflow (#173) (d7f24dc)
  • ci: fix nightly tests (#171) (6e55b57)
  • upgrade: deno/std v0.93.0 (#177) (d758012)

Unit/Integration Tests

  • ansi: add more tests (#163) (e91d651)
  • command: add integration tests (#169) (37b07e9)
  • command: add more tests (#166) (298d5e0)

Documentation Updates

deno-cliffy -

Published by c4spar over 3 years ago

v0.18.1 (2021-03-15)

Bug Fixes

  • prompt: adopt prompts to work with enabled ts option useDefineForClassFields (#162) (ac6ce0e)

Chore

  • ci: generate coverage (#160) (63b1a73)
  • egg: add _utils to files list (c2e60f9)

Documentation Updates

deno-cliffy -

Published by c4spar over 3 years ago

Features

  • command: add improved support for generic types (#151, #157, #159) (f43a7f1, e143799, 406afc2)
  • command: add globalOption, globalType, globalComplete and globalEnv alias
    method's (#152) (e1a6bb2)
  • prompt: improve search and auto suggestions (#153) (6597205)

Bug Fixes

  • command: help callback does not work with global options and commands (#149) (0972cc0)

Chore

  • egg: ignore .DS_Store files (84fba89)
  • upgrade: deno/std v0.89.0 (#158) (3ecd38e)

Documentation Updates

deno-cliffy -

Published by c4spar over 3 years ago

Features

  • flags: add option callback method (#147) (246035c)

Bug Fixes

  • command: option action not executed for options with no value (#148) (c436221)
deno-cliffy -

Published by c4spar over 3 years ago

Bug Fixes

  • command: actions on hyphenated options won't run (#144) (1ee0366)
  • prompt: clear stdout on ctrl+c (#142) (1e15d38, a6b5d36)
  • prompt: disabled item gets selected when it's the first option (#137) (f5c9be5)

Code Refactoring

  • use object spread instead of Object.assign (22681f0)
  • command,flags: make options.flags an array (eeac740)

Chore

  • upgrade: deno/std v0.86.0 (#146) (ce54da4)

Documentation Updates

  • fix sidebar width (98dfe3b)
  • fmt reamde's and add discord budget (#140) (821f13d)
deno-cliffy -

Published by c4spar almost 4 years ago

Features

  • ansi: add a chainable (chalk like) ansi colors module (#128) (f2d8c93)
  • command: make generated help customizable (#134) (0cfceb7)
  • command,flags: add did-you-mean support for improved error messages (#131) (afd8697)
  • prompt: add cbreak option to support custom signal handling (#106) (a637b54)
  • prompt: add auto suggestion support to Input, Number, Confirm and List prompt's (7dd6660, a67dc53)
  • prompt: add search option to Select and Checkbox prompt (7d09739, a67dc53)
  • prompt: add info option to all prompts with a select or suggestions list (c7bfce6)
  • prompt: add pageup and pagedown keys to all prompts with a select or suggestions list (44575e3)

Code Refactoring

  • flags, command: improve error handling and unify error messages (#133) (8c7789b)
  • command: refactor hints formatting in help output (#130) (ed588e2)
  • prompt: refactor indent option (ad7923f)
  • prompt: refactor internal keypress event handling (37fcbaf)

Documentation Updates

BREAKING CHANGES

  • ansi: re-write ansi_escape module and rename to ansi (#124) (41a39d0)
  • command: rename help method to showHelp (0cfceb7)
deno-cliffy -

Published by c4spar almost 4 years ago

Features

  • table: add static Table.chars() method to set global default table characters (#107) (fec09df)

Bug Fixes

  • keycode: f1-f4 + shift returns undefined key name (#111) (112c0b5)
  • prompt: fix default value of select prompt (#123) (3a97617)
  • prompt: wrong cursor position on windows (#114) (0e14b51)
  • prompt: remove async modifer from abstract method declartion that breaks cliffy on deno 1.6 (#122) (63351d0)

Code Refactoring

Chore

deno-cliffy -

Published by c4spar almost 4 years ago

Features

  • flags,command: add support for dotted options (#104) (9cd1191)
  • flags,command: improve support for negatable options (#103) (220dcea)
deno-cliffy -

Published by c4spar about 4 years ago

Bug Fixes

  • command: optional arguments are validated even if they are not specified on the command line (#101) (e3d61d7)
  • command: zsh completion values not separated by new line (#98) (a89ccc6)
  • flags,command: single dash not supported in arguments (#100) (5b30372)
deno-cliffy -

Published by c4spar about 4 years ago

Features

Bug Fixes

  • command: spaces not supported in bash completions (#94) (95b29b2)
  • command: spaces not supported in zsh completions (#93) (e9805b6)
  • command: prompt method not exported from prompt/mod.ts (cd0d122)

Code Refactoring

  • use underscore in file names (#92) (357db7f)
  • command: indent zsh completions script with 2 spaces (310bc00)

Chore