feat: init full-featured Logseq CLI by RCmerci · Pull Request #12340 · logseq/logseq

@tiensonqin @logseq-cldwalker

@tiensonqin @logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

@RCmerci @logseq-cldwalker

--output was being used as a global and command option. This resulted in
buggy, coupled behavior e.g. unable to set a global output unless the
export file was named human, edn or json. `--ouput` was also
not listed as a command option which was confusing. Renamed the command
--ouput to --file for explicit and uncoupled behavior

@logseq-cldwalker

Repo refers to internal identifiers that start with 'logseq_db_' and
used to start with 'logseq_local_'. The --repo option was not being
used in that way and was just a reference to a graph name. While it's
reasonable for internal CLIs like db-worker-node.js to use --repo, it is
needlessly confusing to introduce repo to users. Almost all of our apps and docs
label graphs as 'graph' and not 'repo'

@logseq-cldwalker

@logseq-cldwalker

@logseq-cldwalker

Also mark more ^:long tests so most unit tests can still
be run locally in ~30s

@logseq-cldwalker

So much noise makes it hard to see actual failure in test suite

@logseq-cldwalker

Be more helpful when no args given like cp, zip and npm.
Also fix frontend lint
Both in sidebar but also in commands to select graphs
like 'Select graph to open'
Invalid graphs were pretending to be valid. Instead
validation errors should be displayed and command should
exit 1. This also fixes other commands that were exiting 0
even though they returned an :error