Skip to content

Commit d5386c8

Browse files
rrooijgithub-actions[bot]
authored andcommitted
Update from terminusdb
terminusdb/terminusdb@016f8a1
1 parent 79ed9ee commit d5386c8

File tree

2 files changed

+451
-68
lines changed

2 files changed

+451
-68
lines changed

Diff for: readme/terminusx-db/reference-guides/cli.md

+255-12
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,20 @@ Run the TerminusDB server.
5656

5757
`terminusdb list OPTIONS`
5858

59-
List databases.
59+
List available databases. [DEPRECATED]
6060

6161
* `-h`, `--help`=[value]:
6262
print help for the `list` command
6363

64+
* `-b`, `--branches`=[value]:
65+
also describe the available branches
66+
6467
* `-j`, `--json`=[value]:
6568
Return a JSON as the result of the `list` command
6669

6770
### optimize
6871

69-
`terminusdb optimize OPTIONS`
72+
`terminusdb optimize DB_SPEC OPTIONS`
7073

7174
Optimize a database (including _system and _meta).
7275

@@ -161,7 +164,7 @@ Pull a branch from a database.
161164
print help for the `pull` command
162165

163166
* `-e`, `--remote-branch`=[value]:
164-
set the branch on the remote for push
167+
set the branch on the remote for pull
165168

166169
* `-r`, `--remote`=[value]:
167170
the name of the remote to use
@@ -177,7 +180,7 @@ Pull a branch from a database.
177180

178181
### fetch
179182

180-
`terminusdb fetch BRANCH_SPEC`
183+
`terminusdb fetch DB_SPEC`
181184

182185
fetch data from a remote.
183186

@@ -264,10 +267,10 @@ or two commits (path required).
264267
document id to use for comparisons
265268

266269
* `-p`, `--before_commit`, `--before-commit`=[value]:
267-
Commit of the *before* document(s)
270+
Commit or branch of the *before* document(s)
268271

269272
* `-s`, `--after_commit`, `--after-commit`=[value]:
270-
Commit of the *after* document(s)
273+
Commit or branch of the *after* document(s)
271274

272275
### apply
273276

@@ -311,6 +314,15 @@ Get the log for a branch given by DB_SPEC.
311314
* `-j`, `--json`=[value]:
312315
return log as JSON
313316

317+
### reset
318+
319+
`terminusdb reset BRANCH_SPEC COMMIT_OR_COMMIT_SPEC`
320+
321+
Reset the branch at BRANCH_SPEC to the COMMIT_OR_COMMIT_SPEC
322+
323+
* `-h`, `--help`=[value]:
324+
print help for the `reset` command
325+
314326
### branch create
315327

316328
`terminusdb branch create BRANCH_SPEC OPTIONS`
@@ -321,7 +333,7 @@ Create a branch.
321333
print help for the `branch create` sub command
322334

323335
* `-o`, `--origin`=[value]:
324-
the origin branch to use
336+
the origin branch to use (false for none)
325337

326338
### branch delete
327339

@@ -332,6 +344,24 @@ Delete a branch.
332344
* `-h`, `--help`=[value]:
333345
print help for the `branch delete` sub command
334346

347+
### db list
348+
349+
`terminusdb list DB_SPEC [.. DB_SPECN] OPTIONS`
350+
351+
List available databases.
352+
353+
* `-h`, `--help`=[value]:
354+
print help for the `list` command
355+
356+
* `-b`, `--branches`=[value]:
357+
also describe the available branches
358+
359+
* `-v`, `--verbose`=[value]:
360+
return lots of metadata
361+
362+
* `-j`, `--json`=[value]:
363+
Return a JSON as the result of the `list` command
364+
335365
### db create
336366

337367
`terminusdb db create DATABASE_SPEC OPTIONS`
@@ -356,10 +386,10 @@ Create a database.
356386
* `-k`, `--schema`=[value]:
357387
whether to use a schema
358388

359-
* `-d`, `--data-prefix`=[value]:
389+
* `-d`, `--data_prefix`, `--data-prefix`=[value]:
360390
uri prefix to use for data
361391

362-
* `-s`, `--schema-prefix`=[value]:
392+
* `-s`, `--schema_prefix`, `--schema-prefix`=[value]:
363393
uri prefix to use for schema
364394

