Commit Graph

23494 Commits

Author SHA1 Message Date
rcmerci
23daff7dbd enhance(cli): add example subcmd 2026-03-27 23:17:02 +08:00
rcmerci
88d5873176 fix(cli): propagate server error codes and handle invalid query as 400 2026-03-27 20:54:14 +08:00
Gabriel Horner
29a7a77a6b fix: upsert page property options can't handle user properties
Fails with 'unknown built-in' error instead of just handling it.
Also fix an incorrect test teardown from previous commit
2026-03-26 17:33:19 -04:00
Gabriel Horner
8732d947fb fix: cleanly print unexpected errors for option handling
from commands/build-action. For example, if --blocks-file has a
nonexistent file or if --blocks or --blocks-file are invalid EDN we
would print full stacktraces which is confusing for user-facing errors.
Update error handling so that it matches
how other unexpected option failures are handled e.g. `logseq graph
import -t edn -g cli-test2 --input=blah`
2026-03-26 11:08:20 -04:00
Gabriel Horner
301ea87943 fix: read file cli options don't recognize '~'
These paths autocomplete fine and should be usable
2026-03-26 10:33:10 -04:00
rcmerci
59d0e5777b enhance(cli): add search subcmd 2026-03-26 21:57:25 +08:00
rcmerci
a16f0012e9 enhance(cli): add --profile global option 2026-03-26 19:31:17 +08:00
rcmerci
ce2dcfc566 067-logseq-cli-json-namespaced-keys.md 2026-03-26 15:16:14 +08:00
rcmerci
cb68930ec8 066-logseq-cli-list-property-cardinality-column.md 2026-03-26 14:20:03 +08:00
Gabriel Horner
0009e7cc21 enhance(cli): import edn can import into existing graph
This functionality is available in the old cli so making sure it's
available in the new one. Also update messaging so it's clear when a new
graph is created
2026-03-25 17:52:58 -04:00
Gabriel Horner
46ec2187db enhance(dev): unlock-graph option for nbb cli
to allow querying of graph that has been used with new cli
2026-03-25 13:56:53 -04:00
Gabriel Horner
b513b94026 fix: new property and class idents don't have suffix
when created from app or cli. Moving db-worker to node changed the
js/process exist check in db-ident ns. Brought back env var for
straightforward fix. I checked other process checks and this was the
only one affected this way. Also remove double testing for graph-parser as
it hasn't provided any benefit and yet another place where we kept
juggling this env var
2026-03-25 13:54:14 -04:00
Gabriel Horner
105282cb78 fix(cli): silently ignores several validation failures
that only the desktop app sees. Ignoring validation errors than causes
further errors as the cli doesn't see updates and doesn't understand the
validation constraints it faces. For example, updating a block with a
private tag e.g. `logseq upsert block --id=219
--update-tags='["Journal"]'` should fail with an explicit message
instead of pretending to succeed
2026-03-24 15:02:53 -04:00
rcmerci
8c93d3c9da enhance(cli): add --ref-id-footer in show cmd 2026-03-24 21:38:02 +08:00
Gabriel Horner
a7bf7fc6ef fix(cli): show cmd 500s with :datetime properties
Crashed with datascript lookup errors like "Highest supported entity id is
2147483647, got 1774299180000". Also add display support for :datetime
properties
2026-03-24 08:51:50 -04:00
rcmerci
bad48702e8 enhance(cli-e2e): update spec :cmd -> :cmds 2026-03-24 16:40:32 +08:00
Gabriel Horner
4263123e83 fix: nonexistent string :date property value silently passes
and doesn't set anything. Now it errors clearly.
Also improve property validation for --{update/remove}-properties to
include property name
2026-03-23 16:09:38 -04:00
Gabriel Horner
26ac7f5aa5 enhance: improve error handling for create/update only upsert options
so they aren't used incorrectly in the wrong mode. Also update help
so all create/update only options are clearly labeled and remove
unused code for remove options
2026-03-23 14:38:58 -04:00
Gabriel Horner
2a8e500a8c fix: invalid :default property value incorrectly passes
but displays warning in the app. For example --update-properties='{"p1"
4}, pretends to pass but is invalid for a :default p1 property. Also
fixes other :default property values incorrectly being passed e.g.
boolean. Also improve reporting of http-request failures as not
including response body gave user no idea why certain property values like
keywords failed
2026-03-23 11:09:25 -04:00
Gabriel Horner
8961286006 fix: upsert with invalid EDN for tags and properties optiosn gives incorrect
error - "target or update/remove options"
2026-03-23 09:39:14 -04:00
rcmerci
d88ae59990 enhance(cli-e2e): add bb cleanup 2026-03-22 17:49:45 +08:00
rcmerci
1010341f56 enhance(cli-e2e): use 'bash -c' instead of 'bash -lc' 2026-03-22 16:51:30 +08:00
rcmerci
791b3e98f7 fix(cli): found by case block-upsert-update-id-custom-many-property-json 2026-03-22 16:09:53 +08:00
rcmerci
c5995a6652 test(cli-e2e): block-upsert-update-id-custom-many-property-json 2026-03-22 16:00:49 +08:00
rcmerci
31234caef7 update cli-e2e/agents.md 2026-03-21 18:29:46 +08:00
rcmerci
90c81f196d enhance(cli-e2e): add progress reporting and -h/--help to test runner 2026-03-21 17:24:45 +08:00
Gabriel Horner
031c2b705d enhance(dev): Add --verbose to cli E2E
Also add tests to nearest workflow
2026-03-20 16:22:29 -04:00
rcmerci
ca4cb121e3 fix test 2026-03-20 16:54:19 +08:00
rcmerci
2cc0735e3a enhance(cli): migrate non-sync integration coverage to cli-e2e shell suite 2026-03-20 16:34:54 +08:00
Gabriel Horner
721225ba00 fix: upsert --update-tags|remove-tags NON-TAG silently passes
even though no tag is added. Should error instead. Also improve
nonexistent tag error to include name and improve wording
on two upsert options
2026-03-19 19:24:57 -04:00
Gabriel Horner
029194e6f6 fix: undo + redo and possibly more in desktop
Electron app wasn't setting up transact fn like browser does
2026-03-19 15:39:25 -04:00
Gabriel Horner
a7469bcd36 fix: search not starting or working
Per Claude this may have been triggered by adbaf10abc
2026-03-19 14:08:48 -04:00
Gabriel Horner
bb7f3b9dde enhance: sort cli options alphabetically 2026-03-19 13:38:14 -04:00
Gabriel Horner
317d3b583c fix: invalid target-uuid option gives wrong error
about unknown command. Source of bug was that uuid options
are being validated downstream and can throw codes that aren't
recognized later. This is needless complexity so fix by validating
the option at cmdline parse time. Also change this for all
other uuid options to simplify them. Also tweaked cli.main which
swallowed daemon error codes instead of reporting them
2026-03-19 12:17:32 -04:00
rcmerci
23e42c77f6 063-logseq-cli-upsert-block-custom-many-property.md 2026-03-19 16:36:11 +08:00
Gabriel Horner
6490c9d853 fix: cli completion of graphs, pages and queries
Wasn't reading json output correctly, didn't have a correct
_logseq_current_graph and caching was causing verification issues
2026-03-18 23:11:12 -04:00
Gabriel Horner
6d2b75d8f0 enhance: all cli options with allowed values validate
those values. We didn't validate some of them as we were relying on
home-rolled validations when we could be using babashka.cli's built-in
validation. Switch to using :validate SET by default and allow for
optional :values
2026-03-18 14:19:15 -04:00
Gabriel Horner
fec5b82b42 fix: existing mcp updates intermittently failing
The new cli uses :db/id as its primary id while the existing mcp uses
:block/uuid. These changes on list tools cause slow and sometimes breaking interactions
for updates. It also causes buggy/inconsistent mcp behavior b/n mcp cli and server as there
are different implentations being called. The new cli should use its own
thread-api/* fns and replace MCP when it can meet existing functionality - working
updates and provide a CLI interface.
Also fix mcp.tools dissoc bug which had been fixed in the newer list fns
2026-03-18 13:51:17 -04:00
Gabriel Horner
e2ec7660f4 enhance: allow all list fields to be sorted
Removes needing to maintain a separate config
just for sorting and allows for more sorting.
Also remove needless home-rolled validation
when babashka.cli already provides it
2026-03-17 15:08:55 -04:00
Gabriel Horner
e6e8a945e8 fix: cli completion of aliases
babashka.cli doesn't support -o=val completion for alias options e.g.
'-f=created-at'. Instead they now correctly complete '-f created-at'
2026-03-17 13:40:16 -04:00
Gabriel Horner
d7d0e939a5 enhance: add cli completion for comma separated options like --fields
Simply add a :multiple-values key to an option spec
2026-03-17 13:34:13 -04:00
Gabriel Horner
02fbd94d1d fix: overlapping cli option user-only
I introduced this not realizing --include-built-in is the opposite.
Now that --no-include-built-in autocompletion is available, there's
no reason to have confusing, opposite options of each other
2026-03-17 12:27:00 -04:00
Gabriel Horner
9a9504b9b5 enhance: cli completion for negating command boolean options
with '--no-'. Don't do global options as most global options don't
apply to all commands and are already turned off by default
2026-03-17 11:56:03 -04:00
rcmerci
209b499494 062-cli-list-default-sort-updated-at.md 2026-03-17 17:30:17 +08:00
rcmerci
5db3a3086c 061-graph-dir-space-preserve-canonical.md 2026-03-17 16:45:36 +08:00
Gabriel Horner
43a6e9f853 fix: multiple fields not visible for list commands
* uuid, classes, properties, extends and description fields not visible
  for human output even though data is available and users are asking
  to display it with --with-* or --fields
* Also fix recent regression for property types no longer displaying by
  default
* Also fix --with-extends, --with-properties and --with-classes
  depending on undocumented --extra option. Options should be declarative and
  not have hidden dependencies
2026-03-17 00:14:08 -04:00
rcmerci
7575c6b533 enhance(cli): sync subcommand checks corresponding config vars 2026-03-16 20:43:30 +08:00
rcmerci
f7d624c256 fix: sync download 2026-03-15 21:52:22 +08:00
rcmerci
97dd3cef04 fix lint 2026-03-15 17:06:21 +08:00
rcmerci
e6d5228923 fix test 2026-03-15 16:57:24 +08:00