diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9b1c8b1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +/dist diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..7b84619 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": [ + "oclif", + "oclif-typescript" + ] +} diff --git a/.gitignore b/.gitignore index 1681760..b384b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,9 @@ /.nyc_output /dist /lib +/package-lock.json /tmp -/yarn.lock node_modules +oclif.manifest.json .env diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..4a09d14 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,12 @@ +{ + "require": [ + "test/helpers/init.js", + "ts-node/register" + ], + "watch-extensions": [ + "ts" + ], + "recursive": true, + "reporter": "spec", + "timeout": 60000 +} diff --git a/README.md b/README.md index b083f77..b256c28 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ $ npm install -g @hackmd/hackmd-cli $ hackmd-cli COMMAND running command... -$ hackmd-cli (-v|--version|version) -@hackmd/hackmd-cli/2.1.0 darwin-arm64 node-v17.9.1 +$ hackmd-cli (--version|-v) +@hackmd/hackmd-cli/2.2.0 darwin-arm64 node-v18.14.2 $ hackmd-cli --help [COMMAND] USAGE $ hackmd-cli COMMAND @@ -98,18 +98,18 @@ All available configurations are listed in the table below. * [`hackmd-cli export`](#hackmd-cli-export) -* [`hackmd-cli help [COMMAND]`](#hackmd-cli-help-command) +* [`hackmd-cli help [COMMANDS]`](#hackmd-cli-help-commands) * [`hackmd-cli history`](#hackmd-cli-history) * [`hackmd-cli login`](#hackmd-cli-login) * [`hackmd-cli logout`](#hackmd-cli-logout) * [`hackmd-cli notes`](#hackmd-cli-notes) -* [`hackmd-cli notes:create`](#hackmd-cli-notescreate) -* [`hackmd-cli notes:delete`](#hackmd-cli-notesdelete) -* [`hackmd-cli notes:update`](#hackmd-cli-notesupdate) +* [`hackmd-cli notes create`](#hackmd-cli-notes-create) +* [`hackmd-cli notes delete`](#hackmd-cli-notes-delete) +* [`hackmd-cli notes update`](#hackmd-cli-notes-update) * [`hackmd-cli team-notes`](#hackmd-cli-team-notes) -* [`hackmd-cli team-notes:create`](#hackmd-cli-team-notescreate) -* [`hackmd-cli team-notes:delete`](#hackmd-cli-team-notesdelete) -* [`hackmd-cli team-notes:update`](#hackmd-cli-team-notesupdate) +* [`hackmd-cli team-notes create`](#hackmd-cli-team-notes-create) +* [`hackmd-cli team-notes delete`](#hackmd-cli-team-notes-delete) +* [`hackmd-cli team-notes update`](#hackmd-cli-team-notes-update) * [`hackmd-cli teams`](#hackmd-cli-teams) * [`hackmd-cli version`](#hackmd-cli-version) * [`hackmd-cli whoami`](#hackmd-cli-whoami) @@ -120,35 +120,41 @@ Export note content ``` USAGE - $ hackmd-cli export + $ hackmd-cli export [-h] [--noteId ] -OPTIONS - -h, --help Show CLI help. - --noteId=noteId HackMD note id +FLAGS + -h, --help Show CLI help. + --noteId= HackMD note id -EXAMPLE +DESCRIPTION + Export note content + +EXAMPLES $ hackmd-cli export --noteId=kNFWV5E-Qz-QP7u6XnNvyQ # A note to be exported ``` -_See code: [src/commands/export.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.1.0/src/commands/export.ts)_ +_See code: [src/commands/export.ts](https://github.com/hackmdio/hackmd-cli/blob/v2.2.0/src/commands/export.ts)_ -## `hackmd-cli help [COMMAND]` +## `hackmd-cli help [COMMANDS]` -display help for hackmd-cli +Display help for hackmd-cli. ``` USAGE - $ hackmd-cli help [COMMAND] + $ hackmd-cli help [COMMANDS] [-n] ARGUMENTS - COMMAND command to show help for + COMMANDS Command to show help for. -OPTIONS - --all see all commands in CLI +FLAGS + -n, --nested-commands Include all nested commands in the output. + +DESCRIPTION + Display help for hackmd-cli. ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3/src/commands/help.ts)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_ ## `hackmd-cli history` @@ -156,20 +162,25 @@ List user browse history ``` USAGE - $ hackmd-cli history + $ hackmd-cli history [-h] [--columns | -x] [--sort ] [--filter ] [--output + csv|json|yaml | | [--csv | --no-truncate]] [--no-header | ] -OPTIONS - -h, --help Show CLI help. - -x, --extended show extra columns - --columns=columns only show provided columns (comma-separated) - --csv output is csv format [alias: --output=csv] - --filter=filter filter property by partial string matching, ex: name=foo - --no-header hide table header from output - --no-truncate do not truncate output to fit screen - --output=csv|json|yaml output in a more machine friendly format - --sort=sort property to sort by (prepend '-' for descending) - -EXAMPLE +FLAGS + -h, --help Show CLI help. + -x, --extended show extra columns + --columns= only show provided columns (comma-separated) + --csv output is csv format [alias: --output=csv] + --filter= filter property by partial string matching, ex: name=foo + --no-header hide table header from output + --no-truncate do not truncate output to fit screen + --output=