365395
* `-x`, `--prefixes`=[value]:
@@ -380,6 +410,30 @@ Delete a database.
380410
* `-f`, `--force`=[value]:
381411
force the deletion of the database (unsafe)
382412

413+
### db update
414+
415+
`terminusdb db update DATABASE_SPEC OPTIONS`
416+
417+
Update a database setting the OPTIONS in an existing database.
418+
419+
* `-h`, `--help`=[value]:
420+
print help for the `db update` sub command
421+
422+
* `-l`, `--label`=[value]:
423+
label to use for this database
424+
425+
* `-c`, `--comment`=[value]:
426+
long description of this database
427+
428+
* `-p`, `--public`=[value]:
429+
whether this database is to be public
430+
431+
* `-k`, `--schema`=[value]:
432+
whether to use a schema
433+
434+
* `-x`, `--prefixes`=[value]:
435+
Explicitly defined prefix set (in JSON)
436+
383437
### doc insert
384438

385439
`terminusdb doc insert DATABASE_SPEC OPTIONS`
@@ -455,6 +509,9 @@ Replace documents.
455509
* `-d`, `--data`=[value]:
456510
document data
457511

512+
* `-j`, `--raw_json`, `--raw-json`=[value]:
513+
replace as raw json
514+
458515
* `-c`, `--create`=[value]:
459516
create document if it does not exist
460517

@@ -467,7 +524,7 @@ Query documents.
467524
* `-h`, `--help`=[value]:
468525
print help for the `doc get` sub command
469526

470-
* `-g`, `--graph_type`=[value]:
527+
* `-g`, `--graph_type`, `--graph-type`=[value]:
471528
graph type (instance or schema)
472529

473530
* `-s`, `--skip`=[value]:
@@ -497,6 +554,180 @@ Query documents.
497554
* `-q`, `--query`=[value]:
498555
document query search template
499556

557+
### role create
558+
559+
`terminusdb role create ROLE_NAME ACTION_1 .. ACTION_N OPTIONS`
560+
561+
Create a new role with the listed actions. Actions may be any of:
562+
"create_database", "delete_database", "class_frame",
563+
"clone", "fetch", "push",
564+
"branch", "rebase", "instance_read_access", "instance_write_access",
565+
"schema_read_access", "schema_write_access", "meta_read_access",
566+
"meta_write_access", "commit_read_access", "commit_write_access",
567+
"manage_capabilities"
568+
569+
* `-h`, `--help`=[value]:
570+
print help for the `role create` sub command
571+
572+
### role delete
573+
574+
`terminusdb role create ROLE_ID_OR_ROLE_NAME`
575+
576+
Delete a role from the system database
577+
578+
* `-h`, `--help`=[value]:
579+
print help for the `role delete` sub command
580+
581+
* `-i`, `--id`=[value]:
582+
Interpret argument as a role Id rather than a name.
583+
584+
### role update
585+
586+
`terminusdb role update ROLE_ID_OR_ROLE_NAME ACTIONS OPTIONS`
587+
588+
Update a role from the system database
589+
590+
* `-h`, `--help`=[value]:
591+
print help for the `role update` sub command
592+
593+
* `-i`, `--id`=[value]:
594+
Interpret argument as a role Id rather than a name.
595+
596+
### role get
597+
598+
`terminusdb role get <ROLE_ID_OR_ROLE_NAME>`
599+
600+
Get a role description from name or id, or all roles if unspecified.
601+
602+
* `-h`, `--help`=[value]:
603+
print help for the `role get` sub command
604+
605+
* `-i`, `--id`=[value]:
606+
Interpret argument as a role id rather than a name.
607+
608+
* `-j`, `--json`=[value]:
609+
Return answer as a JSON document
610+
611+
### organization create
612+
613+
`terminusdb organization create ORGANIZATION_NAME`
614+
615+
Create an organization with a given name.
616+
617+
* `-h`, `--help`=[value]:
618+
print help for the `organization create` sub command
619+
620+
### organization delete
621+
622+
`terminusdb organization delete ORGANIZATION_NAME_OR_ID`
623+
624+
Create an organization with a given name or id.
625+
626+
* `-h`, `--help`=[value]:
627+
print help for the `organization delete` sub command
628+
629+
* `-i`, `--id`=[value]:
630+
Interpret argument as an organization id rather than a name.
631+
632+
### organization get
633+
634+
`terminusdb organization get <ORGANIZATION_NAME_OR_ID>`
635+
636+
Get an organization from its name or id, or list all if unspecified.
637+
638+
* `-h`, `--help`=[value]:
639+
print help for the `organization get` sub command
640+
641+
* `-i`, `--id`=[value]:
642+
Interpret argument as an organization id rather than a name.
643+
644+
* `-j`, `--json`=[value]:
645+
Return answer as a JSON document
646+
647+
### user create
648+
649+
`terminusdb user create USER`
650+
651+
Create a user with a given name USER
652+
653+
* `-h`, `--help`=[value]:
654+
print help for the `user create` sub command
655+
656+
* `-p`, `--password`=[value]:
657+
Specify the password to use for the user
658+
659+
### user delete
660+
661+
`terminusdb organization delete USER`
662+
663+
Delete a user with a given name or ID.
664+
665+
* `-h`, `--help`=[value]:
666+
print help for the `user delete` sub command
667+
668+
* `-i`, `--id`=[value]:
669+
Interpret argument as an organization id rather than a name.
670+
671+
### user get
672+
673+
`terminusdb user get <USER_NAME_OR_ID>`
674+
675+
Get a user from its name or id, or list all if unspecified.
676+
677+
* `-h`, `--help`=[value]:
678+
print help for the `organization get` sub command
679+
680+
* `-i`, `--id`=[value]:
681+
Interpret argument as an organization id rather than a name.
682+
683+
* `-c`, `--capability`=[value]:
684+
Report on all capabilities of this user.
685+
686+
* `-j`, `--json`=[value]:
687+
Return answer as a JSON document
688+
689+
### user password
690+
691+
`terminusdb user password USER`
692+
693+
Change passowrd for user USER
694+
695+
* `-h`, `--help`=[value]:
696+
print help for the `user create` sub command
697+
698+
* `-p`, `--password`=[value]:
699+
Specify the password to use for the user
700+
701+
### capability grant
702+
703+
`terminusdb capability grant USER SCOPE ROLE1 <...ROLEN>`
704+
705+
Grant ROLE1 ... ROLEN over SCOPE to USER
706+
707+
* `-h`, `--help`=[value]:
708+
print help for the `store init` sub command
709+
710+
* `-i`, `--ids`=[value]:
711+
Should the User, Scope and Role be treated as IDs or names
712+
713+
* `-s`, `--scope_type`, `--scope-type`=[value]:
714+
Should the scope be interpreted as a `database` (default) or an `organization`
715+
716+
### capability revoke
717+
718+
`terminusdb capability revoke USER SCOPE ROLE1 <...ROLEN>`
719+
720+
Revoke ROLE1 ... ROLEN over SCOPE from USER
721+
722+
* `-h`, `--help`=[value]:
723+
print help for the `store init` sub command
724+
725+
* `-i`, `--ids`=[value]:
726+
Should the User, Scope and Role be treated as IDs or names
727+
728+
* `-s`, `--scope_type`, `--scope-type`=[value]:
729+
Should the scope be interpreted as a `database` (default) or an `organization`
730+
500731
### store init
501732

502733
`terminusdb store init OPTIONS`
@@ -612,7 +843,8 @@ List remotes.
612843

613844
The designation of databases, repositories, the associated commit
614845
graph of a database, and various graphs as used in the above command
615-
requires the use of an appropriate descriptor path.
846+
requires the use of an appropriate descriptor path which is referred to
847+
as the DB_SPEC.
616848

617849
* `_system`:
618850
This is the system meta-data, which contains the user information,
@@ -644,6 +876,17 @@ requires the use of an appropriate descriptor path.
644876
The descriptor which allows an individual commit to be addressed
645877
directly.
646878

879+
For commands that refer to a GRAPH_SPEC, it should be a DB_SPEC
880+
(specifying the precise branch if a database) followed by one of:
881+
882+
* `DB_SPEC/instance`
883+
884+
* `DB_SPEC/schema`
885+
886+
For example:
887+
888+
`terminusdb triples dump admin/people/local/branch/main/schema`
889+
647890
## ENVIRONMENT
648891

649892
* `TERMINUSDB_SERVER_NAME`:
@@ -756,4 +999,4 @@ Dmytri Kleiner <[email protected]>
756999

7571000
[Paulo Moura](https://github.com/pmoura)
7581001

759-
Sean Leather <[email protected]>
1002+
Sean Leather <[email protected]>

0 commit comments

Comments
 (0)